Commit Graph

479 Commits

Author SHA1 Message Date
Behdad Esfahbod c221dc0ba7 [ot-shape] Move code around 2018-11-14 19:57:19 -05:00
Behdad Esfahbod 3c3eb5ea9c [aat] Disable fallback mark advance zeroing and positioning if morx applied
Fixes https://github.com/harfbuzz/harfbuzz/issues/1357
2018-11-13 21:10:10 -05:00
Behdad Esfahbod cc8428756a [shape-plan] Cache shape plans with variations based on variation indices 2018-11-12 18:48:10 -05:00
Behdad Esfahbod 1082338525 [shape-plan] Only use shape-plan key to initialize hb_ot_shape_plan_t
Such that we don't accidentally use info not in the cache key.
2018-11-12 18:05:02 -05:00
Behdad Esfahbod 3e284e02c2 [shape-plan] Minor 2018-11-11 22:51:34 -05:00
Behdad Esfahbod f521a28b4a Embed hb_ot_shape_plan_t into hb_shape_plan_t
No other shaper will need shape_plan_data, by definition.  So, remove
abstraction layer and always create hb_ot_shape_plan_t as part of
hb_shape_plan_t.
2018-11-11 21:54:10 -05:00
Behdad Esfahbod 1beacdded9 Minor 2018-11-11 16:35:28 -05:00
Behdad Esfahbod 385f78b312 [aat] Remove deleted-glyhs after applying kerx/kern
Finally:  Fixes https://github.com/harfbuzz/harfbuzz/issues/1356

Test case:
$ ./hb-shape GeezaPro.ttc -u U+0628,U+064A,U+064E,U+0651,U+0629
[u0629.final.tehMarbuta=4+713|u064e_u0651.shaddaFatha=1@0,-200+0|u064a.medial.yeh=1+656|u0628.initial.beh=0+656]

The mark positioning (kern table CrossStream kerning) only works if deleted
glyph (as result of ligation) is still in stream and pushed through the
state machine.
2018-11-07 17:20:47 -05:00
Behdad Esfahbod ca23567f41 Disable fallback mark positioning if kern table has cross-stream kerning
Happens even if the cross-stream kerning is for cursive attachment only.  Oh well..
2018-11-07 16:19:51 -05:00
Behdad Esfahbod 5cf6f94dfd Don't apply both kerx and kern
Ouch!
2018-11-07 16:07:22 -05:00
Behdad Esfahbod 41cff7afc9 Minor 2018-11-07 16:05:36 -05:00
Behdad Esfahbod 649cc3ef27 [kerx] Don't disable crossKerning if kern feature is off 2018-11-07 14:07:13 -05:00
Behdad Esfahbod 0c3b061ac2 [kern] Apply erlier, where GPOS/kerx are applied 2018-11-07 13:58:41 -05:00
Behdad Esfahbod 914b595f25 [ot-face] Include hb-ot-face directly in hb_face_t
Simplifying access coming next.
2018-11-05 23:10:12 -05:00
Behdad Esfahbod 17335a8161 Clean up buffer->swap_buffers() calls
That function checks for buffer->successful already.  No need
to check at call site.
2018-11-04 02:25:07 -05:00
Behdad Esfahbod 095f5add0b [kern] Push apply loop to each subtable 2018-11-02 13:23:54 -04:00
Behdad Esfahbod 80d9a427cf [docs] Document remaining sections 2018-10-27 04:58:32 -07:00
Behdad Esfahbod 39bd07aed5 Fix bunch of unused parameter warnings
Show up with gcc -O0.

There's a few more but those are functions that need to be filled in.

Maybe this is a lost battle...
2018-10-26 21:22:26 -07:00
Behdad Esfahbod f33ad6d692 [aat] Fix up previous commit and add files 2018-10-23 14:31:51 -07:00
Behdad Esfahbod ffe3478448 [aat] Allow enabling/disabling features
Only works at entire-buffer range, not sub-ranges.

Test with:

$ hb-shape Zapfino.dfont Zapfino
[Z_a_p_f_i_n_o=0+2333]

$ hb-shape Zapfino.dfont Zapfino --features=-dlig
[Z=0+416|a=1@-21,0+264|p_f=2+433|i=4+181|n=5+261|o=6+250]

$ hb-shape Zapfino.dfont Zapfino --features=+dlig
[Z_a_p_f_i_n_o=0+2333]

