Commit Graph

11935 Commits

Author SHA1 Message Date
Matthias Clasen ddb52e4a30 [cairo] Add docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod dc2bf2664d [cairo] Set scaled-font extents 2022-12-26 17:01:08 -07:00
Behdad Esfahbod d6ecda36bf [cairo] Renames 2022-12-26 17:01:08 -07:00
Behdad Esfahbod ffa45f243c [cairo] #ifdef HAVE_CAIRO 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 9e61fd7705 [hb-cairo] Lazy-load funcs thread-safe 2022-12-26 17:01:08 -07:00
Matthias Clasen 306645503d Work on proper build integration
Install hb-cairo.h and define HB_HAS_CAIRO.
2022-12-26 17:01:08 -07:00
Behdad Esfahbod a7c2e839e1 [hb-cairo] Prefix internal methods 2022-12-26 17:01:08 -07:00
Behdad Esfahbod bb640d4031 [hb-cairo] Use nullptr instead of NULL 2022-12-26 17:01:08 -07:00
Behdad Esfahbod b3a3656683 [hb-cairo] Minor 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 3a11a09f54 [hb-cairo] Rename cairo_extend 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 20a50acc91 [hb-cairo] Make hb_cairo_glyphs_from_buffer public 2022-12-26 17:01:08 -07:00
Behdad Esfahbod bf52386cfa [cairo] Silence warning 2022-12-26 17:01:08 -07:00
Behdad Esfahbod e594780e28 [hb-cairo] Some header tweaks 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 1ad24421a6 [hb-cairo] Rename files to C++ 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 5c3da76a43 [hb-cairo] Change API again
We need to work with a hb-font for variations and font-funcs
to be fetched properly.
2022-12-26 17:01:08 -07:00
Behdad Esfahbod 9f7538c260 [hb-cairo] Change API 2022-12-26 17:01:08 -07:00
Matthias Clasen 767bdd43a6 wip: Add libharfbuzz-cairo
This library will provide integration with cairo
for font rendering.
2022-12-26 17:01:08 -07:00
Behdad Esfahbod c3a8c6bb8b [paint] More docs 2022-12-26 15:38:24 -07:00
Behdad Esfahbod ae208963df Add hb-limits.hh 2022-12-26 12:30:39 -07:00
Matthias Clasen 5f5fa4b219 [ft-colr] Limit the size of the graph we follow
This adds the same check that we already do in
the native implementation.
2022-12-26 12:20:04 -07:00
Matthias Clasen ea2892c30e [paint] Limit the size of the graph we follow
In addition to checking the depth, also count
the number of edges in the graph we've followed,
and give up after 1024.
2022-12-26 12:20:04 -07:00
Matthias Clasen 5dd69d81b0 Fix hb_ot_color_has_paint
We must no access v1 data without checking that
version is 1. A bit of a trap.
2022-12-26 11:29:26 -07:00
Matthias Clasen b8f2281c6c Add hb_ot_color_glyph_has_paint 2022-12-26 11:29:26 -07:00
Behdad Esfahbod 79c5bb92ce [ft] Work around a freetype bug 2022-12-24 12:57:33 -07:00
Behdad Esfahbod fa1cf15e5d [ft-colr] Whitespace 2022-12-24 11:56:23 -07:00
Behdad Esfahbod 5343eac161 [ft-colr] Minor use context instead of direct access 2022-12-24 11:53:43 -07:00
Behdad Esfahbod 0b6468b820 [ft-colr] Minor 2022-12-24 11:50:57 -07:00
Behdad Esfahbod 1c595ec17f [paint-extents] Lazy-load paint_extents funcs 2022-12-24 11:40:44 -07:00
Behdad Esfahbod 4280ed290d [paint-extents] Add missing file 2022-12-24 11:38:32 -07:00
Behdad Esfahbod 2c0ab34d03 [paint-extents] Lazy-load draw-funcs 2022-12-24 11:37:59 -07:00
Behdad Esfahbod 11036ed71e [paint] Add hb-paint-extents.cc 2022-12-24 11:30:45 -07:00
Behdad Esfahbod 959996d709 [paint-extents] Namespace 2022-12-24 11:22:16 -07:00
Behdad Esfahbod 62bd26dda3 [ft] Pick largest bitmap size 2022-12-24 11:01:32 -07:00
Behdad Esfahbod d35dff020f [cbdt] Remove extra clip 2022-12-24 10:59:17 -07:00
Behdad Esfahbod f70c5d6f0d [paint] Continue returning bool from paint_image()
6ccbfabd4f (commitcomment-94127307)
2022-12-24 10:56:06 -07:00
Behdad Esfahbod 6ccbfabd4f [paint] Return bool from paint_image()
Fixes https://github.com/harfbuzz/harfbuzz/issues/3974
2022-12-24 10:44:25 -07:00
Behdad Esfahbod 346331d375 [ft] Fix negative xscale 2022-12-24 10:35:26 -07:00
Behdad Esfahbod 9376e7a930 [ft] Remove stale TODO 2022-12-24 10:31:30 -07:00
Behdad Esfahbod a7fd48c408 [ft] Comment 2022-12-24 10:28:41 -07:00
Behdad Esfahbod bb45ba2f9f [ft] Fix negative y-scale 2022-12-24 10:25:43 -07:00
Behdad Esfahbod aba2063c22 [paint-extents] Comments 2022-12-24 10:15:47 -07:00
Behdad Esfahbod 988ca459f3 [paint-extents] Minor refactor 2022-12-24 10:12:35 -07:00
Behdad Esfahbod f8bf98798d [paint-extents] Refactor code 2022-12-24 10:11:04 -07:00
Matthias Clasen 4816be9ab5 Work around cairo limitations
If we just draw an image, cairos recording surface
complains that it is unbounded. Its not true of course.

