Commit Graph

43 Commits

Author SHA1 Message Date
Behdad Esfahbod c462b32dcb Disable automatic segment properties guessing
Before, if one called hb_shape() without setting script, language, and
direction on the buffer, hb_shape() was calling
hb_buffer_guess_segment_properties() on the user's behalf to guess
these.

This is very dangerous, since any serious user of HarfBuzz must set
these properly (specially important is direction).  So now, we don't
guess properties by default.  People not setting direction will get
an abort() now.  If the old behavior is desired (fragile, good for
simple testing only), users can call
hb_buffer_guess_segment_properties() on the buffer just before calling
hb_shape().
2013-02-15 07:51:47 -05:00
Behdad Esfahbod e2aab4b5db Improve checks for setmode()
As reported by Jonathan, OS X has setmode() that is something other
than what setmode() is on Win32.  So, limit invocation to Windows
platforms only.
2013-02-12 15:35:32 -05:00
Behdad Esfahbod bc76449f51 Use setmode() instead of _setmode()
Looks like Cygwin / MSVC declare it that way, and it still works on
MinGW32 cross.
2013-01-31 18:18:05 -05:00
Behdad Esfahbod 1172dc7362 Rename hb_buffer_clear() to hb_buffer_clear_contents()
The previous name was clashing with harfbuzz.old.  There are systems
that need to link both...

Clash-free now again.
2013-01-07 16:46:37 -06:00
Behdad Esfahbod 9815a88111 [util] List supported output formats in --help output 2012-12-21 16:46:53 -05:00
Behdad Esfahbod 6bad092aa8 [util] Default to "text" output format in hb-shape
If you say:

  hb-shape font.ttf text --output-file out.txt