Fixes https://github.com/harfbuzz/harfbuzz/issues/1303
2018-10-23 14:14:03 -07:00
Behdad Esfahbod 76324d95ca Shift code around 2018-10-23 13:09:30 -07:00
Behdad Esfahbod cf92d6579e [trak] Allow disabling tracking for ranges of text
Fixes https://github.com/harfbuzz/harfbuzz/issues/1303
2018-10-23 03:10:56 -07:00
Ebrahim Byagowi 22ecefd88e Make tracking optout possible using 'trak' ot feature
So '--features=-trak' or 'font-feature-settings: 'trak' 0;' can prevent
applying of tracking if used.
2018-10-23 02:57:55 -07:00
Behdad Esfahbod 0b9d60e1a1 [aat] Apply kerx if GPOS kern was not applied
Ned tells me this is what Apple does.
2018-10-11 13:26:58 -04:00
Behdad Esfahbod b59a428af0 Minor 2018-10-11 13:24:17 -04:00
Behdad Esfahbod d6a12dba6d [trak] Fix, and hook up
Works beautifully!  Test coming.
2018-10-11 11:10:06 -04:00
Behdad Esfahbod 34caadc5c7 Ugh. Re-enable accidentally disabled GPOS 2018-10-10 22:17:07 -04:00
Behdad Esfahbod 504cb68fc9 Disable mark advance zeroing as well as mark fallback positioning if doing kerx 2018-10-10 21:29:46 -04:00
Behdad Esfahbod 60f86d32d7 [kerx] Don't loop over kerning subtables if kerning disabled 2018-10-10 18:10:05 -04:00
Behdad Esfahbod 38a7a8a89e Allow HB_OPTIONS=aat to prefer AAT tables over OT
Fixes https://github.com/harfbuzz/harfbuzz/issues/322
2018-10-10 17:44:46 -04:00
Behdad Esfahbod 7727e73756 [kerx] Actually hook up, and fix crash 2018-10-10 13:24:51 -04:00
Behdad Esfahbod a03850a356 Fix GPOS/kern interaction
Oops.  Was checking for kern feature in GSUB, not GPOS.
2018-10-10 10:57:28 -04:00
Behdad Esfahbod d1be805e78 More rewriting plan compile
Hopefully more clear.
2018-10-10 10:49:45 -04:00
Behdad Esfahbod 961ab46b24 More reshuffle plan compile 2018-10-10 10:42:10 -04:00
Behdad Esfahbod 2091b509e3 [kerx] Hook up to shaper 2018-10-10 10:41:08 -04:00
Behdad Esfahbod e655fd38cf Apply TT or fallback kerning when GPOS does not have kern feature
Previously we only did if there was no GPOS whatsoever.  This applies
to Arial, Times New Roman, etc in Win7.  Was not kerning before.  It
is now.
2018-10-10 10:19:07 -04:00
Behdad Esfahbod 53e5594500 [kerx] Implement Format0 apply()
Not hooked up to be called yet.
2018-10-09 22:35:22 -04:00
Behdad Esfahbod a51958819f Apply TrueType/OpenType kern table when GPOS kern feature is not available
Fixes https://github.com/harfbuzz/harfbuzz/issues/250
2018-10-08 23:57:45 -04:00
Behdad Esfahbod 09ad2613c8 Separate fallback kern vs mark positioning 2018-10-08 23:30:24 -04:00
Behdad Esfahbod c0d3bf1baf Minor 2018-10-08 16:32:44 -04:00
Behdad Esfahbod 94368855c6 Remove some code
We use scratch-flags to short-circuit this function.  No need for previous
early loop.
2018-10-07 18:52:48 -04:00
Behdad Esfahbod 71b65eb27d Add API for setting invisible-codepoint
Fixes https://github.com/harfbuzz/harfbuzz/issues/1216

New API:
hb_buffer_set_invisible_codepoint()
hb_buffer_get_invisible_codepoint()

hb-shape / hb-view --invisible-codepoint
2018-10-07 18:43:26 +02:00
Behdad Esfahbod a62f37d6fa Change vendor features from Harf/Buzz to HARF/BUZZ
a01194aaf4 (commitcomment-30772041)

