src/hb-ot-layout-gsubgpos.hh


Log

Author Commit Date CI Message
Behdad Esfahbod 4807a021 2025-03-12T18:27:27 [atomic] Kill hb_atomic_ptr_t<T> Use hb_atomic_t<T *> instead.
Behdad Esfahbod b8327fe6 2025-02-06T20:01:12 Fix compiler errors
Behdad Esfahbod 6091abcc 2025-02-06T02:40:24 [buffer] Avoid a copy in collect_codepoints()
Behdad Esfahbod e5e3bc40 2025-02-06T02:36:26 [buffer] Merge two functions into a template
Behdad Esfahbod c7378294 2025-02-06T01:42:25 [OT] Remove likely() from coverage check Not that it matters, but because of the set-digest, this path is not very likely() anymore.
Behdad Esfahbod 3577992a 2025-02-06T01:30:59 [gsubgpos] Simplify a destruction
Behdad Esfahbod 0a678a92 2025-02-06T01:02:44 Fix leak
Behdad Esfahbod 4e75dfae 2025-02-05T23:57:37 Hide unused member
Behdad Esfahbod 99043f20 2025-02-05T20:11:27 [gsubgpos] Tweak cache again
Behdad Esfahbod e535c683 2025-02-05T19:41:03 [Context] Simplify cache costing
Behdad Esfahbod 726af2e4 2025-02-05T18:10:40 [PairPos] Use a class cache 10% speedup on Roboto-Regular. 5% on SF Pro.
Behdad Esfahbod acd122d0 2025-02-05T17:38:39 [gsubgpos] Prepare for per-lookup allocated caches
Caleb Maclennan 10cf348a 2024-11-11T10:32:01 [gsubgpos] Guard integer arithmetic against wrapping below zero When either casting a signed integer to an unsigned one or subtracting a value from an unsigned one, add assertions to verify we will not end up below expected bounds.
Behdad Esfahbod 7a890c2e 2024-09-22T13:19:02 Add hb_barrier() to switches of unions https://github.com/harfbuzz/harfbuzz/pull/4864#issuecomment-2366923736
Behdad Esfahbod 7aace3d3 2024-09-23T07:47:24 Ignore CGJ and Mongolian Variation Selectors during GPOS Fixes https://github.com/harfbuzz/harfbuzz/issues/4869
Behdad Esfahbod e4e9f6a1 2024-09-22T11:17:48 [gsubgpos] Add a barrier Fixes https://github.com/harfbuzz/harfbuzz/issues/4852
Behdad Esfahbod 788b469a 2024-07-25T14:50:01 [ChainContext] Fix fast-path deviation from slow path See comments. The input skippy was hitting the U+200D and NOT seeing it skippable, whereas the context skippy would had. Fixes https://github.com/harfbuzz/harfbuzz/issues/4813
Behdad Esfahbod 0037ee28 2024-05-24T08:10:15 Merge pull request #4578 from harfbuzz/varc-table `VARC` table
Behdad Esfahbod e2ab6c7b 2024-05-12T15:25:13 [kern/kerx] Add accelerator and set-digest filtering
Behdad Esfahbod ba1f194a 2024-05-02T12:18:11 [gsubgpos] Reduce stack use in recursion
Behdad Esfahbod ac411f26 2024-04-23T13:26:53 [Condition] Finish evaluation of ConditionValue https://github.com/adobe-type-tools/opentype-spec-drafts/blob/main/condvalue_spec.md
Behdad Esfahbod f1ac867d 2024-03-14T13:30:21 [buffer] Add API for random state Fixes https://github.com/harfbuzz/harfbuzz/issues/4620 New API: +hb_buffer_set_random_state() +hb_buffer_get_random_state()
Behdad Esfahbod 1cb47eff 2024-02-06T14:49:31 Rename VariationStore to ItemVariationStore
Behdad Esfahbod 7ee7e2e3 2023-11-04T15:02:28 [sanitize] Add remaining hb_barrier() annotations I'm sure I've forgot some. But this is a good start.
Qunxin Liu aca55dbe 2023-11-03T10:51:37 [instancer] fix feature variations collect lookups We already know which record to keep, so just collect lookups and no need to check the substitutes_map
Qunxin Liu 091e538d 2023-10-26T12:52:08 [instancer] support partial instancing for FeatureVariations
Behdad Esfahbod dcd3afca 2023-08-01T20:09:34 [skippy-iter] Remove unused num_items
Behdad Esfahbod 39048099 2023-08-01T19:41:12 [skippy-iter] Remove early stop The optimization in (Chain)RuleSet matching relies on matching one, even if num_items is out of range. Fixes https://github.com/harfbuzz/harfbuzz/issues/4358
Behdad Esfahbod 2feac50b 2023-07-31T19:53:06 Revert "[gsubgpos] Keep another digest in the applicable_t" This reverts commit fd79c7cecdf68fe4626943f29bd5edf1e603d2b2.
Behdad Esfahbod fd79c7ce 2023-07-31T19:52:15 [gsubgpos] Keep another digest in the applicable_t The digest for all the remaining subtables combined. The idea is to get out of the subtable look as soon as no more can be applied. Doesn't seem to speed up anything I tested. Going to revert.
Behdad Esfahbod e3fd69c8 2023-07-31T19:07:42 [layout] Inline another function Code is smaller too.
Behdad Esfahbod 60db1427 2023-07-24T20:49:32 [layout] Remove unused "max-size" cruft
Behdad Esfahbod c91899be 2023-07-21T11:43:47 [gdef] Use set-digest for mark-filterint-sets Speeds up Noto Duployan-Regular.otf by 45% percent!
Behdad Esfahbod e8948a4e 2023-07-20T22:12:53 [gsubgpos] Fix optimization Fixes https://github.com/harfbuzz/harfbuzz/issues/4336
Behdad Esfahbod e8de5cb0 2023-07-20T11:31:13 [gsubgpos] Use a couple variables
Behdad Esfahbod 0ccd61a3 2023-07-19T16:42:30 [gsubgpos] Micro-optimize
Behdad Esfahbod b01c1650 2023-07-19T16:35:10 [gsubgpos] Minor error handling
Behdad Esfahbod ee5f200b 2023-07-19T12:26:50 [gsubgpos] Remove un unnecessary variable
Behdad Esfahbod 42c6a3a1 2023-07-19T12:07:19 [gsubgpos] Remove unnecessary condition Second is always set in this branch.
Behdad Esfahbod b5de54e1 2023-07-19T11:19:06 [gsubgpos] Also match second component in (Chain)RuleSet::apply() Another 40% speedup in shaping Gulzar-Regular.
Behdad Esfahbod 7a2f9dcf 2023-07-18T04:36:15 [matcher] Move initializers inline
Behdad Esfahbod d92a7a58 2023-07-17T11:27:38 [gsubgpos] Inline a couple functions Produces smaller code.
Behdad Esfahbod 4ea3737d 2023-07-17T09:50:28 [gsubgpos] Add fast-path for end-of-string in (Chain)RuleSet::apply()
Behdad Esfahbod 49730531 2023-07-16T13:09:49 Config
Behdad Esfahbod 645fabd1 2023-07-16T11:36:59 [gsubgpos] Vastly speed up ChainRuleSet / RuleSet matching Match the first component in a fast loop. Idea replicated from LigatureSet. Speeds up Gulzar shaping by 22%! 37% in NotoNastaliqUrdu!
Behdad Esfahbod 77080f86 2023-07-16T11:26:32 .
Behdad Esfahbod 5c8f3b7f 2023-07-16T09:39:18 [gsubgpos] Conditionally cache backtrack again
Behdad Esfahbod 52237eb1 2023-07-16T09:07:25 [ChainContext] More caching
Behdad Esfahbod 62e10c9f 2023-07-16T08:43:18 Revert "[gsubgpos] Allocate iterators further up" This reverts commit b9f364b8fcacf8ab32d0272190d8509f214e55f2.
Behdad Esfahbod b9f364b8 2023-07-16T08:42:36 [gsubgpos] Allocate iterators further up To avoid calling set_match_func repeatedly. Doesn't show speedup. Going to revert.
Behdad Esfahbod c2f454c7 2023-07-16T08:23:59 [gsubgpos] Fix residual from 5af80f349c4e040bfa853ee3f561ac16538b5988
Behdad Esfahbod 5af80f34 2023-07-16T07:27:28 [ChainContext] Cache two class values 7% speedup shaping Gulzar.
Behdad Esfahbod 8cde4fa9 2023-07-16T06:01:06 [gsubgpos] Inline a couple methods
Behdad Esfahbod d00b8873 2023-07-14T11:26:51 Revert "[subset/closure] Batch recursions in scheduled stages" This reverts commit f2aaeeb3016e10bf91c251296391a381d5fc6385.
Behdad Esfahbod f2aaeeb3 2023-07-14T11:17:37 [subset/closure] Batch recursions in scheduled stages Going to revert. Doesn't pass tests and savings are minor.
Behdad Esfahbod d84c5f29 2023-07-08T15:22:51 Revert "[gsubgpos] Make (Chain)Context funcs templatized" This reverts commit 03ac08d267eb7ad2f1ac039115fc0030ea475fae.
Behdad Esfahbod e73223b9 2023-07-08T15:22:18 [gsubgpos] Make (Chain)Context funcs templatized Unfortunately they still won't be inlined because the matcher_t needs function pointers. So, no speed up. Going to revert.
Behdad Esfahbod 1c8d54de 2023-07-08T14:28:07 [shape] Another always-inline
Behdad Esfahbod df45067f 2023-07-08T14:22:59 [shape] More always-inline
Behdad Esfahbod c3a28be5 2023-07-08T14:20:45 [shape] One more always-inline
Behdad Esfahbod 9fea19eb 2023-07-08T13:56:24 [shape] Another always-inline
Behdad Esfahbod 5b45c56c 2023-07-08T13:47:41 [shape] Always-inline more Another 10% speedup in BM_Shape Gulzar-Regular.
Behdad Esfahbod bb9692e8 2023-07-08T13:45:48 [shape] Always-inline match_input 10% speedup in BM_Shape Gulzar-Regular.
Behdad Esfahbod 6c451054 2023-07-08T12:55:34 [sanitize] Sprinkle a few unlikely's
Behdad Esfahbod 4ecc62c2 2023-07-08T12:53:23 [sanitize] Simplify ChainRule::sanitize again check_struct does the same now.
Behdad Esfahbod fb02f4a8 2023-07-08T12:29:18 [sanitize] Micro-optimize ChainRule::sanitize
Behdad Esfahbod 403bc7ca 2023-07-07T20:17:32 [sanitize] Simplify Rule::sanitize()
Behdad Esfahbod 385896ff 2023-07-07T19:56:19 [sanitize] Speed up ChainRule::sanitize() 10% speedup in sanitizing Gulzar-Regular.
Behdad Esfahbod 2006d321 2023-07-07T17:07:11 [sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size Unfortunately this doesn't speed up NotoNastaliq or Gulzar as I was hoping for. Their GSUB tables are not large enough for this to kick in...
Behdad Esfahbod 7a85663c 2023-07-07T19:21:18 Revert "[sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size" This reverts commit 10f8556c73f3cf231c6b5a900a6a1903f9516f90. This was, unfortunately, wrong :(.
Behdad Esfahbod f2a3680f 2023-07-07T19:21:03 Revert "[gsubgpos] Limit (Chain)ContextFormat3 for consistency" This reverts commit 90b48917dadbef51bc5e90904d0f81e81199b9e2.
Behdad Esfahbod 90b48917 2023-07-07T18:50:01 [gsubgpos] Limit (Chain)ContextFormat3 for consistency
Behdad Esfahbod 10f8556c 2023-07-07T17:07:11 [sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size
Behdad Esfahbod 68b78914 2023-07-07T17:07:11 [sanitize] Add "fastpath" for ArrayOfOffset16To<> objects with max size Unfortunately this doesn't speed up NotoNastaliq or Gulzar as I was hoping for. Their GSUB tables are not large enough for this to kick in...
Behdad Esfahbod 90752cd5 2023-07-07T15:47:28 [type] Add HeadlessArray16Of
Behdad Esfahbod 2d6091fc 2023-06-30T11:48:56 [GPOS] Make AnchorMatrix sanitize lazy again Was reverted in the previous commit, because it was incomplete.
Behdad Esfahbod 690af7aa 2023-06-30T10:36:01 [GPOS] Sanitize Device tables lazily This speeds up face loading for variable fonts by 80%! Comparing before to after Benchmark Time CPU Time Old Time New CPU Old CPU New --------------------------------------------------------------------------------------------------------------------------------------------------------------- BM_Font/load_face_and_shape/Roboto-Regular.ttf/hb -0.0368 -0.0366 20 20 20 19 BM_Font/load_face_and_shape/RobotoFlex-Variable.ttf/hb -0.7149 -0.7162 77 22 77 22 BM_Font/load_face_and_shape/RobotoFlex-Variable.ttf/var/hb -0.7241 -0.7255 80 22 79 22 BM_Font/load_face_and_shape/SourceSansPro-Regular.otf/hb -0.1441 -0.1445 28 24 28 24 BM_Font/load_face_and_shape/AdobeVFPrototype.otf/hb -0.7893 -0.7910 66 14 66 14 BM_Font/load_face_and_shape/AdobeVFPrototype.otf/var/hb -0.7865 -0.7882 67 14 66 14 BM_Font/load_face_and_shape/SourceSerifVariable-Roman.ttf/hb -0.8895 -0.8900 227 25 226 25 BM_Font/load_face_and_shape/SourceSerifVariable-Roman.ttf/var/hb -0.8895 -0.8900 226 25 225 25 BM_Font/load_face_and_shape/Comfortaa-Regular-new.ttf/hb -0.5512 -0.5531 42 19 42 19 BM_Font/load_face_and_shape/NotoNastaliqUrdu-Regular.ttf/hb -0.1511 -0.1510 227 192 225 191 BM_Font/load_face_and_shape/NotoSerifMyanmar-Regular.otf/hb -0.1494 -0.1498 41 35 40 34 OVERALL_GEOMEAN -0.6443 -0.6456 0 0 0 0
Behdad Esfahbod 9df07c3c 2023-06-08T11:46:06 [gsubgpos] Prevent a leak in closure If the push wasn't successful we were constructing an hb_set_t on the Crap data... At least that's my reading of the code.
Behdad Esfahbod 82741304 2023-06-04T09:41:41 [subset] start_embed never returns nullptr Remove checks.
Behdad Esfahbod 31949636 2023-05-04T16:29:48 Revert "[layout] Cache subtable coverages in hb_map_t" This reverts commit 7a715d74e06720c17d28ba7b4c3da0b583f8d1d3.
Behdad Esfahbod 7a715d74 2023-05-04T16:28:11 [layout] Cache subtable coverages in hb_map_t Proof-of-concept. Going to revert. Memory consumption is more than I like. It does speed up Roboto shaping another 15% though. Perhaps if we could add logic to choose which subtables to cache, this might be a useful approach.
Behdad Esfahbod 975980d3 2023-05-04T15:56:06 [gsubgpos] Add apply_cached() as separate method In prep for some other work.
Behdad Esfahbod 3f2401e2 2023-05-03T16:56:52 [layout] Don't init iters successively multiple times
Behdad Esfahbod 959f1634 2023-05-03T16:27:41 [gsubgpos] Minor reduce variable scope
Behdad Esfahbod fb795dc3 2023-05-03T15:17:20 [GPOS] Optimize iterator reset Speeds up Gulzar shaping 5%.
Behdad Esfahbod 8a8fc37c 2023-05-03T14:57:00 [GDEF] Use a cache for glyph classes Shows 5% speedup for Roboto shaping.
Behdad Esfahbod 49ac5e11 2023-05-02T12:12:26 [match_input] Micro-optimize
Behdad Esfahbod 63afb4f2 2023-04-26T10:29:25 [syllabic] Better fix for previous issue With previous fix the GPOS application was still reading the syllable() member, which was already freed. This fix is more correct.
Qunxin Liu 125450d2 2023-03-13T15:43:29 [subset] collect name_ids for FeratureParams
Behdad Esfahbod 8708b9e0 2023-02-06T14:51:25 [GPOS] Avoid O(n^2) behavior in mark-attachment Better implementation; avoids arbitrary limit on look-back.
Behdad Esfahbod 661050b4 2023-02-06T12:38:17 Revert "[layout] Limit how far we skip when looking back" This reverts commit 85be877925ddbf34f74a1229f3ca1716bb6170dc.
Behdad Esfahbod b29fbd16 2023-02-06T13:08:52 [gsubgpos] Refactor skippy_iter.match()
Behdad Esfahbod 85be8779 2023-02-01T20:00:43 [layout] Limit how far we skip when looking back See comments.
Behdad Esfahbod d18fd3f7 2023-01-31T16:28:49 [layout] Comment
Behdad Esfahbod 7a4bd97e 2023-01-31T14:59:39 [layout] Build lookup accelerators lazily on-demand Reduces memory consumption for large multi-script fonts drastically.
Behdad Esfahbod 83353f13 2023-01-31T14:32:14 [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.
Behdad Esfahbod 49d75ef3 2023-01-27T15:37:11 [gsubgpos] Fix bug in cached ChainContextFormat2 application
Behdad Esfahbod d2279a20 2023-01-27T12:32:55 [gsubgpos] Avoid a copy into the vector
Behdad Esfahbod 8d29be39 2023-01-26T11:41:58 [gsubgpos] Minor drop an unnecessary hb_iter
Behdad Esfahbod be8a87c4 2023-01-21T15:00:41 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.