Commit Graph
14622 Commits
Author SHA1 Message Date
Behdad Esfahbod a69713b520 [color] Move slanting to font layer
COLRv1 is still being double-slanted. Investigating.
2025-04-22 21:02:45 -06:00
Behdad Esfahbod 9dbb84e6fd [font] Don't apply synthetic bold/slant to parent
Fixes https://github.com/harfbuzz/harfbuzz/issues/5274
2025-04-22 20:25:44 -06:00
Behdad Esfahbod 1a9e21758d [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.
2025-04-22 19:52:21 -06:00
Behdad Esfahbod 9ef82f8926 [font] Embolden font_v_extents 2025-04-22 19:35:34 -06:00
Behdad Esfahbod 5ebd740ee8 [font] Move font_h_extents emboldening to font layer 2025-04-22 19:29:02 -06:00
Behdad Esfahbod 0d8717275a [buffer] Limit the extent of set_flags range
We can easily get into O(n^2) otherwise.
2025-04-22 15:40:06 -06:00
Behdad Esfahbod 0536254885 Merge pull request #5294 from harfbuzz/paint-bounds
[COLRv1] `paint-bounds`
2025-04-20 05:06:54 -06:00
Behdad Esfahbod c62af2c360 [paint-unbounded] Minor tweak
I like it better this way.
2025-04-20 04:53:33 -06:00
Behdad Esfahbod 6e2806e46c [paint-bounded] Reduce vector use
Keep current drawing's boundedness outside of the vector
(common case).

Again, no speedup because of the scratch pattern.
2025-04-20 04:47:58 -06:00
Behdad Esfahbod 27b2e16ac0 [atomic] Make cmpexch() non-const
Was a mistake. Make the affected members mutable instead.
2025-04-20 04:34:40 -06:00
Behdad Esfahbod 7aa3ab933b [paint-bounded] Remove one vector
Doesn't make things faster though because of the scratch pattern.
2025-04-20 04:28:28 -06:00
Behdad Esfahbod 78822b6336 Revert "[COLRv1] Move paint boundedness check to font layer"
This reverts commit c9a26fbf47.
2025-04-20 04:23:35 -06:00
Behdad Esfahbod c9a26fbf47 [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.
2025-04-20 04:22:32 -06:00
Behdad Esfahbod 8aa88aa416 [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
2025-04-20 04:11:07 -06:00
Behdad Esfahbod d175e2214e [paint-bounded] Add new code to compute boundedness of paintings
This is faster than using paint-extents to just compute boundedness.

Unused right now.
2025-04-20 04:02:05 -06:00
Behdad Esfahbod 4a9ac263c6 [draw] Move draw_extents form paint-extents to draw 2025-04-20 02:12:40 -06:00
Behdad Esfahbod 4fc84b0e99 [ot-font] Fix order of COLR vs VARC extents
COLR can reference VARC, not the other way around.
2025-04-20 00:36:28 -06:00
Behdad Esfahbod 01793d3eaf [fontations] Pop font transform 2025-04-20 00:32:44 -06:00
jfkthame 4e7b178f3c Avoid unannotated-fallthrough in hb-ot-layout-base-table.hh 2025-04-17 11:57:15 -06:00
jfkthame 2602f7292c Avoid unannotated-fallthrough warning in COLR.hh 2025-04-17 11:56:46 -06:00
Khaled Hosny 416e6b6921 11.1.0 2025-04-16 20:35:58 +02:00
Behdad Esfahbod 32b36fa84c [atexit] Fix extra semicolon
Fixes https://github.com/harfbuzz/harfbuzz/issues/5290
2025-04-15 12:37:43 -06:00
Behdad Esfahbod bc15ebdea1 [font] Fix abs of int value 2025-04-15 12:37:11 -06:00
Behdad Esfahbod 8f413a533c [layout] Docs 2025-04-15 10:03:16 -06:00
Behdad Esfahbod 7bb3000a31 [font] Allow negative emboldening strength to enlighten 2025-04-15 09:58:42 -06:00
Khaled Hosny e192a584a8 [check-symbols] Ignore another rust symbol
Fixes https://github.com/harfbuzz/harfbuzz/issues/5287
2025-04-15 16:59:46 +02:00
robxnano cf7bffb690 meson: Use full path in HBSOURCES
Using the file object directly in a format string is broken
and now deprecated.
2025-04-13 02:59:31 +02:00
robxnano 9def626d4a meson: Fix warnings about features in later versions
By using the fs.relative_to() function inside version_compare
blocks, Meson can suppress warning messages about it being used
in a project with a lower minimum version.
2025-04-13 02:59:31 +02:00
robxnano e2a865f024 meson: Only check for _MSC_FULL_VER once
Prevents the log from filling with repeated calls to check the
value of the define.
2025-04-13 02:59:31 +02:00
Garret Rieger efcb7d3de1 [subset] close unicodes over bidi mirror variants during subsetting.
Fixes #5281. Does the closure by default, but I've introduced a new flag and option to disable this behaviour since some users may want to get the minimal set if they know they don't need the mirrored variants.
2025-04-11 18:13:28 -06:00
Garret Rieger 5afbd187b6 [subset] Split subset plan variations function into separate file.
Compile times for hb-subset-plan.cc go from 16s -> 13s.
2025-04-09 17:08:06 -06:00
Garret Rieger d3ccdcdd80 [subset] Move GDEF subset planning into hb-subset-plan-layout.cc 2025-04-09 16:45:07 -06:00
Garret Rieger b33f2e26ee [subset] Start splitting layout specific subset plan functionality.
The aim is to reduce the compiled time of hb-subset-plan.cc which on my machine takes almost 30s to compile.
2025-04-09 16:45:07 -06:00
Behdad Esfahbod ab3235150d [common] Move hb_script_t enum to a separate file
Fixes https://github.com/harfbuzz/harfbuzz/issues/5271
2025-04-09 10:43:02 -06:00
Behdad Esfahbod 5f80cc1600 [directwrite] Fix build 2025-04-08 02:13:39 -06:00
Behdad Esfahbod 6b0124284b [mutex] Delete copy constructors 2025-04-08 01:58:10 -06:00
Behdad Esfahbod caa9cf2e85 [atomic] Remove unnecessary macro
Had typo in it as well.
2025-04-08 01:50:51 -06:00
Behdad Esfahbod c7f980907f [GPOS] Short-circuit variations if no axis set 2025-04-07 16:37:00 -06:00
Garret Rieger b1a0a4c228 In OT::VarData::Serialize don't attempt to serialize an empty set of rows.
Protects against incorrectly accessing rows[0] when rows is empty.
2025-04-07 13:11:39 -06:00
Khaled Hosny 2c4bc83244 [ot-math] Fix build with HB_NO_MATH 2025-04-07 13:43:16 +02:00
Behdad Esfahbod a3d626b4b9 [test-object] Hopefully last ubsan fix
API change:
- hb_face_is_immutable() now takes `hb_face_t *` instead of previous
  `const hb_face_t *`.  This should not pose any problem for any
  clients in our belief.
2025-04-06 19:16:43 -06:00
Behdad Esfahbod cc065cf2e5 [test/subset] Better report passed tests 2025-04-06 15:33:08 -06:00
Behdad Esfahbod 1f1cbb64ee Merge pull request #5260 from harfbuzz/tap
Use TAP protocol for tests
2025-04-06 14:30:07 -06:00
Behdad Esfahbod 5a46872853 Add test for https://github.com/harfbuzz/harfbuzz/issues/5232 2025-04-06 13:32:28 -06:00
Khaled Hosny 9718681c99 [meson] Require 0.60.0
Fixes https://github.com/harfbuzz/harfbuzz/issues/5261
2025-04-06 13:23:43 -06:00
Behdad Esfahbod 628a9ee28a [check-static-inits] objdump all objects together
We won't see which object has the bad initializers anymore.
We can later adapt to objdump each object one by one if
any error was found.

Changes test runtime from 1s down to 0.15s.
2025-04-06 02:34:48 -06:00
Behdad Esfahbod 6acb2942e8 [ft] Fix compiler warnings 2025-04-06 02:34:34 -06:00
Behdad Esfahbod a46b93208a [subset] Remove printf from library! 2025-04-05 23:27:15 -06:00
Behdad Esfahbod d9304b69e0 [subset] Fix i686 oss-fuzz build hopefully 2025-04-05 20:04:10 -06:00
Khaled Hosny f57b43c980 [ot-math] Workaround bad displayOperatorMinHeight in Cambria Math
See https://github.com/harfbuzz/harfbuzz/issues/4653 for details
2025-04-06 02:48:49 +02:00