"The tag space of tags consisting of four uppercase letters (A-Z) with no punctuation,
spaces, or numbers, is reserved as a vendor space. Font vendors may use such tags to
identify private features."
2018-10-05 02:49:29 +02:00
Behdad Esfahbod a01194aaf4 Enable two OpenType features, 'Harf' and 'Buzz'
One early, before script-specific features, one late, after.  Allows font
developers to detect us and behave differently if needed.
2018-10-04 13:00:37 +02:00
Behdad Esfahbod 14ff3cbe0f Apply morx if there's no GSUB! 2018-10-04 11:34:21 +02:00
Behdad Esfahbod b710ea4fde Clean Fitzpatrick hack 2018-10-03 21:17:59 +02:00
Behdad Esfahbod 03fb6dd4c7 Rewrite grapheme-formation in terms of new work
Also, don't attach ZWNJ to previous cluster.  Closer to Unicode graphemes.
2018-10-03 21:11:40 +02:00
Behdad Esfahbod 3b78318510 [emoji] Mark emoji contination sequences as continuation
This adds a new grapheme bit.  Not used yet.

Part of https://github.com/harfbuzz/harfbuzz/issues/1159
2018-10-03 20:19:42 +02:00
Behdad Esfahbod 123326e20a Dotted-circle all marks, not just non-spacing, at text beginning 2018-10-03 20:19:42 +02:00
Behdad Esfahbod 0a371fee4d Minor 2018-10-02 14:48:39 +02:00
Behdad Esfahbod 94d15528f8 Minor 2018-10-02 14:45:09 +02:00
Behdad Esfahbod 729f634728 Disable joiner-skipping when looking back for base to attach mark to
Fixes https://github.com/harfbuzz/harfbuzz/issues/1189
2018-10-02 14:41:31 +02:00
Behdad Esfahbod 48c513fec9 Minor 2018-10-02 14:19:34 +02:00
Behdad Esfahbod cca757ae56 Minor 2018-10-02 14:10:26 +02:00
Behdad Esfahbod 96eca87f89 Move things 2018-10-02 13:24:40 +02:00
Behdad Esfahbod 10b6c7c638 Minor include cleanup 2018-10-02 13:11:18 +02:00
Behdad Esfahbod 1d1734e985 Shuffle code around 2018-10-02 13:04:05 +02:00
Behdad Esfahbod d9867497d0 Minor 2018-09-24 18:11:59 -04:00
Behdad Esfahbod f048ead84a Some more 2018-09-24 18:04:17 -04:00
Behdad Esfahbod 71c9f84e7c Make --features rand=1 available to the user
Use rand=255 to mean "randomize".

