Commit Graph

12040 Commits

Author SHA1 Message Date
Behdad Esfahbod a45bf5b04c [ft-colr] Require FreeType >= 2.11.1
Fixes https://github.com/harfbuzz/harfbuzz/issues/3989
2022-12-30 11:19:36 -07:00
Behdad Esfahbod ceba6c9a90 [config] Sort 2022-12-30 10:44:34 -07:00
Behdad Esfahbod f2a6643fc1 [cairo] Docs 2022-12-29 18:00:39 -07:00
Behdad Esfahbod bfce4a6046 [cairo] Remove error path
Assume cairo API always returns non-NULL.
2022-12-29 10:43:37 -07:00
Behdad Esfahbod b1de87b7f1 [cairo] Document get_glyphs() arguments as inout 2022-12-29 10:41:35 -07:00
Matthias Clasen 89bd7f64ae [hb-cairo] Small docs fixes 2022-12-29 10:09:50 -07:00
Khaled Hosny c9206df166 [hb-cairo] Fix warnings 2022-12-29 10:07:59 -07:00
Khaled Hosny 723e7a48e2 [docs] Small fixes 2022-12-29 15:49:21 +02:00
Matthias Clasen 67456a7a02 [ft] Some more docs clarifications 2022-12-28 11:14:12 -07:00
Matthias Clasen c612d068e8 [ft] Clarify docs around faces too 2022-12-28 11:14:12 -07:00
Matthias Clasen 4dc955bb46 [ft] Clarify docs
Add some clarifications on what fonts these apis
work with.
2022-12-28 11:14:12 -07:00
Matthias Clasen ef20b5e66f Typo fix 2022-12-28 08:51:27 -05:00
Behdad Esfahbod 81c04b0c21 [cairo] Add separate x/y scale factors 2022-12-27 17:46:25 -07:00
Behdad Esfahbod 50b7fff0c6 [cairo] Fix text_to_glyphs scale factor 2022-12-27 17:37:42 -07:00
Behdad Esfahbod 8f62b8c6bb [cairo] Fix cluster conversion 2022-12-27 17:26:39 -07:00
Behdad Esfahbod 326db329f8 [directwrite] Simplify delete
Fixes https://github.com/harfbuzz/harfbuzz/issues/3981
2022-12-27 14:38:17 -07:00
Behdad Esfahbod 7b0f9abc89 [paint] Add back "remote-control" API
This reverts commit f146299a40.
2022-12-27 12:38:49 -07:00
Behdad Esfahbod 43b0364eda [paint] Document composition modes 2022-12-27 12:29:53 -07:00
Behdad Esfahbod ec9e8a5993 [paint] Document extend modes. 2022-12-27 12:22:56 -07:00
Behdad Esfahbod fa3fa9422d [cairo] Doc 2022-12-27 11:54:23 -07:00
Behdad Esfahbod bbf6f42d3b [cairo] TODO 2022-12-27 11:50:06 -07:00
Behdad Esfahbod f9fc13287b [hb-cairo] Return hb_font_t* from init-func 2022-12-27 11:08:55 -07:00
Matthias Clasen d18903e443 Add def files for libharfbuzz-cairo 2022-12-27 11:00:23 -07:00
Behdad Esfahbod d88787b6ca [cairo] Add func to init fonts on creation
To set, for example, font-funcs.
2022-12-27 10:59:17 -07:00
Behdad Esfahbod c52bff2d61 [cairo] Hide internal symbols 2022-12-27 10:42:13 -07:00
Behdad Esfahbod 34aa8b0148 [cairo] Add to library tests 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 5fdfe6ae5d [cairo] Use hb_qsort 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 21573265e9 [cairo] More namespacing 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 84d1b00cd4 [cairo] More namespacing 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 8f16e98c1b [cairo] Namespace types 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 488be52467 [cairo] Try fix msvc build 2022-12-26 17:01:08 -07:00
Behdad Esfahbod c652e8e1b7 [cairo] Docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 23980d3cb2 [cairo] Docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod f5fd46aa3d [cairo] Docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 36482b684b [cairo] Err, utf8_clusters 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 48cb25dd36 [cairo] Implement (untested) text_to_glyphs callback 2022-12-26 17:01:08 -07:00
Behdad Esfahbod c38abcb3fb [cairo] Add x,y args to get_glyphs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 847ed69547 [cairo] Reorder arguments of a call 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 726cfffc0d [cairo] Doc fix 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 0fe0cdf066 [cairo] Document scale-factor business 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 4e3e879c1c [cairo] Add [sg]et_scale_factor 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 186bfa99f5 [cairo] Make scale_factor a double 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 120419e180 [hb-view] Fix autotools build 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 650a46d919 [cairo] Fix autotools build 2022-12-26 17:01:08 -07:00
Matthias Clasen b417ac8a19 Try to fix autotools build 2022-12-26 17:01:08 -07:00
Matthias Clasen 8d0e18b51d [cairo] More details in the docs
Mention slant as well.
2022-12-26 17:01:08 -07:00
Matthias Clasen 30605e09b9 [cairo] Mention variations in the docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod c4f7563f81 [cairo] Fix build 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 7a52ac4bbe [cairo] Set variations 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 4be4e017fc [cairo] Make font immutable 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 70babda6ad [cairo] docs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 1c67180d6d [cairo] Add typed destroy funcs 2022-12-26 17:01:08 -07:00
Behdad Esfahbod 43da222e6d [cairo] Rename 2022-12-26 17:01:08 -07:00
Behdad Esfahbod cf001f6ec7 [cairo] Add constructor from hb_face_t 2022-12-26 17:01:08 -07:00
Matthias Clasen 2e897cc90b Add a pc file for harfbuzz-cairo 2022-12-26 17:01:08 -07:00
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