Commit Graph

14870 Commits

Author SHA1 Message Date
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 13e0cb64f4 hb-view: Interpolate gradients premultiplied
This is what the specs demand.
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
Behdad Esfahbod 7a2dc5cf5b [docs] Hook up a couple 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
Matthias Clasen ee7bbdf372 tests: Update expected results
These were changed by fixes for glyph transforms.
2022-12-23 13:37:59 -07:00
Matthias Clasen 3993a40703 test: Add some verification hints 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 47dbebff39 [paint] Add COLRv0 tests 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 63db0d2aed [util] Speculatively fix build against non-PNG builds 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 bd1389bedf [paint] Add hb_paint_context_t to docs 2022-12-23 13:37:59 -07:00
Matthias Clasen 5d7553d38f view: Add a --font-palette option 2022-12-23 13:37:59 -07:00
Matthias Clasen d094e76cbc hb-view: Pass fg color to hb_font_paint_glyph 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 b1500babaa utils: Some cairo helper tweaks 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