Part of https://github.com/harfbuzz/harfbuzz/pull/803
2018-09-11 10:47:59 +02:00
Behdad Esfahbod 80de4bcd26 Minor clean up of 'rand' patchset 2018-09-11 10:47:59 +02:00
David Corbett f05df643b4 Allow requesting a specific glyph for 'rand'
Randomization only happens by default. If the user specifies a value for
'rand', that value is respected.
2018-09-11 10:47:59 +02:00
David Corbett c2a75e07e5 Implement 'rand' 2018-09-11 10:47:59 +02:00
Behdad Esfahbod b929100f87 [ot-face] Unify GSUB/GPOS accelerators in the table accelerator framework 2018-08-26 01:15:47 -07:00
Behdad Esfahbod c77ae40852 Rename hb-*private.hh to hb-*.hh
Sorry for the noise, downstream custom builders.  Please adjust.
2018-08-25 22:36:36 -07:00
Behdad Esfahbod 1c6b369324 [ot] Rename hb_ot_layout_t to hb_ot_face_data_t 2018-08-23 11:30:21 -07:00
Behdad Esfahbod 79e21984b1 Add batch advance width callback function
New API:
+hb_font_funcs_set_glyph_h_advances_func
+hb_font_funcs_set_glyph_v_advances_func
+hb_font_get_glyph_h_advances
+hb_font_get_glyph_h_advances_func_t
+hb_font_get_glyph_v_advances
+hb_font_get_glyph_v_advances_func_t
2018-08-06 09:45:17 -07:00
Koji Ishii 9533364cc3 batchwidth 2018-08-06 09:44:46 -07:00
Behdad Esfahbod 3d22aefede Rename 2018-08-01 18:03:32 -07:00
Behdad Esfahbod 42c183f803 Minor 2018-07-27 14:55:29 -07:00
prrace 2e25d8f491 Fix unlikely leaks 2018-07-27 14:54:08 -07:00
Behdad Esfahbod db5d430eff [aat] Update for blob changes
Also, uncomment code again, just "if (0)" it out, so it doesn't get stale again.
2018-07-17 18:14:45 +02:00
Behdad Esfahbod bddeb2b10c Minor renamings of internal inline functions 2018-07-10 14:13:21 +02:00
Garret Rieger 57badadb76 [subset] add a new closure call to hb-ot-layout that can compute the closure over multiple lookups. 2018-06-06 17:50:12 -06:00
Behdad Esfahbod f9abbf83b6 Fix fallout from 975bdd5ef5
Ouch!
2018-06-02 15:46:08 -07:00
Behdad Esfahbod 7185b273b3 Rename in_error to !successful
Towards possibly using Null pool for some nil objects.
2018-05-31 20:03:34 -07:00
Behdad Esfahbod 6c2227640b Add HB_DISALLOW_COPY_AND_ASSIGN 2018-05-25 16:21:27 -07:00
Behdad Esfahbod f673cfbd64 Support scripts that are written both LTR and RTL
Right now only Old Italic is marked as such.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1000
2018-05-07 14:12:17 -07:00
Behdad Esfahbod a60ba7964e s/finish/fini
For consistency.
2018-05-01 19:01:25 -04:00
Behdad Esfahbod ac2ece3e15 [ot] Comment out AAT include 2018-03-07 15:52:42 +01:00
Ebrahim Byagowi 1ab16f4556
[aat] Implement trak logic (#816) 2018-02-24 12:49:42 +03:30
Behdad Esfahbod eada749e46 Use HB_SET_VALUE_INVALID consistently 2018-02-21 00:35:47 -08:00
Behdad Esfahbod 046690a4df [aat] Add hb_aat_apply_context_t 2018-01-19 16:40:13 -08:00
Behdad Esfahbod fd03449094 Rename hb_apply_context_t to hb_ot_apply_context_t 2018-01-19 16:40:13 -08:00
Behdad Esfahbod ee16b9d8d3 Revert accidental morx enablement 2018-01-12 11:28:09 +01:00
Behdad Esfahbod cdfa801ff4 [aat] Tweak previous commit 2018-01-12 11:12:20 +01:00
Behdad Esfahbod 3b1e97f364 Add HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES
New API:
HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES
hb-shape / hb-view --remove-default-ignorables

One more text-rendering-tests test passing.  Eleven failing.
2018-01-10 03:36:03 +01:00
Behdad Esfahbod 0ed69c9462 Disable processing of morx table in ot shaper
So I can merge this to master...
2018-01-10 02:50:49 +01:00
Behdad Esfahbod 748b989a1f [aat/morx] Implement NoncontextualSubtables
Also makes hb-ot-shape call morx for now instead of GSUB... Just for testing.
2018-01-10 02:50:49 +01:00
Behdad Esfahbod 4cf3ab1d81 Minor 2018-01-10 02:50:49 +01:00
ebraminio 7c6937e7c7
Move all references of old url to the new address (#622) 2017-11-20 14:49:22 -05:00
Behdad Esfahbod baf7779d2d Limit how much recursion GSUB/GPOS does
This only counts recursions right now.  Good start.

Hopefully...
Fixes https://github.com/behdad/harfbuzz/issues/429
2017-11-14 21:55:37 -08:00
Behdad Esfahbod 8b9d9b71b0 Fix set initialization issues 2017-10-22 17:48:06 -04:00
Behdad Esfahbod dbdbfe3d7b Use nullptr instead of NULL 2017-10-15 12:11:08 +02:00
Behdad Esfahbod 9786fcd8fd Fix GPOS v_origin ordering
This should affect mark attachment in vertical text.  I have no font to test,
but this sounds the right order.

Noticed while debugging https://github.com/behdad/harfbuzz/issues/532
2017-10-03 17:22:43 +02:00
Behdad Esfahbod 7cc348041d [unsafe-to-break] Fix unsafe-to-break for cluster-level=1
Fixes tests/shaping/tests/cluster.tests
2017-09-04 20:06:21 -07:00
Behdad Esfahbod c449d2d8c9 [unsafe-to-break] Mark during fraction-slash formation
Fixes tests/automatic-fractions.tests
2017-08-30 17:28:22 -07:00
Behdad Esfahbod 1c17c2bde5 [unsafe-to-break] Copy flag to all glyphs in a cluster
Makes consumption easier.
2017-08-11 19:06:07 -07:00
Behdad Esfahbod e2a2b5b229 [unsafe-to-break] Be careful with flag propagation when merging clusters 2017-08-10 20:11:35 -07:00
Behdad Esfahbod 5aec2fb8d0 Remove TODO item that is not going to happen 2017-03-02 11:46:33 -08:00
Behdad Esfahbod 466b3e58bd Shuffle things around a bit 2017-02-03 16:57:15 -08:00
Khaled Hosny 2452543fdd [ot] Fix automatic fraction for RTL scripts (#405)
The numbers for right-to-left scripts are processed also from right to
left, so the order of applying “numr” and “dnom” features should be
reversed in such case.

Fixes https://github.com/behdad/harfbuzz/issues/395
2017-01-18 12:48:13 -08:00
Behdad Esfahbod e2b878055b Disable OTL processing for Hebrew if GPOS doesn't have Hebrew subtable
New approach to fix this:
69f9fbc420

Previous approach was reverted as it was too broad.  See context:
https://github.com/behdad/harfbuzz/issues/347#issuecomment-267838368

With U+05E9,U+05B8,U+05C1,U+05DC and Arial Unicode, we now (correctly) disable
GDEF and GPOS, so we get results very close to Uniscribe, but slightly different
since our fallback position logic is not exactly the same:

Before:		[gid1166=3+991|gid1142=0+737|gid5798=0+1434]
After:		[gid1166=3+991|gid1142=0@402,-26+0|gid5798=0+1434]
Uniscribe:	[gid1166=3+991|gid1142=0@348,0+0|gid5798=0+1434]
2016-12-22 14:43:23 -06:00
Behdad Esfahbod 1a0f4aa6df Revert "Synthesize GDEF glyph class for any glyph that does not have one in GDEF"
This reverts commit 69f9fbc420.

See https://github.com/behdad/harfbuzz/issues/347#issuecomment-268873401
Fixes https://github.com/behdad/harfbuzz/issues/347
2016-12-22 14:43:14 -06:00
Behdad Esfahbod 0aedfd59be [GX] Apply 'rvrn' feature before any other feature 2016-12-16 19:06:26 -06:00
Behdad Esfahbod 72ada4f0c6 [GX] Hook up feature variations
Shape-plan caching is not implemented.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod 69f9fbc420 Synthesize GDEF glyph class for any glyph that does not have one in GDEF
Previously we only synthesized GDEF glyph classes if the glyphClassDef
array in GDEF was null.  This worked well enough, and is indeed what
OpenType requires: "If the font does not include a GlyphClassDef table,
the client must define and maintain this information when using the
GSUB and GPOS tables."  That sentence does not quite make sense since
one needs Unicode properties as well, but is close enough.

However, looks like Arial Unicode as shipped on WinXP, does have GDEF
glyph class array, but defines no classes for Hebrew.  This results
in Hebrew marks not getting their widths zeroed.  So, with this change,
we synthesize glyph class for any glyph that is not specified in the
GDEF glyph class table.  Since, from our point of view, a glyph not
being listed in that table is a font bug, any unwanted consequence of
this change is a font bug :).

Note that we still don't get the same rendering as Uniscribe, since
Uniscribe seems to do fallback positioning as well, even though the
font does have a GPOS table (which does NOT cover Hebrew!).  We are
not going to try to match that though.

Test string for Arial Unicode:

	U+05E9,U+05B8,U+05C1,U+05DC

Before:		[gid1166=3+991|gid1142=0+737|gid5798=0+1434]
After:		[gid1166=3+991|gid1142=0+0|gid5798=0+1434]
Uniscribe:	[gid1166=3+991|gid1142=0@348,0+0|gid5798=0+1434]

Note that our new output matches what we were generating until July
2014, because the Hebrew shaper used to zero mark advances based on
Unicode, NOT GDEF.  That's 9e834e29e0.

Reported by Greg Douglas.
2016-03-17 11:59:43 -07:00
Behdad Esfahbod 8b5bc141cd Add get_nominal_glyph() and get_variation_glyph() instead of get_glyph()
New API:
- hb_font_get_nominal_glyph_func_t
- hb_font_get_variation_glyph_func_t
- hb_font_funcs_set_nominal_glyph_func()
- hb_font_funcs_set_variation_glyph_func()
- hb_font_get_nominal_glyph()
- hb_font_get_variation_glyph()

Deprecated API:
- hb_font_get_glyph_func_t
- hb_font_funcs_set_glyph_func()

Clients that implement their own font-funcs are encouraged to replace
their get_glyph() implementation with a get_nominal_glyph() and
get_variation_glyph() pair.  The variation version can assume that
variation_selector argument is not zero.
2016-02-24 19:05:23 +09:00
Behdad Esfahbod 815bdd7700 In cluster-level=0, group ZWJ/ZWNJ with previous cluster
This better emulates Unicode grapheme clusters.

Note that Uniscribe does NOT do this, but should be harmless with most clients,
and improve fallback with clients that use HarfBuzz cluster as unit of fallback.

Fixes https://github.com/behdad/harfbuzz/issues/217
2016-02-22 18:22:44 +09:00
Behdad Esfahbod 89137e325a Minor 2016-02-22 16:00:59 +09:00
Behdad Esfahbod 62c2711121 [coretext] Limit grapheme-cluster forming to cluster-level=0 2016-02-22 15:07:20 +09:00
Behdad Esfahbod 7d8d58ac81 [GPOS] Divide position_finish() into two phases, for advances and offsets
Right now the position_finish_advances() is empty.  To be used for
spacing attachments proposal later.
2016-02-11 16:34:28 +07:00
Behdad Esfahbod 8474231567 [ot] Minor shuffling code around 2016-02-11 16:27:41 +07:00
Behdad Esfahbod 660c9d3fc2 Remove font-dependent ASCII-only perf hack
Is confusing.  I already hit it myself.  Remove.  We can optimize
ASCII based on Unicode properties.  But should not do based on
assumptions on the font.
2016-02-11 12:14:27 +07:00
Behdad Esfahbod eaadcbbc53 Remove now-unused mark zeroing BY_UNICODE 2016-02-10 18:29:54 +07:00
Behdad Esfahbod 35d18585fc Fix a few docs blocks 2015-11-26 19:30:37 -05:00
Behdad Esfahbod ea512f7108 Use C-style casts instead of compare to 0, to convert hb_bool_t to bool 2015-11-26 19:22:22 -05:00
Behdad Esfahbod 67a36a725e Fix vertical GPOS
This was brorken earlier, though, it's really hard to notice it.
Unlike the glyph_h_origin(), an unset glyph_v_origin() does NOT
mean that the vertical origin is at 0,0.

Related to https://github.com/behdad/harfbuzz/issues/187
2015-11-26 18:49:54 -05:00
Behdad Esfahbod 766963adba Merge pull request #114 from ThePhD/vc++-fixes
Fix all VC++ warnings and errors
2015-11-24 15:38:43 -06:00
Behdad Esfahbod abadc1717d Try to better handle OOM situations
Fixes assert fail in https://github.com/behdad/harfbuzz/issues/161
with libharfbuzz-fuzzing.
2015-11-18 17:52:08 -08:00
Behdad Esfahbod 4301703bdd Limit buffer max size growth
https://github.com/behdad/harfbuzz/issues/161
2015-11-05 23:44:59 -08:00
Behdad Esfahbod 136863371c Add new shaper method postprocess_glyphs()
Unused currently.  To be used for Syriac stretch implementation.

https://github.com/behdad/harfbuzz/issues/141
2015-11-05 13:24:15 -08:00
Behdad Esfahbod e95eb23a4e Don't try zeroing marks by GDEF if there are no non-ASCII
This one is a hack, but should be ok.
2015-11-04 22:59:28 -08:00
Behdad Esfahbod 7fa54ed75a Don't try zeroing mark attachments by Unicode if there's no non-ASCII 2015-11-04 22:59:24 -08:00
Behdad Esfahbod 0f407325f6 Minor 2015-11-04 22:28:44 -08:00
Behdad Esfahbod 497a6c2071 Skip forming clusters if text is all ASCII 2015-11-04 22:24:19 -08:00
Behdad Esfahbod 5bc28b5f68 Optimize positioning for when h_origin is nil 2015-11-04 21:53:16 -08:00
Behdad Esfahbod bee901b38e Optimize positioning direction calculations
It makes the binary smaller AND faster.  Yumm!
2015-11-04 19:28:17 -08:00
Behdad Esfahbod e3e4bb011a Don't do fractions if buffer is ASCII-only 2015-11-04 18:58:02 -08:00
Behdad Esfahbod 6986208ba3 Optimize runs without Default_Ignorable's
Now that we have a buffer-wide scratch flags facility, use it to
optimize away a few passes.
2015-11-04 18:46:41 -08:00
Behdad Esfahbod 49ef630936 Adjust the width of various spaces if font does not cover them
See discussion here:
81ef4f407d

There's no way to disable this fallback, but I don't think it would
be needed.  Let's hope for the best!

Fixes https://github.com/behdad/harfbuzz/issues/153
2015-11-04 17:27:07 -08:00
Behdad Esfahbod aa7044de0c Generalize flags types 2015-11-04 16:25:57 -08:00
Behdad Esfahbod f883de664f [OT] Merge /before/ reordering 2015-09-01 16:23:40 +01:00
Behdad Esfahbod e47b772a56 [ot] Change buffer content type right after we map to glyphs
Needed for upcoming debug output changes.
2015-08-18 18:42:47 +01:00
ThePhD 5c99cf93d6 Merge branch 'master' into vc++-fixes 2015-08-14 01:02:00 -04:00
Behdad Esfahbod 0f98fe88f4 [ot] Search globally for 'vert' feature if not found in specified script/lang
Fixes https://github.com/behdad/harfbuzz/issues/63
2015-07-23 11:52:11 +01:00
Behdad Esfahbod f327aacfa1 [ot] Minor 2015-07-23 11:32:59 +01:00
Behdad Esfahbod 8cfbc304ee Fix hide-default-ignorables after f0010dfd01
We can't delete things before hb_ot_layout_position_finish().  So,
just zero the advance before it, and remove later.
2015-07-22 18:41:10 +01:00
Behdad Esfahbod 2dbd3d29d6 Fix hide-ignorables if font doesn't have space glyph
Was broken by 82b521aeb7, as we have
positioning data by then and can't use the output buffer.  Ouch!
2015-07-22 18:29:47 +01:00
Behdad Esfahbod 4ba796b26e Refactor _hb_glyph_info_is_default_ignorable() 2015-07-22 17:41:31 +01:00
Behdad Esfahbod f0010dfd01 [ot] Hide default-ignorables before finishing off positioning
For example, fixes the following sequence with Arial XP:
628 25cc 651 25cc 64e 3a 20 628 651 34f 64e
628 25cc 64e 25cc 651 3a 20 628 64e 34f 651

Discovered as part of:
https://bugs.freedesktop.org/show_bug.cgi?id=85873
2015-07-22 17:36:23 +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 a60e2cfa39 [ot] Don't rely on cluster numbers for ensure_native_direction() 2015-07-22 15:49:08 +01:00
Behdad Esfahbod 701112dad9 [ot] Simplify form_clusters() 2015-07-22 15:42:20 +01:00
Behdad Esfahbod 7b8b63adc5 [ot] Don't mirror character if font doesn't support mirrored character! 2015-07-22 15:24:26 +01:00
ThePhD 8e545d5961 Fix all VC++ warnings and errors in the current commit's builds. 2015-06-22 22:29:04 -04:00
Behdad Esfahbod 5f13bbd9d4 When removing default-ignorables, merge clusters
Fixes test-shape, and:
https://code.google.com/p/chromium/issues/detail?id=497578
2015-06-19 13:31:49 -07:00
Behdad Esfahbod 82b521aeb7 Rewrite hide_default_ignorables
Separate the loops for the two cases of replacing with space
and deleting.  For deleting, use the out-buffer machinery.

Needed for upcoming cluster merge fix.
2015-06-19 13:26:03 -07:00
Sascha Brawer 01c3a88543 Fix "Since:" tags
Based on data from http://upstream-tracker.org/versions/harfbuzz.html
Resolves #103
2015-06-01 13:25:27 +02:00
Behdad Esfahbod 982d94eaa2 [coretext] Don't generate notdef glyph for default-ignorables
As discovered on Chrome Mac:
https://code.google.com/p/chromium/issues/detail?id=452326
2015-01-28 10:51:33 -08:00