Commit Graph

128 Commits

Author SHA1 Message Date
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 7c12db46ff Try to fix msvc build 2022-12-23 13:37:59 -07:00
Matthias Clasen 021618e91a [colr] Add hb_ot_color_has_paint
This is a counterpart to hb_ot_color_has_layers
for COLRv1 data.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod b9314400ec [colr] Hook up color-line variation 2022-12-23 13:37:59 -07:00
Behdad Esfahbod edf2738263 [colr] Try fixing bot build
I don't get the error. Let's see.

../../src/harfbuzz/src/hb-ot-color-colr-table.hh:574:66: error: incomplete definition of type 'OT::NoVariable<OT::ColorLine<OT::NoVariable>>'
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 c6dd56cc64 [colr] Simplify color-stop handling 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 452cfb9599 [colr] Simplify loop using iterators
Or complexify?!
2022-12-23 13:37:59 -07:00
Behdad Esfahbod 8a9069d55f [colr] Fix radial gradient
Broke it when adding variations.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod 1953d26a8a [colr] Limit recursion depth 2022-12-23 13:37:59 -07:00
Matthias Clasen 0b33b35eb0 COLRv1: Return bool from paint_glyph
This will let hb_ot_font_paint_glyph() try
multiple tables in turn.
2022-12-23 13:37:59 -07:00
Matthias Clasen 0d890061d1 Rename 'solid' to 'color'
'solid' does not really describe well what
the function does, and there is no strong
reason to stick 1:1 to the terminology used
in the spec.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod 46286275f7 [colr] More dispatch functionality 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 81f232afb5 [colr] Use dispatch machinery for paint_glyph context 2022-12-23 13:37:59 -07:00
Behdad Esfahbod a96300d42c [colr] Hide internal symbols 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 0757519092 [colr] Add variation to rest of the paints 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 5bce005346 [colr] Flesh out variations for a few paints 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 9d3440b742 [colr] Add variation infrastructure to paint_glyph
No paint applies variations yet.
2022-12-23 13:37:59 -07:00
Matthias Clasen 5c6329555e Apply root transform
This commit applies scale, slant is still missing.
2022-12-23 13:37:59 -07:00
Matthias Clasen d7c2eacf45 Handle COLRv0 layers in paint_glyph 2022-12-23 13:37:59 -07:00
Matthias Clasen 55ca6ed230 minor fixes 2022-12-23 13:37:59 -07:00
Matthias Clasen 1880e54753 Assorted fixes 2022-12-23 13:37:59 -07:00
Matthias Clasen 684df8a82a add some todos 2022-12-23 13:37:59 -07:00
Matthias Clasen a6f813b680 Implement hb_color_line_get_extend 2022-12-23 13:37:59 -07:00
Matthias Clasen 3937d6b0aa Implement hb_color_line_t 2022-12-23 13:37:59 -07:00
Matthias Clasen 627c857f8b rename pop_group_and_composite 2022-12-23 13:37:59 -07:00
Matthias Clasen c9350838c7 assorted fixes and changes 2022-12-23 13:37:59 -07:00
Matthias Clasen 8377341b28 wip: implement paint_glyph 2022-12-23 13:37:59 -07:00
Matthias Clasen 6a48ac42f4 COLR implementation 2022-12-23 13:37:59 -07:00
Matthias Clasen 83d0a49f71 wip: hb-paint 2022-12-23 13:37:59 -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 206957aee4 [COLR] Change recursion limit back to 128 2022-12-17 08:57:56 -07:00
Matthias Clasen a98c6fdd92 Mark an argument as unused 2022-12-16 13:23:01 -07:00
Matthias Clasen 601d3806c9 COLRv1: Revamp extents variation
Try to do this a cleaner way.
2022-12-16 13:23:01 -07:00
Behdad Esfahbod 6ae35365f8 Fix build 2022-12-16 11:43:38 -07:00
Behdad Esfahbod e957391efe [colr] Add NoVariable::varIdxBase 2022-12-16 11:33:04 -07:00
Behdad Esfahbod e06de98c36 [var-common] Make VarInstancer take an offset 2022-12-16 11:31:00 -07:00
Behdad Esfahbod 251f9f6213 [open-type] Add VarIdx::add() 2022-12-16 11:29:51 -07:00
Behdad Esfahbod bf2ae3f0ca [open-type] Add static_assert for NO_VARIATION 2022-12-16 11:26:24 -07:00
Matthias Clasen d4496e6405 COLRv1: Apply variations correctly
The variations are for xMin, yMin, xMAx, yMax.
Apply them before converting to extents..
2022-12-16 11:14:42 -07:00
Behdad Esfahbod 4e9a6cfb49 [COLR] Use VarStoreInstancer 2022-12-12 10:20:51 -07:00
Behdad Esfahbod c64661b2f8 [COLR] Fix variation code 2022-12-12 10:11:02 -07:00
Behdad Esfahbod ff332b14ea [COLR] Handle HB_OT_LAYOUT_NO_VARIATIONS_INDEX 2022-12-11 21:05:14 -07:00
Behdad Esfahbod 9a3f0be291 [COLR] Apply variations in get_extent 2022-12-11 13:40:53 -07:00
Behdad Esfahbod 68964efa55 [COLR] Use bsearch in get_extents 2022-12-11 13:21:01 -07:00
Behdad Esfahbod d0ee5a452f [COLR] Return false from get_extents if table version not 1 2022-12-11 13:13:35 -07:00
Behdad Esfahbod b3d6a5ef86 [colr] Minor no behavior change 2022-12-11 13:12:30 -07:00
Matthias Clasen 7a748ad4ac COLRv1: use ClipBoxes for extents
This is a first step; ultimatively, we
should compute the extents is ClipBoxes
are missing.
2022-12-11 13:12:30 -07:00
Behdad Esfahbod d36a0f8c42 [COLR] Add TODO 2022-12-11 13:12:19 -07:00
Behdad Esfahbod a306820681 [colr] Use SortedArray instead of Array 2022-12-11 13:03:55 -07:00