To make things work, clip to the extents.
2022-12-24 09:16:29 -05:00
Behdad Esfahbod f7eebc397c [paint-extents] Shorten enum addressing 2022-12-23 18:52:46 -07:00
Behdad Esfahbod 0110bdb3ea [paint-extents] Streamline extents_t more 2022-12-23 18:17:05 -07:00
Behdad Esfahbod 9f3e050b99 [paint-extents] Streamline extents_t 2022-12-23 18:15:21 -07:00
Behdad Esfahbod 0d129ae308 Fix warning 2022-12-23 18:00:38 -07:00
Behdad Esfahbod 73e48b9357 [colr] Push clipbox or computed clip 2022-12-23 17:55:09 -07:00
Behdad Esfahbod 02684751bd [paint-extents] Clean up 2022-12-23 17:33:13 -07:00
Behdad Esfahbod dbea503a38 [colr] Return true extents 2022-12-23 17:28:46 -07:00
Behdad Esfahbod f9c2e30e01 [paint-extents] Better handle empty glyphs 2022-12-23 17:13:35 -07:00
Matthias Clasen 885dbcfba0 Skip empty outlines 2022-12-23 19:07:32 -05:00
Behdad Esfahbod bd61e645ff [paint-extents] Use hb_min/hb_max 2022-12-23 16:59:12 -07:00
Behdad Esfahbod 56a48f8b0a [paint] Don't use extents in hb-view
Let the clipbox do its magic. Currently works for ft backend only.
2022-12-23 16:45:04 -07:00
Matthias Clasen 79229cea17 Get outline extents manually 2022-12-23 18:41:24 -05:00
Behdad Esfahbod 47c896f004 [paint-extents] Hook it up, kinda 2022-12-23 16:25:36 -07:00
Behdad Esfahbod 7fbaaebe8b [paint-extents] Finish off
Untested and unused.
2022-12-23 15:57:05 -07:00
Behdad Esfahbod 8ca78d1520 [paint-extend] More 2022-12-23 15:21:48 -07:00
Behdad Esfahbod 23a2d4dbab [paint-extents] More 2022-12-23 15:11:45 -07:00
Behdad Esfahbod d7435b1009 [paint-extents] Flesh out more 2022-12-23 15:05:30 -07:00
Behdad Esfahbod c37a1eadef [paint-extents] Flesh out some more 2022-12-23 14:57:12 -07:00
Behdad Esfahbod 268d8b7ded [paint-extents] Start out 2022-12-23 14:45:56 -07:00
Behdad Esfahbod d9875ddc9d [ft-colr] Add depth counter 2022-12-23 13:37:59 -07:00
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