src/hb-font.hh

Branch


Log

Author Commit Date CI Message
Behdad Esfahbod 166e7024 2025-07-20T13:57:33 [font] Fix glyph_v_origin copy/pasta Ouch!
Behdad Esfahbod 62546424 2025-07-19T14:44:00 [font] Speed up non-synthetic v-origins
Behdad Esfahbod 4fd6345a 2025-07-19T14:42:40 [ot-font] Clean up cache invalidation Also, cache is_synthetic on font.
Behdad Esfahbod faa4472d 2025-07-19T03:12:19 [ot-shape] Use batch origin-changing callbacks Backends don't implement it yet.
Behdad Esfahbod 7d3f8ced 2025-07-19T02:53:03 [font] Minor refactor
Behdad Esfahbod 1835c088 2025-07-19T02:25:43 [font] Add get_glyph_[hv]_origins callbacks (plural) Unused so far, and unimplemented in backends.
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 b3e6bd20 2025-05-06T10:37:40 Merge branch 'main' into HVF
Behdad Esfahbod 1c07f48b 2025-05-06T09:46:39 Fix build with HB_NO_DRAW and HB_NO_PAINT Fixes https://github.com/harfbuzz/harfbuzz/issues/5313 Fixes https://github.com/harfbuzz/harfbuzz/issues/5316
Behdad Esfahbod d92106df 2025-04-24T21:42:20 Merge branch 'main' into HVF
Behdad Esfahbod ff0b1f54 2025-04-23T19:28:54 [font] Comment
Behdad Esfahbod 29d9a7a5 2025-04-23T18:55:52 [font] Fix get_glyph_extents() logic
Behdad Esfahbod 38db1fac 2025-04-23T18:02:06 [paint] Change back return type of paint_glyph() to void Add new "_or_fail" variants of draw_glyph and paint_glyph New API: +hb_font_draw_glyph_or_fail_func_t +hb_font_paint_glyph_or_fail_func_t +hb_font_funcs_set_draw_glyph_or_fail_func() +hb_font_funcs_set_paint_glyph_or_fail_func() +hb_font_draw_glyph_or_fail() +hb_font_paint_glyph_or_fail() Deprecated API: -hb_font_draw_glyph_func_t -hb_font_paint_glyph_func_t -hb_font_funcs_set_draw_glyph_func() -hb_font_funcs_set_paint_glyph_func()
Behdad Esfahbod eb226383 2025-04-23T01:20:48 [font] Synthesize glyph extents if needed See code for logic. Fixes https://github.com/harfbuzz/harfbuzz/issues/5273
Behdad Esfahbod e78310bf 2025-04-23T00:58:08 [paint] Change return type to bool, and return false for outline glyphs It was impossible to get synthetic bold/slant correctly with the previous API. This is a minor API break, but one I'm willing to take.
Behdad Esfahbod 5d9cff80 2025-04-22T23:01:28 [font] Move is_synthetic() to .hh
Behdad Esfahbod a69713b5 2025-04-22T21:01:04 [color] Move slanting to font layer COLRv1 is still being double-slanted. Investigating.
Behdad Esfahbod 9dbb84e6 2025-04-22T20:25:44 [font] Don't apply synthetic bold/slant to parent Fixes https://github.com/harfbuzz/harfbuzz/issues/5274
Behdad Esfahbod 1a9e2175 2025-04-22T19:52:21 [font/draw] Move slanting to font layer I moved it to the draw layer in 11.0.0; That was a bad design: font-funcs should NOT be responsible for synthetic bold & slant. This design reverts that and makes the font layer apply it, using a recording. This is a minor API change from 11.0.0 since hb_draw_state_t::slant_xy which was introduced in 11.0.0, is removed now. I believe no client had started using it. It was only relevant to other font-funcs draw implementations.
Behdad Esfahbod 9ef82f89 2025-04-22T19:35:34 [font] Embolden font_v_extents
Behdad Esfahbod 5ebd740e 2025-04-22T19:28:16 [font] Move font_h_extents emboldening to font layer
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 aef3df50 2025-04-20T00:37:24 Merge branch 'main' into HVF
Behdad Esfahbod bc15ebde 2025-04-15T12:37:11 [font] Fix abs of int value
Behdad Esfahbod 7bb3000a 2025-04-13T12:46:52 [font] Allow negative emboldening strength to enlighten
Behdad Esfahbod e3c2910f 2025-04-02T01:48:12 Merge branch 'main' into HVF
Behdad Esfahbod a5b00faa 2025-03-31T14:28:31 Fix build with HB_NO_DRAW
Behdad Esfahbod d53cbeee 2025-03-31T14:24:47 [font] Fix warnings
Behdad Esfahbod 4cf4099f 2025-03-30T17:04:08 [ot/ft] Round glyph extents instead of floor/ceil 1. The floor/ceil was being applied in the wrong order for y direction. 2. If the scale is negative, the floor/ceil should be reversed. Just round them instead. That's what coretext / directwrite / fontations font-funcs do.
Behdad Esfahbod 22f81f70 2025-03-28T12:29:06 [font] Fix var initialization
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 a5887611 2025-03-28T00:09:26 [font] Fix void return
Behdad Esfahbod e7cd818e 2025-03-22T15:31:00 Merge branch 'main' into HVF
Behdad Esfahbod 977e4f94 2025-03-22T14:09:26 [font] Simplify changed mechanism
Behdad Esfahbod b1258cdd 2025-03-16T16:22:52 Merge branch 'main' into HVF
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 5402fe24 2025-03-12T23:06:11 Merge branch 'main' into HVF
Behdad Esfahbod a0d76c5b 2025-03-12T16:33:13 [atomic] Templatize
Behdad Esfahbod a0419a89 2025-03-09T05:36:00 Merge branch 'main' into HVF
Behdad Esfahbod aa268fc8 2025-03-09T03:31:01 [font/ft] See if tsan is happy with atomic_int_t serials
Behdad Esfahbod 9b6da299 2025-03-02T17:00:14 [font/var] Try to regain performance of all-normalized-coords=0
Ozkan Sezer c2f8f35a 2024-03-15T18:45:24 Use inttypes.h PRI?32 macros in format strings for [u]int32_t args. This is a modified and cleaned-up version of PR #4619 by @jpcomito: hb-common.h now expects 'inttypes.h' presence with MSVC exceptions, defines __STDC_FORMAT_MACROS in there (if not already defined) and undoes c930ae2 (PR #1974) and 902ab86. Co-authored-by: jcomito <jcomito@google.com>
Behdad Esfahbod 595def8f 2024-03-14T12:34:39 Revert "Fixing compiler warnings" This reverts commit 61a1ba2ff0fc1b1ed9db0b7c1dd0f59a4312e6e6.
jcomito 61a1ba2f 2024-03-12T21:34:14 Fixing compiler warnings All warning are for format specifiers (-WFormat) in sprintf().
Behdad Esfahbod 8c1b47d7 2023-02-19T20:38:43 [font] Fix compiler warnings
Behdad Esfahbod 560a65e4 2023-02-07T13:46:13 [embolden] Update glyph_extents in hb-ot-font
Behdad Esfahbod aef002e0 2023-02-07T11:29:49 [embolden] Add in-place option Adds --font-grade to hb-view and hb-shape.
Behdad Esfahbod 6b3fe8ac 2023-02-01T17:00:14 [embolden] Semi-handle with negative scales
Behdad Esfahbod e39104ba 2023-02-01T16:56:56 [font/util] Add emboldening API, --font-bold Needs documentation.
Behdad Esfahbod d195e077 2023-01-15T10:44:04 [font] Remember named_instance index Specially, in hb_font_set_variations() default to the named_instance for unspecified axes. Fixes https://github.com/harfbuzz/harfbuzz/issues/1883
Behdad Esfahbod d2aa2397 2023-01-09T13:43:56 Optimize non-slant extents code
Behdad Esfahbod 30adbc22 2023-01-09T11:54:44 hb-font: Fix scale_glyph_extents() again And better fix this time.
Behdad Esfahbod 6c1a4bed 2023-01-09T11:37:39 Better rounding clip boxes
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 71efa0dc 2022-12-14T06:22:00 wip: hb_font_paint_glyph
Behdad Esfahbod 897c1027 2022-12-22T08:14:13 [font] Fix scale_glyph_extents
Behdad Esfahbod 9194e13e 2022-12-22T07:31:16 [font] Apply slant to glyph extents Fixes https://github.com/harfbuzz/harfbuzz/issues/3952 hb-ft not fixed since doesn't use this code.
Behdad Esfahbod b0abbfd8 2022-12-22T07:26:14 [font] Centralize glyph-extents scaling Needs more testing... Some rounding was removed, namely in cff1 and cff2.
Behdad Esfahbod ac0efaf8 2022-11-22T12:50:36 Use hb_memset instead of memset consistently
Behdad Esfahbod c1c78ade 2022-06-28T13:19:12 [font] When font changes, drop font shaper data https://github.com/harfbuzz/harfbuzz/issues/3683#issuecomment-1168016509
Behdad Esfahbod d3308f47 2022-06-27T11:28:44 [font] Optimize font scaling further
Behdad Esfahbod 556e7078 2022-06-26T17:48:43 [font] Optimize glyph scaling
Behdad Esfahbod 7635568f 2022-06-10T07:29:15 [font] Remove a TODO item that's not gonna happen
Behdad Esfahbod 88ccbd2c 2022-06-01T08:44:07 [font-funcs] Optimize user-data/destroy storage Fixes https://github.com/harfbuzz/harfbuzz/issues/2427
Behdad Esfahbod cd05d187 2022-06-01T07:27:30 [font] Fix undefined-behavior when scales are negative Fixes https://github.com/harfbuzz/harfbuzz/issues/3555
Behdad Esfahbod a2015cd3 2022-05-20T12:15:00 [font] Add a separate serial_coords
Behdad Esfahbod 48db1c95 2022-05-20T12:03:32 [font] Add serial API New API: + hb_font_get_serial() + hb_font_changed() Fixes https://github.com/harfbuzz/harfbuzz/issues/2426 Unused internally as of now.
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 d6e49b82 2022-02-02T15:45:43 [font] Add em_fscalef_[xy] That take and return float
Behdad Esfahbod 6c0b65a6 2022-02-02T15:42:33 [font] Add em_scaleff() that returns float
Behdad Esfahbod ff697deb 2021-12-19T07:25:37 [GPOS] Apply font synthetic slant Part of fixing https://github.com/harfbuzz/harfbuzz/issues/3196
Behdad Esfahbod 810f5d71 2021-12-18T15:12:26 [font] Add public API for slant Not hooked up internally to anything. New API: + hb_font_set_synthetic_slant() + hb_font_get_synthetic_slant() Part of fixing https://github.com/harfbuzz/harfbuzz/issues/3196
Behdad Esfahbod bbaccf23 2021-11-01T16:45:36 Better round positions during scaling Fixes https://github.com/harfbuzz/harfbuzz/issues/3274
Behdad Esfahbod da500568 2021-10-26T08:02:29 [API] Add hb_buffer_[sg]et_not_found_glyph() and --not-found-glyph Instead of using gid=0 when a character is not found in the font, client can now set a custom value. This is useful for shaper-driven font fallback and to differentiate that from .notdef glyph. Fixes https://github.com/harfbuzz/harfbuzz/issues/1360
Ebrahim Byagowi d0e2addd 2020-07-18T22:14:52 minor
Ebrahim Byagowi 2dda6dd7 2020-04-20T14:12:45 minor, tweak spacing turn 8 spaces to tab, add space before Null/Crap
Ebrahim Byagowi ab2d3ec5 2019-08-14T18:42:51 [var] Implement hb_font_get_var_coords_design Hold design coords and simulate when normalized coords are set directly.
Ebrahim Byagowi 0558413f 2019-10-01T13:49:55 Minor, tweak spaces
Behdad Esfahbod f18ea1dd 2019-07-05T13:56:45 [font] Remove division when scaling Yoohoo. This seems to be precise enough! Let's see if it sticks. I'm asking Dominik to run this in Chrome test suite and report. Fixes https://github.com/harfbuzz/harfbuzz/issues/1801
Behdad Esfahbod b8477692 2019-07-05T13:52:09 [font] Keep font-space to user-space multiplier Part of https://github.com/harfbuzz/harfbuzz/issues/1801
Behdad Esfahbod 0d425e1e 2019-07-05T13:18:05 [ot-font] Optimize rounding Part of https://github.com/harfbuzz/harfbuzz/issues/1801 The assumption that compiler optimizes "upem/2" to a shift only works if upem is unsigned... Anyway, spoon-feed the compiler.
Behdad Esfahbod 0819f3ca 2019-06-17T14:02:47 Deprecate v_kerning callback again Part of https://github.com/harfbuzz/harfbuzz/issues/1682
Behdad Esfahbod fca27860 2019-05-11T00:37:01 [config] Make HB_DISABLE_DEPRECATED actually compile Part of https://github.com/harfbuzz/harfbuzz/issues/1652
Behdad Esfahbod dfc57802 2019-05-07T23:26:09 Fix more double-promotion errors WHy do only some of the clang bots catch this I have no idea :(.
Ebrahim Byagowi e4120085 2018-12-17T21:31:01 Remove redundant void from C++ sources (#1486)
Ebrahim Byagowi b2ebaa9a 2018-12-16T22:38:10 Remove redundant 'inline' from methods (#1483)
Behdad Esfahbod ce5da0f3 2018-11-16T02:29:13 [shaper] Rewrite shaper data code to be more template-driven than macro-driven
Behdad Esfahbod 5570c87f 2018-11-03T14:51:38 Port objects to use header.writable instead of immutable Saves 4 or 8 bytes per object on 64bit archs.
Behdad Esfahbod 35d410f2 2018-10-29T14:45:44 Remove ASSERT_POD Newer compilers / language allows structs with constructor in union. So, this was not actually testing anything. Indeed, the recent change in DISALLOW_COPY *is* making some of our types non-POD. That broke some bots. Just remove this since it wasn't doing much, and I'd rather have DISALLOW_COPY.
Behdad Esfahbod 08b71729 2018-10-19T19:12:33 [font] Fix parallel funcs passing to eachover in infinite-loop Fixes test just added.
Behdad Esfahbod 8008bca8 2018-10-09T14:38:23 Whitespace
Behdad Esfahbod b314c4e9 2018-10-09T09:23:51 [font] Add get_nominal_glyphs() callback (note the plural) Unused as of now. To be wired up to normalizer, which would remove overhead and allow hb-ot-font initialization to become a no-op, so we can enable it by default.
Behdad Esfahbod ca6a3170 2018-10-09T09:06:07 Minor
Behdad Esfahbod bee93e26 2018-10-09T08:01:49 Add const to get_*_advances API Ouch!
Behdad Esfahbod 683c3a95 2018-10-08T23:09:48 [kern] Abstract away kerning machine
Behdad Esfahbod c77ae408 2018-08-25T22:36:36 Rename hb-*private.hh to hb-*.hh Sorry for the noise, downstream custom builders. Please adjust.