src/OT


Log

Author Commit Date CI Message
Behdad Esfahbod c124252d 2025-05-31T16:32:58 [algs] Add support for little-endian int types As well as 64bit-int, and float types. Add Align type.
Behdad Esfahbod 47089fe7 2025-05-28T17:10:22 Big misc changes - Make geometry types into templates taking float or double. - Changes to paint() transform elimination. - Add font->has_nonzero_coords and use it across. - Extensions to avar processing for otherwise invalid mappings.
Behdad Esfahbod e1dcc454 2025-05-21T16:00:08 [gvar] Use cached scratch in get_extents Makes it alloc-free. 15% faster on benchmark-font glyph_extents RobotoFlex var benchmark.
Behdad Esfahbod c6097698 2025-05-16T01:10:43 [ot-font/draw] Use a gvar shared-tuple scalar cache for calculate_scalar Massive saving on massively variable fonts. Over 30% on a tested font.
Behdad Esfahbod f50490d6 2025-05-15T18:28:44 Add hb_scalar_cache_t
Behdad Esfahbod 89e28a23 2025-05-10T16:30:35 [skippy-iter] Use auto for type deduction
Behdad Esfahbod 59334682 2025-04-23T20:56:32 [shape] Only apply slant to shaping results if horizontal
Behdad Esfahbod e71a88d3 2025-04-23T19:17:31 [paint] Fix crash
Behdad Esfahbod 6688a03c 2025-04-23T19:06:52 [sbix/CBDT] Fix memory leaks in error case
Behdad Esfahbod 17238eae 2025-04-23T18:15:56 [ot/ft/fontations] Port to new _or_fail of draw/paint APIs
Behdad Esfahbod a23021e1 2025-04-23T00:43:56 [COLRv1] Simplify paint_glyph() Pass a non-synthetic font to the client, so they don't have to worry about it. The only issue left, is that now when paint_glyph() paints an outline glyph (not color glyph), it would be double-slanted. I'm leaning towards removing painting of outline glyphs from the paint API and change the paint API to return a boolean.
Behdad Esfahbod 01e9c77e 2025-04-22T21:57:02 [COLR] Fix clip-box Was slanting it. Was wrong with new code.
Behdad Esfahbod a69713b5 2025-04-22T21:01:04 [color] Move slanting to font layer COLRv1 is still being double-slanted. Investigating.
Behdad Esfahbod 05362548 2025-04-20T05:06:54 Merge pull request #5294 from harfbuzz/paint-bounds [COLRv1] `paint-bounds`
Behdad Esfahbod 27b2e16a 2025-04-20T04:34:40 [atomic] Make cmpexch() non-const Was a mistake. Make the affected members mutable instead.
Behdad Esfahbod 78822b63 2025-04-20T04:23:35 Revert "[COLRv1] Move paint boundedness check to font layer" This reverts commit c9a26fbf47f01fdd55df1a0ccc81111cb07bf108.
Behdad Esfahbod c9a26fbf 2025-04-20T04:22:32 [COLRv1] Move paint boundedness check to font layer This way it will apply to fontations and future implementations as well. But this slows down things apparently, specially if the font does use clipboxes. So I'm going to revert.
Behdad Esfahbod 8aa88aa4 2025-04-20T04:08:41 [COLRv1:ot/ft] Use paint-bounded instead of paint-extents Faster. Note that this also means that if there is no clip-box, we don't compute the bounds and emit an initial clip anymore. That was totally unnecessary and against the COLRv1 rendering algorithm. This makes painting of COLRv1 fonts without clipboxes *much* faster, as previously we were computing bounds using all subglyph outlines. Not anymore. Before: BM_Font/paint_glyph/Nupuram-Color.colrv1.ttf/ot 1.78 ms After: BM_Font/paint_glyph/Nupuram-Color.colrv1.ttf/ot 0.155 ms
jfkthame 2602f729 2025-04-17T15:02:59 Avoid unannotated-fallthrough warning in COLR.hh
Behdad Esfahbod 9cae040b 2025-04-03T22:18:14 [ItemVariationStore] Make cache atomic floats Doesn't work with intrinsic atomic implementations. Disabled that. Going through the C++11 atomics path now. Will fix in next commit.
Behdad Esfahbod 7f5fafec 2025-04-01T21:35:28 [GDEF] Simplify cache declaration
Qunxin Liu 5ebe36e1 2025-03-27T13:09:18 [subset] bug fix for CaretValueFormat3 Don't return false in case of a Hinting Device table
Qunxin Liu 192d264a 2025-03-25T13:32:01 [subset] remove divisions when computing the cost of binary search
Behdad Esfahbod 14e5a046 2025-03-16T00:36:11 [font] Move synthetic glyph extents into font layer So it applies to all font-funcs.
Behdad Esfahbod 000a0ad7 2025-03-15T14:37:44 [paint] Add push_font_transform() / push_inverse_font_transform() Fixes https://github.com/harfbuzz/harfbuzz/issues/5146
Behdad Esfahbod 4807a021 2025-03-12T18:27:27 [atomic] Kill hb_atomic_ptr_t<T> Use hb_atomic_t<T *> instead.
Behdad Esfahbod 4e5358a2 2025-03-07T15:18:28 [COLRv1] Fix comments Fixes https://github.com/harfbuzz/harfbuzz/issues/5116
Behdad Esfahbod 575e70b0 2025-03-07T12:51:44 [COLR] Use palette 0 if palette index out of range Fixes https://github.com/harfbuzz/harfbuzz/issues/5112
Behdad Esfahbod 6506bd7e 2025-03-06T20:00:54 Merge pull request #4498 from harfbuzz/PaintColrLayers [COLRv1] Optimize PaintColrLayers instead of PaintComposite
Behdad Esfahbod 50fe45f4 2025-03-03T16:31:41 [COLR] Fix memory leak
Behdad Esfahbod 9c6b6998 2025-03-03T11:46:22 [VARC] Fix sign of returned extents
Behdad Esfahbod e9134c8c 2025-03-03T02:04:34 [COLR] Reduce malloc pressure By caching paint-extents.
Behdad Esfahbod 9efd17e2 2025-03-03T01:44:01 [COLR] Switch to using (existing) accelerator
Behdad Esfahbod 17ddc844 2025-03-03T01:27:32 [VARC] Fix scratch caching
Behdad Esfahbod a62058ee 2025-03-03T01:19:52 [VARC] Separate varc scratch from glyf scratch
Behdad Esfahbod 3199d1c1 2025-03-02T18:35:46 [VARC] Use a context object to pass arguments around
Behdad Esfahbod e0c6c980 2025-03-02T13:32:54 [VARC] Implement get_extents() Fixes https://github.com/harfbuzz/harfbuzz/issues/5007
Behdad Esfahbod 7e3c9658 2025-03-01T15:08:41 [VARC] Reuse parent MultiVarStore cache if coords didn't change Minor optimization; applicable to the test hangul font mostly.
Behdad Esfahbod 64dbeaf0 2025-02-28T00:54:39 [glyf] Mover decycler to the scratch pad
Behdad Esfahbod 00541f19 2025-02-26T16:22:48 Merge pull request #4970 from harfbuzz/GVAR Add `GVAR` table
Behdad Esfahbod a0543453 2025-02-26T15:36:03 [CBDT] Change has_data() to be more accurate get_length() was returning the Null table length if table was not present.
Behdad Esfahbod 7504c67f 2025-02-26T15:24:40 [CBDT] Return immediately if no data
Behdad Esfahbod 17a83b74 2025-02-26T14:40:02 [COLRv1] Optimize PaintColrLayers instead of PaintComposite See https://github.com/googlefonts/colr-gradients-spec/issues/369#issuecomment-1816913943 and onwards.
Behdad Esfahbod 44b7ba51 2025-02-26T13:47:45 [GVAR] Hide behind HB_NO_BEYOND_64K
Behdad Esfahbod 13900ce4 2025-02-26T13:41:52 [GVAR] Hook up to face and glyf table
Behdad Esfahbod 6a7b4dca 2025-02-26T13:25:50 [VARC] Reduce stack usage on 32bit systems
Behdad Esfahbod 84ffb7e4 2025-02-26T12:51:04 [SimpleGlyph] Minor use an intermediate variable
Behdad Esfahbod 54db2b2e 2025-02-26T12:48:55 [SimpleGlyph] Remove a conditional from hot path 5% speedup in Roboto-Regular draw benchmark
Behdad Esfahbod bb4d37b0 2025-02-26T12:17:27 [VARC/coord-setter] Reduce stack allocation on 32bit systems
Behdad Esfahbod 51d3489c 2025-02-26T12:09:31 [Composite] Fix memory-free rendering
Behdad Esfahbod 59e6a1c4 2025-02-26T11:16:04 [glyf/Composite] Malloc-free
Behdad Esfahbod 3c4cb472 2025-02-26T10:48:36 [VARC] Fix uninitialized value Fixes https://oss-fuzz.com/testcase-detail/6089638800588800
Behdad Esfahbod fcbf14a0 2025-02-25T20:16:18 [CompositeGlyph] Adjust pre-allocation
Behdad Esfahbod 6ca8852e 2025-02-25T19:57:43 [glyf] Return earlier if table is empty
Behdad Esfahbod 7614320a 2025-02-25T16:59:37 [glyf] Reduce malloc pressure Benchmark 15% faster for draw.
Behdad Esfahbod 882d3288 2025-02-25T16:34:55 [glyf] Port to decycler for composite glyphs 5% speed up drawing Roboto-Regular.ttf.
Behdad Esfahbod ffee85d6 2025-02-25T16:20:42 [VARC] Minor simplify pointer math
Behdad Esfahbod 7222c1e5 2025-02-25T15:13:20 [path-builder] Add a constexpr
Behdad Esfahbod e450552d 2025-02-25T14:54:37 [coord-setter] Fix memory access in case of malloc failure Fixes https://oss-fuzz.com/testcase-detail/5383702943432704
Behdad Esfahbod f71faf5f 2025-02-25T11:35:21 [VARC] Fix buffer scratch borrowing
Behdad Esfahbod e76b689f 2025-02-25T11:23:48 [VARC] Fix resource leak
Behdad Esfahbod 47124e63 2025-02-24T23:25:02 [VARC] Avoid creating cache if there's no VARC table
Behdad Esfahbod d5d199fb 2025-02-24T23:20:12 [VARC] Reduce malloc pressure By caching one hb_glyf_scratch_t on the VARC accelerator.
Behdad Esfahbod 2c5ab14a 2025-02-24T22:50:42 [coord-setter] Increase static array size
Behdad Esfahbod 97a5c52a 2025-02-24T20:53:19 [VARC/MultiVarStore] Reduce malloc pressure more
Behdad Esfahbod 6938ee03 2025-02-24T20:40:26 [VARC] More nuanced caching
Behdad Esfahbod 081fcbdf 2025-02-24T20:15:24 [VARC] Minor move variable closer to use
Behdad Esfahbod 0a1b26b8 2025-02-24T20:07:59 [coord-setter] Reduce malloc pressure ~15% speedup benchmark-font draw of varc-hanzi.ttf
Behdad Esfahbod 76c3beaf 2025-02-24T19:50:51 [VARC] Reduce malloc overhead
Behdad Esfahbod 2032da01 2025-02-18T20:54:56 [ot-font] Centralize painting an outline glyph
Behdad Esfahbod 01f02f55 2025-02-18T20:28:48 [COLR] Optimize NoVariation codepath
Behdad Esfahbod 4c263ecd 2025-02-18T20:08:19 Merge pull request #5074 from harfbuzz/tortoise-hare [decycler] Implement an efficient graph cycle detector
Behdad Esfahbod f26d9514 2025-02-18T20:07:25 [COLR] Fix HB_LEAN build
Behdad Esfahbod 0667ceae 2025-02-16T10:37:21 [VARC] Reduce stack use
Behdad Esfahbod 4335e49a 2025-02-16T10:33:49 [VARC] Port to hb-decycler-t 5% faster on varc-hanzi test case.
Behdad Esfahbod 0aa400b1 2025-02-15T23:19:44 [decycler] Implement an efficient graph cycle detector This is an algorithm I came up with, based on the Floyd's Tortoise-Hare constant-memory linear-time linked-list cycle-detection algorithm. https://en.wikipedia.org/wiki/Cycle_detection#Floyd's_tortoise_and_hare It is linear-time and malloc-free. It *eventually* detects cycles, not immediately. The main different with Floyd's algorithm is that this algorithm detects cycles when one is traversing down a graph, not just a linked list. Our existing cycle-detection algorithms use a set-of-integers, either hb_set_t, or more efficient in this case, hb_map_t. Those include at least one malloc, and as such show up on profiles. Port hb-ot-font COLRv1 to use the decycler instead of previous hb_map_t usage for cycle detection. benchmark-font paint_glyph on NotoColorEmoji-Regular.ttf: Before: 8ms; After: 5.5ms. No cycle detection: 5.5ms. FT COLRv1 API is so slow (174ms) it's not worth porting to this. Other graphs (VARC, etc) to be ported. Test and documentation to be added.
Behdad Esfahbod ed76c855 2025-02-18T20:01:36 [COLR] Optimize palette access
Behdad Esfahbod 016e78b6 2025-02-18T19:49:48 [COLR] Micro-optimize
Behdad Esfahbod d2a88fbd 2025-02-12T21:48:22 [vector] Add alloc_exact()
Behdad Esfahbod 4b54ee11 2025-02-09T12:38:58 [glyf] Change drawing algorithm to match FreeType / CoreText
Behdad Esfahbod f68193a0 2025-02-09T11:43:07 [glyf] Use direct access to points array Not necessary faster. Prep'ing for next change.
Behdad Esfahbod b8327fe6 2025-02-06T20:01:12 Fix compiler errors
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 cad264b2 2025-02-06T00:56:16 Indent
Behdad Esfahbod 69057e6e 2025-02-05T19:50:38 [Ligature] Cache coverage the same way as PairPos1 Another 7% down on Roboto-Regular.
Behdad Esfahbod 7a746c32 2025-02-05T19:38:25 [Coverage] Fix cache cost reporting
Behdad Esfahbod 5be62a9f 2025-02-05T19:30:01 [PairPosFormat1] Use a coverage cache as well Speeds up Arial shaping by 3%.
Behdad Esfahbod f22943a2 2025-02-05T18:51:11 [PairPos] Cache coverage as well Another 3% down in Roboto-Regular.
Behdad Esfahbod 726af2e4 2025-02-05T18:10:40 [PairPos] Use a class cache 10% speedup on Roboto-Regular. 5% on SF Pro.
Behdad Esfahbod 4df11621 2025-01-24T05:00:05 [VARC] Fix variable binding Ouch.
Behdad Esfahbod 2fa9ccee 2025-01-23T23:13:49 [VARC] Simplify
Behdad Esfahbod 2d2418eb 2025-01-23T23:13:11 [VARC] Avoid float div-by-zero
Behdad Esfahbod fe9398e9 2025-01-23T22:59:12 [VARC] Chain transforms Previous code was actually wrong even, for non-uniform x/y font scale. Fixes https://github.com/harfbuzz/harfbuzz/issues/5017
Behdad Esfahbod de7f97b7 2024-11-15T15:14:37 [COLR] Add comment
Khaled Hosny 6a25df24 2024-10-09T14:09:22 [COLR] Add and use get_clip_list ()
Khaled Hosny 5462978c 2024-10-09T13:43:13 [COLR] Lets see if this makes CIFUZZ any happier
Behdad Esfahbod 008505e1 2024-10-08T09:27:09 [COLR] Pepper some hb_barrier()'s around The version is a minor version (because uint16), as such version > 1 should be considered as supporting version 1 data.
Khaled Hosny cec95a2d 2024-10-07T21:06:56 Try to fix heap-buffer-overflow
Khaled Hosny 4d1f6e04 2024-10-06T18:25:24 [COLR] Enable COLRv0 support in get_extents() paint_glyph() supports COLRv0 but this code is never reached because of the early return if version is not 1. This early return seems to be from before COLRv0 extents were supported.
Behdad Esfahbod 48774052 2024-09-22T13:00:09 [GDEF] Sprinkle some hb_barrier()s