Commit Graph

334 Commits

Author SHA1 Message Date
Behdad Esfahbod 7a4bd97e4a [layout] Build lookup accelerators lazily on-demand
Reduces memory consumption for large multi-script fonts
drastically.
2023-01-31 16:19:37 -07:00
Behdad Esfahbod 83353f13f4 [layout] Reduce memory use slightly
By using raw pointer instead of vector for subtable accelerator.

To be used for more memory saving by making subtable accelerators
lazy-loaded by shape-plans for large fonts.
2023-01-31 16:19:37 -07:00
Behdad Esfahbod 950c7ab3f0 [gsubgpos] Use accelerator when recursing 2023-01-26 15:26:05 -07:00
Kleis Auke Wolthuizen 3238cb744b [GPOS] Fix build on GCC < 7 2022-07-06 14:00:16 +02:00
Garret Rieger 900476c635 Move GSUB.hh GPOS.hh back into the GPOS/GSUB sub directories. 2022-06-30 15:33:20 -06:00
Behdad Esfahbod 050f169078 [GPOS/kerx] Call into impl namespace from kerx 2022-06-28 18:52:27 -06:00
Garret Rieger 3fbf2dece7 [reorg] Move OT::Layout::GPOS_impl::GPOS to OT::Layout::GPOS. 2022-06-28 18:47:50 -06:00
Garret Rieger 88ef3c5a9a [reorg] Change OT::Layout::GPOS to OT::Layout::GPOS_impl. 2022-06-28 18:47:50 -06:00
Garret Rieger 49ddf069e0 [reorg] Move GPOS reverse_cursive_minor_offset implementation into new directory layout. 2022-06-28 18:47:50 -06:00
Garret Rieger 74f45f7c2a [reorg] Move remaining GPOS lookup types to new directory. 2022-06-28 18:47:50 -06:00
Garret Rieger 197d9a5c99 [reorg] Move more GPOS lookups to new directory. 2022-06-28 18:47:50 -06:00
Garret Rieger c7307ca06a [reorg] Begin moving GPOS into the new directory layout. 2022-06-28 18:47:50 -06:00
Behdad Esfahbod d15260ca95 [gpos] Limit recursion depth in propagate_attachment_offsets()
Fixes https://github.com/harfbuzz/harfbuzz/issues/2927
2022-06-25 19:53:11 -06:00
Behdad Esfahbod 9fc9b1ece4 [layout] Minor, add using Lookup to GSUB/GPOS 2022-06-08 12:37:31 -06:00
Behdad Esfahbod 4119f73c21 [subset/layout] Rename dispatch_closure_lookups_recurse_func to dispatch_recurse_func<> 2022-06-08 18:42:09 +01:00
Behdad Esfahbod c13ff39520 [layout] Rename apply_recurse_func to specialization of dispatch_recurse_func 2022-06-08 18:42:09 +01:00
Behdad Esfahbod 880f50f7e4 Refactor varstore cache 2022-05-21 15:12:14 -06:00
Behdad Esfahbod f2a2fb91a3 [GPOS] Cache VarStore region scalars 2022-05-21 15:12:14 -06:00
Behdad Esfahbod 88798ee8be [GPOS] Disable split-kerning
Fixes https://github.com/harfbuzz/harfbuzz/issues/3408
Reverts https://github.com/harfbuzz/harfbuzz/pull/3235
Fixes https://github.com/harfbuzz/harfbuzz/pull/3235#issuecomment-1029814978
2022-02-04 19:01:57 -06:00
Behdad Esfahbod 8663eda4fd [unsafe-to-concat] More annotations for MarkMarkPos
Failures down to one:

265/401 harfbuzz:shaping+aots / lookupflag_ignore_attach         FAIL
2022-01-22 11:53:18 -07:00
Behdad Esfahbod 6a7d6d4b64 [unsafe-to-concat] More annotations for MarkLigaturePos 2022-01-22 11:53:18 -07:00
Behdad Esfahbod b443898cce [unsafe-to-concat] Adjust MarkBasePos
A couple more aots tests down. Four failing:

209/401 harfbuzz:shaping+aots / gpos6                            FAIL             0.06s   exit status 1
261/401 harfbuzz:shaping+aots / gsub4_1_multiple_ligatures       FAIL             0.07s   exit status 1
265/401 harfbuzz:shaping+aots / lookupflag_ignore_attach         FAIL             0.07s   exit status 1
267/401 harfbuzz:shaping+aots / lookupflag_ignore_combination    FAIL             0.07s   exit status 1
2022-01-22 11:53:18 -07:00
Behdad Esfahbod 95d052a791 [unsafe-to-concat] Adjust GPOS lookbacks
Fixes Cursive aots test, fails a couple new aots ones.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod 11bdd7a020 [unsafe-to-concat] Adjust CursivePos
Doesn't fix the test yet.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod 48c5f26199 [unsafe-to-concat] Fix PairPos2 logic
Test failures down from 8 to 6:

