Commit Graph

342 Commits

Author SHA1 Message Date
Qunxin Liu 125450d2f2 [subset] collect name_ids for FeratureParams 2023-03-13 15:43:29 -07:00
Behdad Esfahbod 8708b9e081 [GPOS] Avoid O(n^2) behavior in mark-attachment
Better implementation; avoids arbitrary limit on look-back.
2023-02-06 14:51:25 -07:00
Behdad Esfahbod 661050b465 Revert "[layout] Limit how far we skip when looking back"
This reverts commit 85be877925.
2023-02-06 13:09:14 -07:00
Behdad Esfahbod b29fbd16fa [gsubgpos] Refactor skippy_iter.match() 2023-02-06 13:09:14 -07:00
Behdad Esfahbod 85be877925 [layout] Limit how far we skip when looking back
See comments.
2023-02-01 20:00:43 -07:00
Behdad Esfahbod d18fd3f7eb [layout] Comment 2023-01-31 16:28:49 -07:00
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 49d75ef331 [gsubgpos] Fix bug in cached ChainContextFormat2 application 2023-01-27 15:37:11 -07:00
Behdad Esfahbod d2279a204f [gsubgpos] Avoid a copy into the vector 2023-01-27 13:09:49 -07:00
Behdad Esfahbod 8d29be39b2 [gsubgpos] Minor drop an unnecessary hb_iter 2023-01-26 12:19:16 -07:00
Behdad Esfahbod be8a87c453 Move TRACE_DISPATCH after may_recurse()
Such that we don't get memory access issues if DEBUG_SANITIZE is
on and may_recurse() returns false.
2023-01-21 15:50:25 -07:00
Garret Rieger ea1ee0d4b6 [instance] drop and don't collect lookups from feature variations when fully instancing.
This previously incorrectly collected lookups that could be reached via feature variations that are dropped and not activated by the current instance position.
2023-01-14 18:04:24 -07:00
Behdad Esfahbod ed023f66df Enable -Wformat-signedness
And fix the codebase.
2023-01-12 17:04:24 -07:00
Behdad Esfahbod 1a00ab69ec [subset-plan] Simplify gsub_lookups and gpos_lookups allocation 2023-01-11 10:56:16 -07:00
Behdad Esfahbod 2764a61691 Revert "[gsubgpos] Use swap instead of move"
This reverts commit 8a17cc4ecf.
2023-01-05 15:14:54 -07:00
Behdad Esfahbod 167b7c6046 Revert "[gsubgpos] Reduce hb_set_t allocations"
This reverts commit 0b7f6d6cf0.

Not much benefit as the main allocations come from other places.
2023-01-05 14:48:20 -07:00
Behdad Esfahbod 3947cedd09 Revert "[gsubgpos] Cache pos_glyphs allocation in closure"
This reverts commit 3961cc46bf.

This was wrong...
2023-01-05 14:47:47 -07:00
Behdad Esfahbod 8a17cc4ecf [gsubgpos] Use swap instead of move
Move is wrong when we want to reuse the object.
2023-01-05 14:15:38 -07:00
Behdad Esfahbod 4401dd2482 [gsubgpos] Minor use ->clear() directly 2023-01-05 14:13:57 -07:00
Behdad Esfahbod 0b7f6d6cf0 [gsubgpos] Reduce hb_set_t allocations 2023-01-05 14:05:11 -07:00
Behdad Esfahbod 3961cc46bf [gsubgpos] Cache pos_glyphs allocation in closure
Saves some 3% in Gulzar-Regular subsetting.
2023-01-05 13:58:57 -07:00
Behdad Esfahbod a90f149e1b [gsubgpos] Minor drop an allocation 2023-01-05 13:52:11 -07:00
Behdad Esfahbod 2eacc37e08 [vector] Add internal API for exact-size allocation
Use it from a couple of places.
2022-12-31 12:30:31 -07:00
Behdad Esfahbod 36bef5dccf [gsubgpos] Prealloc subtables vector 2022-12-30 13:58:52 -07:00
Behdad Esfahbod 630b874ae6 [gsubgpos] Add a cache to intersected_class_glyphs
30% gain on subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/1400.
2022-12-03 12:13:15 -07:00
Behdad Esfahbod c044f4af3e [gsubgpos] Remove wrong const 2022-12-03 11:58:04 -07:00
Behdad Esfahbod 2680be1f22 [gsubgpos] Don't set unnecessary funcs 2022-12-03 11:54:52 -07:00
Behdad Esfahbod ac8b232a2d [gsub] Cache intersects_class results for closure
Benchmark                                                                                 Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/10                  +0.0246         +0.0240             0             0             0             0
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/64                  -0.5541         -0.5544             4             2             4             2
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/512                 -0.1120         -0.1123            43            38            43            38
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/1400                -0.1154         -0.1159            43            38            43            38
2022-11-30 17:09:04 -07:00
Behdad Esfahbod c6a4b60116 [gsubgpos] Add an unlikely 2022-11-30 15:02:42 -07:00
Behdad Esfahbod a4a4078632
Merge pull request #3893 from googlefonts/preprocess_test
[subset] Fix testing of preprocess
2022-11-24 11:56:58 -07:00
Behdad Esfahbod 0c70bc7f32 [skippy-iter] Fix two logic errors
First, a signed underflow.

