Commit Graph

11782 Commits

Author SHA1 Message Date
Behdad Esfahbod 3c972867b9 More s/hb_font_get_glyph_shape/hb_font_draw_glyph/ 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 72a169c846 [ft] Paint COLRv0 glyphs 2022-12-23 13:37:59 -07:00
Behdad Esfahbod bb807f47d2 [ft] Implement paint_glyph() for outline glyphs 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 91c880503e [ft] Use new name for draw API 2022-12-23 13:37:59 -07:00
Behdad Esfahbod c27eefec1d Revert "Drop the deprecation"
This reverts commit 3904e66777339a3d420ece1c2b7d550949aa3946.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod f3985d9482 [paint] Fix drawing non-color glyphs 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 237955dffc [paint] Add slant to image() callback
And slant images in hb-view.
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 f146299a40 [paint] Drop unnecessary api 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
Behdad Esfahbod 6c71c530ca [paint] Rename hb_paint_context_t to hb_ot_paint_context_t 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 8495395397 [paint] Fix slant 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 32ce29f99e [font] Move hb_font_t typedef
This is needed to avoid circular header dependencies.
2022-12-23 13:37:59 -07:00
Matthias Clasen 8364d9130f Document hb_font_set_draw_glyph_func 2022-12-23 13:37:59 -07:00
Matthias Clasen a20999b9df [font] Fix a few documentation mistakes 2022-12-23 13:37:59 -07:00
Matthias Clasen 2333a566ed Drop the deprecation
No need to drop hb_font_get_glyph_shape, just
because hb_font_draw_glyph does the same.

Its fine to keep both around.
2022-12-23 13:37:59 -07:00
Matthias Clasen 14b026ff86 [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.
2022-12-23 13:37:59 -07:00
Matthias Clasen 08da126523 [docs] Linkify links 2022-12-23 13:37:59 -07:00
Matthias Clasen 9437f719a7 [paint] Document hb_paint_extend_t 2022-12-23 13:37:59 -07:00
Matthias Clasen 3a2634e27c [paint] Document hb_font_paint_glyph_func_t 2022-12-23 13:37:59 -07:00
Matthias Clasen 0f287e75ec [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.
2022-12-23 13:37:59 -07:00
Matthias Clasen ddd2039265 [paint] Improve the docs 2022-12-23 13:37:59 -07:00
Matthias Clasen 3a219cfa6a [config] Make HB_LEAN imply HB_NO_PAINT 2022-12-23 13:37:59 -07:00
Matthias Clasen 0ef2dc9be5 Drop a TODO
This was addressed in 61bd602791d801
2022-12-23 13:37:59 -07:00
Matthias Clasen 96cda3886c [paint] Clarify docs
Spell out where the different datas originate.
2022-12-23 13:37:59 -07:00
Matthias Clasen 0800d1879c Try to fix autotools build 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 5ac218865a [paint] A doc fix 2022-12-23 13:37:59 -07:00
Matthias Clasen 7c12db46ff Try to fix msvc build 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 5d1fc9ee9d [paint] Fix annotations 2022-12-23 13:37:59 -07:00
Behdad Esfahbod ee2204469e [paint] Add get_empty / [sg]et_user_data 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 21a9db875e [draw] Add get_empty / [sg]et_user_data 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 9a7422c5fb [font] Minor doc fix 2022-12-23 13:37:59 -07:00
Behdad Esfahbod a9b37206eb [font] Minor rename 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 815544a1f7 [font] Adapt paint_glyph to parent transform 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 85917e5b21 [paint] Fix docs 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 14bf3aaa8d [colr] Make paint_image work again 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 7accbe97d8 [util] Fix argument order and root transform PNGs 2022-12-23 13:37:59 -07:00
Matthias Clasen f1f8d1e855 Small documentation addition 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
Matthias Clasen 63fcb26c9b Add some more docs 2022-12-23 13:37:59 -07:00
Matthias Clasen 451414a27e [paint] Documentation fixes 2022-12-23 13:37:59 -07:00
Matthias Clasen 0c77f1d9ab [paint] Documentation tweaks 2022-12-23 13:37:59 -07:00
Matthias Clasen 0a2f3673b9 [paint] Use tags for image formats
This fits better with the rest of the
HarfBuzz API.
2022-12-23 13:37:59 -07:00
Matthias Clasen 4c728e952b [colr] Add a todo 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 4b0285bae6 [colr] Use slant_xy 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
Matthias Clasen a935e4b0c2 [paint] Add synthetic slant to root transform 2022-12-23 13:37:59 -07:00