This was previously failing:

  Unknown output format `txt'; supported formats are: TEXT / JSON

Now we simply fallback to TEXT if no explicit format was requested.
2012-12-21 16:01:52 -05:00
Behdad Esfahbod f9edf16725 Add buffer serialization / deserialization API
Two output formats for now: TEXT, and JSON.  For example:

  hb-shape --output-format=json

Deserialization API is added, but not implemented yet.
2012-11-15 13:10:07 -08:00
Behdad Esfahbod 407f80d625 [util] Add --bot / --eot / --preserve-default-ignorables 2012-11-13 15:33:27 -08:00
Behdad Esfahbod 321f73c16e [util] Add --text-before and --text-after to hb-shape / hb-view
Use with Arabic, for example, to see the effect on joining.
2012-11-13 15:12:24 -08:00
Behdad Esfahbod ade7459ea7 [util] Fix leaks 2012-08-06 19:49:42 -07:00
Behdad Esfahbod 39b17837b4 Add hb_buffer_normalize_glyphs() and hb-shape --normalize-glyphs
This reorders glyphs within the cluster to a nominal order.  This should
have no visible effect on the output, but helps with testing, for
getting the same hb-shape output for visually-equal glyphs for each
cluster.
2012-07-17 17:09:29 -04:00
Behdad Esfahbod 0594a24484 Cleanup TRUE/FALSE vs true/false 2012-06-05 20:35:40 -04:00
Behdad Esfahbod c188548312 Add --verbose to hb-shape
Just turns all --show-* options on.
2012-06-04 09:09:59 -04:00
Behdad Esfahbod ae62166519 [util] Minor 2012-06-02 12:21:19 -04:00
Behdad Esfahbod 5db0683a82 [util] Make hb-shape continue shaping other lines if shapers failed 2012-06-02 12:13:08 -04:00
Behdad Esfahbod c87b317f0e [util] Add hb-ot-shape-closure tool
Computes all the glyphs that may be generated given a font and
set of Unicode characters.

The order of the Unicode characters is irrelevant.

Sample output:

behdad:util 0$ ./hb-ot-shape-closure Doulos\ SIL\ Regular.ttf f
f f_f

behdad:util 0$ ./hb-ot-shape-closure Doulos\ SIL\ Regular.ttf i
i

behdad:util 0$ ./hb-ot-shape-closure Doulos\ SIL\ Regular.ttf fi
f f_i f_f_i f_f i

behdad:util 0$ ./hb-ot-shape-closure DroidNaskh-Regular.ttf ب
uni0628 uni0628.init uni0628.medi uni0628.fina

behdad:util 0$ ./hb-ot-shape-closure DroidNaskh-Regular.ttf ا
uni0627 uni0627.fina

behdad:util 0$ ./hb-ot-shape-closure DroidNaskh-Regular.ttf با
uni0627 uni0627.fina uni0628 uni0628.init uni0628.medi uni0628.fina

behdad:util 0$ ./hb-ot-shape-closure DroidNaskh-Regular.ttf با --no-glyph-names
5 6 133 134 135 136
2012-05-15 23:53:18 -04:00
Behdad Esfahbod 912c5ff80a Reduce default margin 2012-05-13 12:51:02 +02:00
Behdad Esfahbod 52e7b1424a [util] Make hb-view print out Unicode art if stdout is a terminal 2012-05-13 07:55:00 +02:00
Behdad Esfahbod 30874b4819 [util] Make tools default to stdin if no text is provided
One less argument to type in typical testing workflow!
2012-05-12 15:54:27 +02:00
Behdad Esfahbod 2097951110 [util] Change default font size of hb-view to 256
Most common usecase of hb-view is to test rendering of short words for
testing / inspection.  Not having to type "--font-size 150" each time
isn't such a bad idea...
2012-05-12 15:41:48 +02:00
Behdad Esfahbod 95cefdf96e Add --utf8-clusters
Also fix cairo cluster generation.
2012-04-16 18:08:20 -04:00
Behdad Esfahbod 69b84a8f6c Fix hb-view surface size calc for vertical text
For some reason it doesn't quite work with IranianNastaliq, but
that looks like a font issue.
2012-04-12 15:50:40 -04:00
Behdad Esfahbod 6bd9b479b8 Hide backend-specific shape functions
Also remove shaper_options argument to hb_shape_full().  That was
unused and for "future".  Let it go.

More shaper API coming in preparation for plan/planned API.
2012-04-12 14:53:53 -04:00
Behdad Esfahbod d530024168 [util] Make clusters work with char offset instead of UTF-8 offset
This means the --features indices also refer to char position
instead of byte position now.  Same for cluster values reported
by hb-shape.

Will add an option for byte indices later.
2012-01-21 19:07:22 -05:00
Behdad Esfahbod cdc673d97c [hb-shape] Add --show-line-num
Ok, much more useful as a test suite driver now.
2012-01-19 12:46:18 -05:00
Behdad Esfahbod cc4d9810d6 [hb-shape] Add --show-text and --show-unicode options 2012-01-19 12:32:20 -05:00
Behdad Esfahbod 088c1e27c0 [util] Fix option parsing
Wow, who knew bool is one byte and I was using it as a 4byte int?!

C++ auto casts fails you in mysterious ways...
2011-09-20 14:43:55 -04:00
Behdad Esfahbod 422558142a [util] Account for line-space in surface size 2011-09-19 17:57:02 -04:00
Behdad Esfahbod 8b8b19056d [util] Add hb-shape utility
Like hb-view, but prints out buffer contents.

The output format is kinda cryptic.  Suggestions welcome.
2011-09-19 16:41:17 -04:00
Behdad Esfahbod 11e51993ab [util] Move font-size into view-options 2011-09-19 09:58:55 -04:00
Behdad Esfahbod 55aeb04904 Fix reading text from stdin 2011-09-16 02:08:36 -04:00
Behdad Esfahbod a75c1b1251 Move code around 2011-09-16 01:16:41 -04:00
Behdad Esfahbod 4451168e5d Fix binary stdin/stdout io in Windows
Make --font-file accept "-" to mean stdin, and have it work
in Windows too!
2011-09-16 00:41:08 -04:00
Behdad Esfahbod 639b5957d9 Minor 2011-09-15 18:09:49 -04:00
Behdad Esfahbod f7e2ef74f8 [hb-view] Make print to stdout work in Windows
Apparently there's no equivalent to "/dev/stdout", so write using
stdio to be able to output to stdout.
2011-09-15 18:01:24 -04:00
Behdad Esfahbod b9b10ad78b [util] Refactor hb-view completely
Now we can use the same code to do other utils...
2011-09-15 00:30:41 -04:00
Behdad Esfahbod bc4b07b05e More reshuffling 2011-09-08 17:11:01 -04:00
Behdad Esfahbod 516857eb51 [util] Simplify more 2011-09-08 16:50:24 -04:00
Behdad Esfahbod 4f4b114a55 [util] Move code around 2011-09-08 16:49:02 -04:00
Behdad Esfahbod 90e312cb85 [util] Move code around 2011-09-08 16:42:37 -04:00
Behdad Esfahbod 109cb38289 [util] Further refactor option parsing 2011-09-08 16:00:04 -04:00
Behdad Esfahbod 97796453aa Fix falloffs of the GOption conversion 2011-08-15 19:03:43 +02:00
Behdad Esfahbod 3bb300ee78 Refactor hb-view code 2011-08-11 12:04:03 +02:00