Commit Graph

156 Commits

Author SHA1 Message Date
Behdad Esfahbod 0475ef2f97 [buffer] Add debugging, aka, message, API
Currently just announces lookup applications.  Message-API *will* change.
hb-shape / hb-view are updated to print-out messages to stder if --debug
is specified.
2015-12-18 19:29:06 +00:00
Behdad Esfahbod 21e5d7edc4 [util] Use O_BINARY instead of _O_BINARY
The latter doesn't seem to be available in Cygwin.  I'm surprised it
compiled before...
2015-12-17 16:28:38 +00:00
Behdad Esfahbod 808d3fc0ea [util] Port hb-view to use font metrics from HarfBuzz instead of cairo 2015-12-10 16:55:16 +01:00
Chun-wei Fan a49e7b7e40 MSVC builds: Add fallback implementation for pre-2013 MSVC
Pre-2013 MSVC does not have scalbn() and scalbnf(), which are used in the
utility programs.  Add  fallback implementations for these, which can be
used when necessary.
2015-11-16 23:04:36 +08:00
Chun-wei Fan 998e8dda93 util: Fix build on Visual Studio
Use the fallback implementation for lround() only on pre-2013 Visual
Studio, and ensure we are clear about the types of the parameters for
lround() and scalbnf(), since Visual Studio can be quite picky on
ambiguous parameter types.  Also, use g_ascii_strcasecmp() rather than
strcasecmp() as we are already using GLib for this code and we are
assured that g_ascii_strcasemp() is available.

For scalbnf() on pre-2013 Visaul Studio, a fallback implementation is
needed, but use another forced-included header for those compilers, which
will be added later.

Also use (char)27 on Visual Studio builds as '\e' is not a recognized
escape sequence, which will do the same thing.
2015-11-16 23:04:35 +08:00
Behdad Esfahbod e97835ad43 [util] Fix crash when --output-file is specified but not --output-format 2015-11-10 11:37:01 -08:00
Behdad Esfahbod 6c0ebd02c9 [util] If font has color, generate PNG with color 2015-11-05 11:37:48 -08:00
Behdad Esfahbod 3530cc2d7c [util] Fix option-parsing leaks 2015-11-03 12:13:28 -08:00
Behdad Esfahbod 642135f3b2 [util] In --debug mode, duplicate font data
This has the effect that the font data will end up in a memory
section malloc()ed exactly to its size.  This gives us better
valgrind detection of out-of-bounds access.

Previously, the font data was placed in a mmap()ed section or
GString-allocated area, which didn't have proper protections
at the end when running under valgrind.
2015-11-03 11:26:34 -08:00
Behdad Esfahbod fdd1770e00 Add API/cmdline to show glyph extents when serializing buffer
New API: HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS

hb-shape now accepts --show-extents.

Patch from Simon Cozens.
2015-08-24 13:49:55 +01:00
Behdad Esfahbod 376d587f36 Implement more granular cluster-merging
TODO: Documentation.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71445
2015-07-22 16:51:12 +01:00
Behdad Esfahbod cd042fc8c4 [util] Disable hb-fc-list for now
Until I figure out what to do about the API, and finalize
the tool.
2015-06-18 11:07:52 -07:00
Behdad Esfahbod 16dac7eccf Fix build 2015-06-03 12:07:46 -07:00
Behdad Esfahbod ff0f210519 [util] Minor 2015-05-18 18:37:46 -07:00
Behdad Esfahbod 820505a186 Whitespace 2015-04-13 23:51:45 -07:00
Behdad Esfahbod 76d5733111 Merge pull request #86 from cpfair/hb-shape-output-help-improvement
Improve hb-shape/hb-view's help text w.r.t. output options
2015-04-13 23:40:35 -07:00
Behdad Esfahbod fe97b65a54 [utils] Add hb-fc-list
This is a tool that lists all fonts that can render a given string.
It uses hb_shape() to do so, and as such is aware of HarfBuzz's
normalizer.
2015-04-09 19:16:57 -07:00
Behdad Esfahbod e8fd83932a [util/hb-view] Fix rendering with all combinations of negative scales 2015-04-09 15:52:26 -07:00
Behdad Esfahbod 69d5af9316 [util] Minor 2015-04-09 15:17:16 -07:00
Behdad Esfahbod a664810e38 [util] Accept comma as well as space when separating components of args
Applies to --font-size and --margin.