Second, a wrong condition.

Both were introduced in 42681bdb55
2022-11-24 11:48:48 -07:00
Behdad Esfahbod 1fa64c0c23 [gsubgpos] Conditionalize skippy on unsafe-to-concat 2022-11-23 21:38:51 -07:00
Behdad Esfahbod 42681bdb55 [gsubgpos] No logic-change minor rewrite 2022-11-23 21:36:43 -07:00
Behdad Esfahbod c15efdec49 [gsubgpos] Comment 2022-11-23 21:14:28 -07:00
Behdad Esfahbod 7ec1c41a55 [gsubgpos] Skippy-iter: Prefer correctness to performance
Prefer unsafe-to-concat correctness, over performance.
2022-11-23 21:12:41 -07:00
Garret Rieger ff3cac0ccd [subset] Fix unecessary trailing 0 bytes left by ContextFormat2 pruning.
Uneeded rules where beind removed from the count by the bytes for them was being left in the font.
2022-11-23 23:50:49 +00:00
Behdad Esfahbod 01f961ac3a [gsubgpos] Minor call hb_iter() instead of ->iter() directly 2022-11-18 15:47:17 -07:00
Behdad Esfahbod bba5765583 [gsubgpos] Remove a few unnecessary namespace invocations 2022-11-18 14:52:17 -07:00
Behdad Esfahbod b4d0d1608d [gsubgpos] Rewrite a couple apply() functions as daggers 2022-11-18 14:47:33 -07:00
Behdad Esfahbod 76c8214eb5 [gsubgpos] Move member around 2022-11-18 12:30:46 -07:00
Behdad Esfahbod 1610008e62 [gsubgpos] Minor remove call to hb_iter 2022-11-16 20:02:36 -07:00
Behdad Esfahbod 19ec01d25c [gsubgpos] Sprinkle const around 2022-11-16 19:14:42 -07:00
Behdad Esfahbod 8b2a211123 [layout] Keep digest updated in the context
Don't recompute digest after every (applied) GSUB lookup.
2022-11-16 16:57:44 -07:00
Behdad Esfahbod 15b6c32599 [layout] Use a buffer digest for GPOS to skip whole lookups 2022-11-16 16:11:36 -07:00
Behdad Esfahbod a053b84cb9 [gsubgpos] Optimize set-digest initialization
Previously we were once collecting set-digest for each subtable,
and another time for each lookup.

Now we compute the one for each lookup simply from the ones for
its subtables.
2022-11-16 14:39:25 -07:00
Qunxin Liu f4813e3b7f [instance] update collect_lookups/prune_features()/closure_features() with variations
Some features will be substituted with variations, so we do not collect
lookups from the original feature tables.
2022-09-29 12:14:43 -06:00
Qunxin Liu 64e2f2fc58 [instance] store active featurevariation record/condition idxes in the plan 2022-09-29 12:14:43 -06:00
Qunxin Liu a3e6dbbb43 [subset] skip the script if it's not included in the final subset 2022-09-06 11:29:34 -06:00
Garret Rieger 8d611a7fd0 [repacker] remove temporary visibility overrides in gsubgpos. 2022-07-26 12:22:17 -06:00