Commit Graph

11871 Commits

Author SHA1 Message Date
Behdad Esfahbod 583f010b05 [ft] Move lock only around clip_glyph 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 2762903909 [ft-colr] Minor 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 3a1385f019 [ft-colr] Simplify color-stop callback 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 1cc3b10008 [ft-colr] Ifdef build for older freetype 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 882c2bca2d [ft-colr] Add a paint context 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 7a4b4c64f2 [ft-colr] Minor macro 2022-12-23 13:37:59 -07:00
Behdad Esfahbod c453c2fce9 [ft-colr] Fix color-stop iteration 2022-12-23 13:37:59 -07:00
Matthias Clasen bbb89e62aa [paint] Document color lines as transient
Just so people don't get ideas.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod 15582d5fc1 [ft-colr] Apply slant to clipbox 2022-12-23 13:37:59 -07:00
Matthias Clasen 7abd5dcf10 [ft-paint] Fix handling of colorstop iters 2022-12-23 13:37:59 -07:00
Matthias Clasen 393bab4ba1 [ft-paint] Apply ClipBox to all glyphs 2022-12-23 13:37:59 -07:00
Matthias Clasen c11ae85cbf [ft-paint] Apply root transform 2022-12-23 13:37:59 -07:00
Matthias Clasen 7fc3fdac76 [ft-paint] Optimize away some transforms 2022-12-23 13:37:59 -07:00
Matthias Clasen 586d1758c1 [ft-paint] Fix an oversight 2022-12-23 13:37:59 -07:00
Matthias Clasen 092637f94c [ft-paint] Fix rounding 2022-12-23 13:37:59 -07:00
Matthias Clasen fe08e956e0 [ft-paint] Fix a case of x/y confusion 2022-12-23 13:37:59 -07:00
Matthias Clasen 0d5256e5a7 [ft-paint] Fix some fixed->float conversions 2022-12-23 13:37:59 -07:00
Matthias Clasen 07ba5be393 [paint] Documentation tweaks 2022-12-23 13:37:59 -07:00
Matthias Clasen 21f78c8774 [paint] Document that colors are unpremultiplied
And mention that gradient interpolation must happen
in premultiplied space.
2022-12-23 13:37:59 -07:00
Matthias Clasen b6e98cf758 [colr] Add more docs
State explicitly that palette entries are
unpremultipled, and link to the spec.
2022-12-23 13:37:59 -07:00
Matthias Clasen a634f6b486 [colr] Add more docs
State explicitly that palette entries are
unpremultipled, and link to the spec.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod a02c2a911c [ft-paint] Apply alpha correctly 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 6ebcc9d2e1 [ft-paint] Hook up gradients 2022-12-23 13:37:59 -07:00
Behdad Esfahbod fe4e9bd930 [colr] Add public vtable for hb_color_line_t 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 7c9e42ed92 [colr] Fix transform hell 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 569d5b436c [ft-paint] Remove dead code 2022-12-23 13:37:59 -07:00
Behdad Esfahbod cfdc34b44d [ft-paint] Implement FT_COLR_PAINTFORMAT_SKEW 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 64cf17ec8b [ft-paint] Fix center translation 2022-12-23 13:37:59 -07:00
Behdad Esfahbod ddbe4e52ec [ft-paint] Implement FT_COLR_PAINTFORMAT_ROTATE 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 16598e024b [ft-paint] Default 2022-12-23 13:37:59 -07:00
Behdad Esfahbod a0f7f9e61c [ft-paint] Implement FT_COLR_PAINTFORMAT_COMPOSITE 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 0ec201446b [ft] Implement FT_COLR_PAINTFORMAT_COLR_GLYPH 2022-12-23 13:37:59 -07:00
Behdad Esfahbod ac2682c610 [ft] Start of a COLRv1 renderer 2022-12-23 13:37:59 -07:00
Behdad Esfahbod e2546f5ab0 [ft] Add hb-ft-colr.hh 2022-12-23 13:37:59 -07:00
Matthias Clasen 5bd3c07b54 [colr] Don't access baseGlyphList unless v1
This was showing up sporadic crashes due to
invalid reads.
2022-12-23 13:37:59 -07:00
Matthias Clasen 6909701b36 [paint] Update docs 2022-12-23 13:37:59 -07:00
Behdad Esfahbod 381d410b1e [paint] Add HB_PAINT_IMAGE_FORMAT_BGRA and use it in hb-ft
Now hb-ft can render color emoji as well.

Just left COLRv2.
2022-12-23 13:37:59 -07:00
Behdad Esfahbod c5f903872f [paint] Add bitmap width/height to paint_image callback
Such that we can add raw data as well.
2022-12-23 13:37:59 -07:00
Matthias Clasen eef47f2379 [paint] Fix the docs 2022-12-23 13:37:59 -07:00
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
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
Matthias Clasen 485ba9beb3 [paint] Spell out rectangle in the API
No need to abbreviate this.
2022-12-23 13:37:59 -07:00
Matthias Clasen 37f3f0fcc2 [paint] Change the image callback
Instead of passing the glyph ID, give
it the image blob, a mimetype, and
glyph extents (if available).

Update all callers.
2022-12-23 13:37:59 -07:00
Matthias Clasen ea48d6c292 Move hb_glyph_extents_t definition 2022-12-23 13:37:59 -07:00
Behdad Esfahbod b722039c48 [colr] Simplify 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 601a596ca0 [paint] Fix include path 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 e799c33bb5 [paint] Fix function prototype 2022-12-23 13:37:59 -07:00