Hopefully the scanf usage here doesn't have compatibility issues
(star being counted in the return value, etc).
2015-04-09 15:05:07 -07:00
Behdad Esfahbod e2d4e8480d [util] Add convenience "make lib" target 2015-02-25 15:43:24 -08:00
Collin Fair 9ee176ee97 Stop hb-shape docs leaking into hb-view 2015-02-14 09:59:44 -05:00
Collin Fair 952b8dbdf6 'All' of the above, not 'each' 2015-02-14 09:45:20 -05:00
Collin Fair 9e867b6446 Remove reference to --help-output-content in --help-output (as --help-output-format's options aren't available in hb-view) 2015-02-14 09:32:50 -05:00
Collin Fair 1d55ffeb66 Add serialization syntax documentation. Clarify naming and wording in --help-output/--help-format 2015-02-14 09:29:35 -05:00
Behdad Esfahbod cd4eb96abb [util] Add --font-size to hb-shape
Also makes hb-view to use 8 bits of subpixel precision and shape at
requested size, instead of always shaping at upem and scaling results.
2015-01-20 12:45:13 -08:00
Behdad Esfahbod 5789ca69d7 [util] Minor 2015-01-20 12:45:13 -08:00
Behdad Esfahbod c36c4a9924 Add missing va_end()
Fixes https://github.com/behdad/harfbuzz/pull/74
2015-01-02 14:09:23 -08:00
Behdad Esfahbod 80f7728226 [util] Fix ansi output when surface is empty 2014-09-25 17:59:46 +03:00
Behdad Esfahbod 0de25d4184 [util] Note CSS compatibility in --help-features 2014-07-25 12:35:03 -04:00
Behdad Esfahbod 0afedaa96c [util/hb-shape] Fix crash; oops 2014-07-09 17:00:48 -04:00
Behdad Esfahbod 9109f1e944 [util/hb-shape] Accept an empty output-format that would skip output
Useful for benchmarking, to avoid buffer serialization overhead (which
seems to by far dominate shaping!)
2014-07-08 20:02:29 -04:00
Behdad Esfahbod 8656408572 [util] Fix hb-view rendering with --font-funcs=ot 2014-07-08 18:10:20 -04:00
Behdad Esfahbod 8650def735 [util] Add option to set font function implementation to use
Supports ft and ot right now.  hb-view currently not rendering with ot.
Will fix after some clean up.
2014-07-05 15:51:25 -04:00
Behdad Esfahbod 2306ad46dc [util] Fix memory issue 2014-07-04 18:09:29 -04:00
Behdad Esfahbod 903648437c Start fleshing out builtin font functions 2014-03-24 15:19:15 -07:00
Behdad Esfahbod ea5e8a02eb [util] Plug minor leak 2014-03-19 15:38:02 -07:00
Behdad Esfahbod d688475ea9 Minor 2013-12-12 13:21:57 -05:00
Behdad Esfahbod adb039554d Minor 2013-12-04 20:10:27 -05:00
Behdad Esfahbod c704a8700e [util] Fix uninitialized memory access 2013-12-02 05:42:04 -05:00
Behdad Esfahbod 260a3198f4 [util] Plug leak 2013-12-02 05:39:39 -05:00
Behdad Esfahbod c77d1ade68 Fix warnings 2013-10-27 23:53:55 +01:00
Behdad Esfahbod c2bc818706 Work with old and new glib
Avoids "deprecated" warnings.
2013-10-27 23:37:14 +01:00
Behdad Esfahbod 9326d48e43 Don't use g_mapped_file_unref()
Was introduced in glib 2.22.
2013-10-10 20:04:42 +02:00
Behdad Esfahbod 078de49ca1 [util] Don't use g_array_unref()
Was introduced in glib 2.22.
2013-09-26 18:26:43 -04:00
Behdad Esfahbod 4dc798de19 Add hb-deprecated.h, and rename a couple enum values
Add deprecated alias for old name.
2013-08-27 11:46:08 -04:00
Behdad Esfahbod 5fbc952524 Fix glyph name printing in hb-ot-shape-closure 2013-07-29 14:34:40 -04:00
Behdad Esfahbod 7235f33f9e Fix misc warnings reported by cppcheck
https://bugs.freedesktop.org/show_bug.cgi?id=65544
2013-06-10 15:08:49 -04:00
Chun-wei Fan b4c5c52944 util/ansi-print.cc: Use fallback implementation for lround on MSVC
Unfortuately Visual Studio (still) does not support the C99 function
lround, so provide a fallback implementation for it.
2013-06-03 18:50:26 -04:00
Behdad Esfahbod e4046080c5 [util] Unbreak --show-text / --show-unicode 2013-04-17 23:49:54 -04:00