Commit Graph

267 Commits

Author SHA1 Message Date
Behdad Esfahbod ae208963df Add hb-limits.hh 2022-12-26 12:30:39 -07:00
Behdad Esfahbod f3985d9482 [paint] Fix drawing non-color glyphs 2022-12-23 13:37:59 -07:00
Matthias Clasen c221933977 [paint] Preserve foreground information 2022-12-23 13:37:59 -07:00
Matthias Clasen 6387004cad [paint] Simplify api
Drop the hb_paint_context_t struct from the API, and
only pass the font where we need it.
2022-12-23 13:37:59 -07:00
Matthias Clasen 71bd5a0dfc [paint] Resolve colors
We don't need to pass the index/alpha pairs to
client callbacks, and can just resolve the colors
internally.

Update test results.
2022-12-23 13:37:59 -07:00
Matthias Clasen 9be01b6bff [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.
2022-12-23 13:37:59 -07:00
Matthias Clasen 97224f3b63 [paint] Pass font to all callbacks
This will lead to easier implementations.

At the same time, we change the push_clip_glyph
callback to use the font as-is, no unscaling needed.

Update all callers and expected test results.
2022-12-23 13:37:59 -07:00
Matthias Clasen 686e627bdf [paint] Set up root transform in one place
Instead of spreading this in all the tables,
make hb_paint_funcs_t provide a push/pop_root_transform
that does all the setup.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod 601a596ca0 [paint] Fix include path 2022-12-23 13:37:59 -07:00
Matthias Clasen 2edd771cf5 glyf: Implement paint_glyph 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 9a0ebd2b2a [glyf] Fix slant-scaling in GlyphHeader too 2022-12-22 10:21:50 -07:00
Behdad Esfahbod b0abbfd868 [font] Centralize glyph-extents scaling
Needs more testing...

Some rounding was removed, namely in cff1 and cff2.
2022-12-22 07:32:15 -07:00
Behdad Esfahbod 97b8ada865 [varc] Reset component coordinates to that of the font
Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/78
2022-12-21 19:52:20 -07:00
Behdad Esfahbod 9b5b4da0e4 [varc] Set coordinates as absolute values 2022-12-20 09:58:04 -07:00
Behdad Esfahbod 80e68f09c5 [VarC] Change rotation/skew representation
Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/77
2022-12-19 19:17:04 -07:00
Behdad Esfahbod 03a1685693 [VarC] Change representation of scale from 4.12 to 6.10
Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/76
2022-12-19 17:12:09 -07:00
Jordan Petridis 79285a9983
VarC: cast ints (#3934)
msvc is rightfully complaining that the types on the sides of
the ternary are not matching:

```
C:\pango\subprojects\harfbuzz\src\OT\glyf\VarCompositeGlyph.hh(317): error C2446: ':': no conversion from 'const OT::HBUINT16' to 'const OT::HBUINT8'
```
2022-12-13 11:14:20 -07:00
Behdad Esfahbod bd7cb384cf [VarC] Remove unused variable 2022-12-12 14:10:48 -07:00
Behdad Esfahbod 1b278c7658 [VarC] Update for new format
https://github.com/harfbuzz/boring-expansion-spec/issues/71
2022-12-12 13:57:05 -07:00
Behdad Esfahbod 6bb478eeeb [VarC] Clamp after addition 2022-12-12 11:39:06 -07:00
Behdad Esfahbod 80a5011eb6 [VarC] Fix coord setting
Those are additive.
2022-12-12 11:37:59 -07:00
Behdad Esfahbod 9ab2c8034e Revert "[glyf] Use component phantom points after transformation"
This reverts commit a756bd1944.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3929
2022-12-11 12:04:29 -07:00
Behdad Esfahbod bf2e817549 [VarComposites] Support GID24 2022-12-09 23:15:26 -07:00
Behdad Esfahbod 10d38dcdfd [varc] Change format slightly
Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/70
2022-12-09 19:19:57 -07:00
Behdad Esfahbod 5cf0b9ae7d [varc] Mark as experimental feature with HB_NO_VAR_COMPOSITES 2022-12-09 18:59:43 -07:00
Behdad Esfahbod 82b4f3791e [coord-setter] Don't modify font coords 2022-12-09 18:46:33 -07:00
Behdad Esfahbod e9e503b80b [Glyph] Pass down coords to get_points 2022-12-09 18:42:46 -07:00
Behdad Esfahbod 8e46870093 [gvar] Take coords in instead of font in apply_deltas_to_points 2022-12-09 18:35:30 -07:00
Behdad Esfahbod 3caa42a4a7 Fix build after rebase 2022-12-09 14:48:41 -07:00
Behdad Esfahbod bbe59e4211 Whitespace 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 13deea7cbd [glyf/VarComposite] Clamp axis coordinates 2022-12-09 14:45:29 -07:00
Behdad Esfahbod a975be4c07 [glyf/VarComposite] Minor rename 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 1e71db2d26 [glyf/VarComposite] Fix transformation 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 1233be61d8 [glyf/VarComposite] Remove unneeded resize 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 1a906162cb [glyf/coord-setter] Fix memory issue 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 7efd68da39 [glyf/VarComposite] Set coordinates
Code is untested but complete!
2022-12-09 14:45:29 -07:00
Behdad Esfahbod 4ec7781497 [glyf] Move coord-setter to its own file 2022-12-09 14:45:29 -07:00
Behdad Esfahbod dadb4ed71d [glyf/VarComposite] More, almost there 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 0a939b48a6 [glyf/VarComposite] Implement more 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 65cc3b5e2b [glyf/VarComposite] More 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 60d959a6e7 [glyf/VarComposite] Add use_my_metrics() 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 575d99406a [glyf] Flesh out VarCompositeGlyph 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 21f671bc45 [glyf] Add stub VarCompositeGlyph 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 435c5eeffe [glyf] Split composite-iter 2022-12-09 14:45:29 -07:00
Behdad Esfahbod 1024a013fd [glyf] Add CoordSetter 2022-12-09 14:45:29 -07:00
Behdad Esfahbod aa7f5e3742 [subset] Conditionalize call to hb_font_set_variations 2022-12-04 15:33:18 -07:00
Behdad Esfahbod 301f6e4b47 [Coverage] Remove TODO 2022-12-04 11:46:10 -07:00
Behdad Esfahbod dbbb8e8006 Revert "[map] Add hb_map_filter_invalid"
This reverts commit 8d7e921117.

Surprisingly this slowed NotoNastaliqUrdu benchmark down by a couple
percent instead of speeding it up.
2022-12-04 11:13:39 -07:00
Behdad Esfahbod 8d7e921117 [map] Add hb_map_filter_invalid
Use it in one place.
2022-12-04 11:02:15 -07:00
Behdad Esfahbod 41a8597f38 [layout] Simplify CoverageFormat2 intersects_coverage() 2022-12-03 13:23:26 -07:00