113/400 harfbuzz:shaping+in-house / mongolian-variation-selector FAIL             0.06s   exit status 1
203/400 harfbuzz:shaping+aots / gpos3                            FAIL             0.06s   exit status 1
204/400 harfbuzz:shaping+aots / gpos4_lookupflag                 FAIL             0.06s   exit status 1
260/400 harfbuzz:shaping+aots / gsub4_1_multiple_ligatures       FAIL             0.06s   exit status 1
264/400 harfbuzz:shaping+aots / lookupflag_ignore_attach         FAIL             0.06s   exit status 1
266/400 harfbuzz:shaping+aots / lookupflag_ignore_combination    FAIL             0.06s   exit status 1
2022-01-22 11:53:18 -07:00
Behdad Esfahbod 78481b32c0 [gsubgpos] Combine input/backtrack/lookahead unsafe-to-concat
I feel like this is correct logic. Still have to prove.

Errors unchanged at 10.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod 596bc7e939 [unsafe-to-concat] Add to GPOS kerning 2022-01-22 11:53:18 -07:00
Behdad Esfahbod e1cbd4539f [unsafe-to-concat] Add annotations to GPOS and kern
Failures from 13 to 14.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod cce37a6f10 [gpos] Fix conditional 2022-01-21 07:31:21 -07:00
Behdad Esfahbod 84aa1a836c
[PairPos] Split GPOS kerning to both sides (#3235) 2022-01-20 14:18:19 -07:00
Behdad Esfahbod ac1bb3e39e [machinery] Move accelerators to constructor/destructor 2022-01-20 12:10:05 -07:00
Behdad Esfahbod 7e160dc347 [gpos] Fix unsafe-to-break of mark-attachment
This was undetected because most of the time marks were in same
cluster of their base already.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3093
2022-01-19 09:27:55 -07:00
Behdad Esfahbod ff697debd8 [GPOS] Apply font synthetic slant
Part of fixing https://github.com/harfbuzz/harfbuzz/issues/3196
2021-12-19 21:20:25 -08:00
Behdad Esfahbod ef14cad736 [GPOS] Disable vertical advance if HB_NO_VERTICAL 2021-12-08 10:43:52 -08:00
Behdad Esfahbod 6d555ce82e [meta] Use std::forward instead of hb_forward() 2021-11-02 00:18:22 -06:00
Nico Weber 96299d70ed Fix Wbitwise-instead-of-logical warnings
`a || b` only evaluates b if a is false. `a | b` always evaluates
both a and b. If a and b are of type bool, || is usually what you
want, so clang now warns on `|` where both arguments are of type bool.

This warning fires twice in harfbuzz. In both cases, `|` is used
intentionally, with a comment explaining this.

Slightly reorder the code a bit to make the compiler happy, and to
make it obvious even without a comment that both calls should be evaluated.

No intended behavior change.
2021-10-12 08:56:54 -06:00
Garret Rieger c2cc566c9d [subset] Fix subset_offset_array adding unused space to serializer.
ArrayOf.serialize_append allocates space for the new item, but ArrayOf.pop() does not recover the allocated space. So in the case where the revert path was entered the extra space added by serialize_append gets left in the serialization buffer. This moves the snapshot to before ArrayOf.serialize_append is called so that revert cleans up the buffer extend.
2021-09-22 16:07:18 -06:00
Behdad Esfahbod c852b86841 Rename HBGlyphID to HBGlyphID16 2021-09-19 16:30:12 -04:00
Garret Rieger 46d4a5e673 [subset] Convert subset plan to use a flags bit set. 2021-07-29 18:02:34 -07:00
Behdad Esfahbod f0a1892ff9 [serialize] Remove unnecessary pointer indirection 2021-07-28 17:36:22 -06:00
Behdad Esfahbod bb48bf52a4 Rename misc uses of "free"
In preparation for fixing https://github.com/harfbuzz/harfbuzz/issues/3044
2021-07-08 10:54:09 -07:00
Garret Rieger 8443cc85cb [subset] Correct OffsetTo serialization in GPOS to use serialize_serialize (). 2021-06-14 12:18:06 -07:00
Garret Rieger e25efb31f2 [subset] consider all value formats when computing effective format. 2021-04-23 19:09:37 -07:00
Qunxin Liu 84dbfacfec [subset] fix collect_variation_idx in PairPosFormat2 2021-04-23 18:52:24 -07:00
Garret Rieger d356d0f79c [subset] optimize ValueRecord's for PairPosFormat1. 2021-04-23 18:50:34 -07:00
Garret Rieger f9fbe4817e [subset] implement value record optimization for PairPosFormat2. 2021-04-23 18:50:34 -07:00
Garret Rieger badb8e409b [subset] use copy_values for PairPos serialize. 2021-04-23 18:50:33 -07:00
Garret Rieger 2f50283cd3 [subset] Begin implementing ValueRecord optimization:
remove value records which have a zero value.
2021-04-23 18:50:33 -07:00
Garret Rieger 5df7c668ba [subset] In SinglePosFormat1 serialize only 1 value record.
Previously one record per glyph in the subset was serialized.
2021-04-23 18:50:33 -07:00
Garret Rieger 92757f6809 [subset] Don't drop anchor device tables when dropping hints. These may contain variation data.
Update subseting expected files to match latest version of fontTools.
2021-04-23 18:50:33 -07:00