src/hb-ot-font.cc


Log

Author Commit Date CI Message
Behdad Esfahbod 6f5b8d59 2025-04-03T01:52:03 [ot-font] Streamline advance cache management
Behdad Esfahbod da0c459d 2025-04-02T15:16:44 [ot-font] Use helpers to acquire/release varStore cache
Behdad Esfahbod 37989fb4 2025-04-02T15:03:07 [ot-font] Adjust cache creation criteria for v_advances
Behdad Esfahbod ef8c25ad 2025-04-02T03:41:32 [ot-font] Make advance-cache invalidation threadsafe Hopefully.
Behdad Esfahbod 3d0816c7 2025-04-01T21:18:29 [cache] Simplify cache declarations
Behdad Esfahbod 591f00a2 2025-04-01T20:56:40 [cmap] Move cache from face to cmap accelerator No need to use user-data for it. Fixes https://github.com/harfbuzz/harfbuzz/issues/5235
Behdad Esfahbod bed2d3dd 2025-04-01T17:52:57 [cache] Add assertion for cache size Expand cmap cache since free.
Behdad Esfahbod c39ac0e1 2025-03-28T14:12:28 [ot] Make v_origin work for more glyph formats
Behdad Esfahbod 1358e381 2025-03-28T13:15:37 [fontations] Implement last bits of v_origin
Behdad Esfahbod aad5780f 2025-03-28T00:26:51 [font] Move outline emboldening to font layer Such that it works on all font-funcs.
Behdad Esfahbod 83481d65 2025-03-28T00:21:20 [font] Move emboldening advances to the font layer Instead of each font-funcs impl. TODO: Do the same for draw_glyphs.
Behdad Esfahbod dda1d95a 2025-03-27T14:32:13 Revert "[ot-font/trak] Move trak application to ot-font instead of ot-shape" This reverts commits ffae5b040d50d602284ef7426340ff332b811df5 and 17c11ec5238ef7efdcc340a2f578feb668c4252a. Plus manual modifications. See https://github.com/harfbuzz/harfbuzz/issues/5221
Behdad Esfahbod 4807a021 2025-03-12T18:27:27 [atomic] Kill hb_atomic_ptr_t<T> Use hb_atomic_t<T *> instead.
Behdad Esfahbod a0d76c5b 2025-03-12T16:33:13 [atomic] Templatize
Behdad Esfahbod e0c6c980 2025-03-02T13:32:54 [VARC] Implement get_extents() Fixes https://github.com/harfbuzz/harfbuzz/issues/5007
Behdad Esfahbod 2032da01 2025-02-18T20:54:56 [ot-font] Centralize painting an outline glyph
Behdad Esfahbod 922a56f4 2025-02-09T04:50:17 [trak] Fix configs build
Behdad Esfahbod 17c11ec5 2025-02-09T04:46:29 [ft/trak] Apply trak in ft-font-funcs as well Part of https://github.com/harfbuzz/harfbuzz/issues/5049
Behdad Esfahbod ffae5b04 2025-02-09T04:39:32 [ot-font/trak] Move trak application to ot-font instead of ot-shape This is what CoreText does. Fixes https://github.com/harfbuzz/harfbuzz/issues/5049
Behdad Esfahbod 8db2997e 2024-10-10T13:55:11 [coretext] Configure hb_coretext_font_create() with CT font funcs Not sure if this is a good idea...
Behdad Esfahbod bf27f4a3 2024-03-16T14:50:27 [varc] Fix config
Behdad Esfahbod a94a5c63 2024-04-16T17:10:43 [varc] Add get_point_at to glyf/CFF2
Behdad Esfahbod 0d6f77e6 2024-03-15T18:57:07 [varc] Add table
Behdad Esfahbod 1cb47eff 2024-02-06T14:49:31 Rename VariationStore to ItemVariationStore
Behdad Esfahbod 45a17212 2023-07-06T16:06:50 [ot-font] Prefer CFF2 over CFF1
Behdad Esfahbod afae537c 2023-06-29T12:42:44 [cache] Minor remove .init() Use constructor.
Behdad Esfahbod 5d4f3ff6 2023-05-05T07:10:02 [TINY] Fix build
Behdad Esfahbod 7e676cb4 2023-05-05T07:07:00 [config] Add HB_NO_OT_FONT_ADVANCE_CACHE Part of https://github.com/harfbuzz/harfbuzz/issues/4220
Behdad Esfahbod 8831ba7f 2023-05-05T07:03:25 [config] Add HB_NO_OT_FONT_CMAP_CACHE Part of https://github.com/harfbuzz/harfbuzz/issues/4220
Behdad Esfahbod d1c00c04 2023-04-24T13:24:47 [COLR] Respect HB_NO_PAINT Fixes https://github.com/harfbuzz/harfbuzz/issues/4204
Behdad Esfahbod 000a3c5d 2023-04-20T15:53:10 [beyond-64k/subset] Fetch lsb from glyph table if not available The beyond-64k hmtx table doesn't encode LSB. If subsetting brings the glyph under 64k (which currently is the only mode we support), then we need to encode the LSB, which wasn't available. We need to fetch xMin from glyf table and set it as LSB.
Behdad Esfahbod ab191d9d 2023-02-11T09:31:07 [ot-font] Minor division rounding
Behdad Esfahbod be1c14ee 2023-02-07T13:52:53 [embolden] Adjust font_h_extents
Behdad Esfahbod aef002e0 2023-02-07T11:29:49 [embolden] Add in-place option Adds --font-grade to hb-view and hb-shape.
Behdad Esfahbod 2119eab6 2023-02-01T17:37:10 [embolden] Adjust advance values
Behdad Esfahbod b087266e 2023-02-01T17:09:29 [ot-font] Conditionalize emboldening
Behdad Esfahbod 36dcc9a4 2023-02-01T17:06:15 [ot-font] Fix emboldening CFF
Behdad Esfahbod e39104ba 2023-02-01T16:56:56 [font/util] Add emboldening API, --font-bold Needs documentation.
Behdad Esfahbod ae522a13 2023-02-01T16:24:44 [embolden] Rename to hb-outline
Behdad Esfahbod fda2f6f6 2023-02-01T16:16:10 [embolden] Shuffle under hb_outline_t
Behdad Esfahbod 70149885 2023-02-01T14:27:45 [font] Towards implementing emboldening
Behdad Esfahbod 7a4bd97e 2023-01-31T14:59:39 [layout] Build lookup accelerators lazily on-demand Reduces memory consumption for large multi-script fonts drastically.
Matthias Clasen 318aa107 2023-01-29T09:17:17 [ot-font] Use the cmap cache more Use the cmap cache for get_nominal_glyph and get_variation_glyph as well. The first of these is used a lot in pango.
Behdad Esfahbod 5da829ea 2023-01-28T22:18:53 [font] Comments
Behdad Esfahbod 544dd967 2023-01-28T22:06:46 [font] Fix unlikely
Behdad Esfahbod c1d0daf5 2023-01-28T22:05:24 [font] unlikely
Behdad Esfahbod 30ee7a21 2023-01-28T21:48:16 [font] Typo
Behdad Esfahbod f8a744d9 2023-01-28T13:37:43 [ot-font] Add a cmap cache Speeds up Roboto shaping by 7%, for 1kb per face.
Behdad Esfahbod 1b53ed3c 2023-01-28T13:22:52 [cache] Remove empty fini()
Matthias Clasen 4adc748b 2023-01-01T09:46:11 Move Color tables to src/OT/Color/
Matthias Clasen 9be01b6b 2022-12-21T14:04:32 [paint] Pass hb_paint_context_t along Replace the font argument with a hb_paint_context_t that carries the font, the palette index and the foreground color. The hb_font_paint_glyph() api now takes the palette index and the foreground color as extra arguments. Update all callers and regenerate test results.
Matthias Clasen 14b026ff 2022-12-19T13:53:49 [draw] Add hb_font_draw_glyph hb_font_draw_glyph(), hb_font_draw_glyph_func_t and hb_font_funcs_set_draw_glyph_func() are just alternative names for hb_font_get_glyph_shape and friends, to better align with hb_font_paint_glyph.
Matthias Clasen 0f287e75 2022-12-19T13:45:45 [paint] Rename hb_font_get_glyph_paint_func_t The 'get' was just there due to implementation choices. Work around that and call the vfunc what it should be: hb_font_paint_glyph_func_t.
Matthias Clasen 6079173a 2022-12-17T01:04:35 Try paint_glyph for more tables If the COLR table does not paint the glyph, try SVG, CBDT and sbix too, before giving up on color.
Matthias Clasen 9461ab70 2022-12-16T23:46:45 Try paint_glyph for more tables If the COLR table can't paint the glyph, try glyf, cff1 and cff2 too.
Matthias Clasen 6a48ac42 2022-12-14T06:55:01 COLR implementation
Matthias Clasen 7a748ad4 2022-12-10T19:59:03 COLRv1: use ClipBoxes for extents This is a first step; ultimatively, we should compute the extents is ClipBoxes are missing.
Behdad Esfahbod 6dfd4a16 2022-11-16T22:44:22 [ot-font] Remove stale TODO
Khaled Hosny d2966d39 2022-09-22T23:30:50 [ot-font] Try CBDT extents before outline tables Like we do for sbix table. Fixes https://github.com/harfbuzz/harfbuzz/issues/3827
Behdad Esfahbod c02a1a4a 2022-09-10T10:44:16 [ot-font] Remove unused include
Behdad Esfahbod d7adc55e 2022-08-03T13:22:51 [ot-font] Allow 24bit glyphs in advance cache
Behdad Esfahbod ec90d1e1 2022-08-03T13:00:48 [cache] Add a non-threadsafe version Use in hb-ft, since already mutex'ed.
Behdad Esfahbod 86d1e22d 2022-08-03T12:43:28 [atomic-ptr] Rename get
Behdad Esfahbod d3f2287e 2022-08-03T12:37:41 [atomic-int] Rename get/set
Behdad Esfahbod a5d9012e 2022-07-29T19:51:00 Revert "[ot-font] Minor simplification" This reverts commit 28c02b37684b41bf584ed81d910a448bdf9f706a. Old code was used in case of memory allocation failure (as shown by fuzzers...)
Behdad Esfahbod 28c02b37 2022-07-29T15:55:16 [ot-font] Minor simplification
Behdad Esfahbod b0cb9a1a 2022-07-03T15:32:32 Make get_leading_bearing return bool Fixes https://github.com/harfbuzz/harfbuzz/issues/3496 Part of supporting >64k glyphs correctly.
Behdad Esfahbod f46ddeba 2022-07-03T13:12:49 [hmtx/glyf] Rename side-bearing functions for clarity
Behdad Esfahbod ab5ce643 2022-07-03T13:00:22 [VVAR] Rename vorg function for clarity
Behdad Esfahbod b2d60cbd 2022-07-03T12:56:48 [glyf] Rename advance functions for clarity
Behdad Esfahbod 35c00c12 2022-07-03T12:54:17 [hmtx] Rename advance functions for clarity
Behdad Esfahbod b07fa2bb 2022-07-02T13:43:23 [ot-font] Respect VORG even if it has no variations
Behdad Esfahbod aba4a495 2022-06-30T14:13:44 [ot-font] Disable VORG variation code in HB_NO_VAR
Behdad Esfahbod d5921b37 2022-06-30T14:08:29 [tt-font] Apply VVAR.vOrg variation to VORG origin Mostly fixes https://github.com/harfbuzz/harfbuzz/issues/1694
Behdad Esfahbod eee29f73 2022-06-30T14:03:07 [hmtx] Specialize var_table
Behdad Esfahbod a719e678 2022-05-24T17:51:24 [ot-font] Use atomic ops for cache serial number This guarantees the cache is coherent.
Behdad Esfahbod 5248b256 2022-05-24T13:55:17 [ot-font/h-advance] Adjust varStore cache condition This gives best performance for short strings, now that we have a h-advance cache as well. The en-words benchmark in particular, now ot-font is faster than ft. Second to last line is of interest: Before: ----------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations ----------------------------------------------------------------------------------------------------- BM_Shape/en-words.txt/Roboto-Regular.ttf/hb 29.8 ms 29.8 ms 23 BM_Shape/en-words.txt/Roboto-Regular.ttf/ft 30.4 ms 30.4 ms 23 BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/hb 16.3 ms 16.3 ms 43 BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/ft 16.5 ms 16.5 ms 42 BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/var/hb 18.0 ms 18.0 ms 39 BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/var/ft 17.8 ms 17.8 ms 39 After: behdad@Behdads-MacBook-Pro harfbuzz % ninja -Cbuild && build/perf/benchmark-shape --benchmark_filter=en-words ----------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations ----------------------------------------------------------------------------------------------------- BM_Shape/en-words.txt/Roboto-Regular.ttf/hb 30.0 ms 30.0 ms 23 BM_Shape/en-words.txt/Roboto-Regular.ttf/ft 30.3 ms 30.3 ms 23 BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/hb 16.3 ms 16.3 ms 43 BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/ft 16.4 ms 16.4 ms 43 BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/var/hb 17.6 ms 17.6 ms 40 BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/var/ft 17.8 ms 17.8 ms 39
Behdad Esfahbod 12fff976 2022-05-24T13:42:25 [ot-var] Use atomic int for cached-serial
Behdad Esfahbod 0919eaa6 2022-05-24T13:07:24 [ot-font] Remove lock around cache Not needed.
Behdad Esfahbod 3548b602 2022-05-23T19:39:52 [ot-font] Cache h-advances for variable fonts
Behdad Esfahbod 39a07bf3 2022-05-23T19:13:05 [ot-font] Rename cache to varStore_cache
Behdad Esfahbod 970e03ec 2022-05-23T19:02:36 [ot-font] Add a hb_ot_font_t struct
Behdad Esfahbod 3eb7eff4 2022-05-21T15:25:53 Remove varstore cache use if HB_NO_VAR
Behdad Esfahbod 099482a3 2022-05-21T15:20:23 [ot-font] Cache v_advance varstore as well
Behdad Esfahbod 5336ba70 2022-05-20T17:03:18 [HVAR] Cache VarStore region scalars
Behdad Esfahbod 1449498e 2022-03-21T21:40:07 [ot-font] Vertically center glyph in vertical writing fallback Fixes https://github.com/harfbuzz/harfbuzz/issues/537
Behdad Esfahbod bf03d7e9 2022-03-21T21:27:31 [ot-font] Use ascent+descent for fallback vertical advance This matches what FreeType does. Part of fixing https://github.com/harfbuzz/harfbuzz/issues/537
Behdad Esfahbod 6d0e67de 2022-03-21T21:07:11 [ot-font] Only use vmtx side-bearing if table exists Part of fixing https://github.com/harfbuzz/harfbuzz/issues/537
Behdad Esfahbod 59067db9 2022-02-07T17:55:01 [font/draw] Slant drawings Need to update hb_font_set_synthetic_slant() docs now that we do this.
Behdad Esfahbod 370bec93 2022-02-04T18:40:44 [draw] Rename internal draw_session_t to hb_draw_session_t
Behdad Esfahbod c681331c 2022-02-03T14:36:12 [draw] Rename internal draw_helper_t to draw_session_t
Behdad Esfahbod 8b4f4290 2022-02-03T01:14:47 [draw] Virtualize hb_font_draw_glyph() into hb_font_get_glyph_shape() To be implemented in hb-ft.
Behdad Esfahbod 53eebc7c 2021-12-08T08:32:41 [CONFIG] Add HB_NO_VERTICAL
Behdad Esfahbod 9bc5d290 2021-12-08T08:16:17 [TINY] Don't disable VORG table in any config profile Is needed for vertical layout of CFF fonts. Fixes https://github.com/harfbuzz/harfbuzz/discussions/3294#discussioncomment-1770313
Behdad Esfahbod ed116320 2021-09-14T07:09:54 Call atexit() via hb_atexit() Part of https://github.com/harfbuzz/harfbuzz/issues/3197
Nathan Willis eb10ef46 2019-04-22T19:22:24 [Docs] Add GTK-Doc comments for hb-ot-font and hb-ot-shape.
blueshade7 82545c5e 2019-11-26T10:24:32 more coding style fixes
blueshade7 2e7c1239 2019-11-26T09:57:53 minor: coding style
blueshade7 ff87465b 2019-11-19T16:18:33 add get_glyph_from_name & test. use hb_string_array
blueshade7 7b49042e 2019-11-16T18:20:16 add cff1::get_glyph_name