Commit Graph
14667 Commits
Author SHA1 Message Date
Behdad Esfahbod 99d1a4832d [harfruzz] Tighten check-symbols 2025-05-06 11:03:56 -06:00
Behdad Esfahbod e71bcaa873 [harfrbuzz] s/harfRuzz/HarfRuzz/g 2025-05-06 10:54:16 -06:00
Behdad Esfahbod 8fa6c9a39e [harfruzz] Fix lifecycle management
In the ugliest way. I'll wait for someone familiar with Rust to
suggest proper way to do it.

We don't cache the shape-plan, so this is much slower than the
HarfBuzz native shaper.
2025-05-06 10:38:47 -06:00
Behdad Esfahbod 790506ef51 [harfruzz] Handle buffer allocation failure 2025-05-06 10:38:47 -06:00
Behdad Esfahbod a78d2f27ab [harfruzz] Cache Face 2025-05-06 10:38:47 -06:00
Behdad Esfahbod b50b5a0db1 [harfruzz] Scale, and set segment properties 2025-05-06 10:38:47 -06:00
Behdad Esfahbod 4e98288a72 [harfruzz] Remove stale comment 2025-05-06 10:38:47 -06:00
Behdad Esfahbod cc5b19a435 [harfruzz] Ignore public symbols
I don't know how to hide these from the Rust side.
2025-05-06 10:38:47 -06:00
Behdad Esfahbod 1b3b2c2405 [rust] Remove unnecessary use 2025-05-06 10:38:47 -06:00
Behdad Esfahbod c1eb04e843 [rust] Move global allocator to lib.rs 2025-05-06 10:38:47 -06:00
Behdad Esfahbod c25fddbafb [harfruzz] Add basic harfRuzz shaper 2025-05-06 10:38:47 -06:00
Behdad Esfahbod 71523a421e [fontations] Move code from fontations/lib.rs into rust/font.rs
Add a rust feature for enable font backend.

In anticipation of adding a shaper using harfRuzz.
2025-05-06 10:38:47 -06:00
Behdad Esfahbod 1c07f48bcb Fix build with HB_NO_DRAW and HB_NO_PAINT
Fixes https://github.com/harfbuzz/harfbuzz/issues/5313
Fixes https://github.com/harfbuzz/harfbuzz/issues/5316
2025-05-06 09:47:12 -06:00
Khaled Hosny 77c24e8a0e [check-*.py] Remove autotoolism
Instead of passing source dir and build dir to as envvars, pass
them directly as script arguments. The scripts also were supposed to be
able to run outsize of the build scripts, but this was broken since the
fallback when the envvars were not set was wrong.

The HBSOURCES and HBHEADERS are still passed as envvars since they are
long lists and might hit command line length limitation on some systems.
2025-05-06 13:17:13 +03:00
Khaled Hosny a5d4e7ba0d [check-static-inits.py] Cleanup 2025-05-06 12:50:28 +03:00
Khaled Hosny d403529211 [check-*.py] Format 2025-05-06 12:49:45 +03:00
Khaled Hosny 63cdd745ff 11.2.0 2025-04-28 15:56:32 +03:00
Behdad Esfahbod 47a73eab5c [coretext] Add a version check
Fixes https://github.com/harfbuzz/harfbuzz/issues/5300
2025-04-25 16:21:12 -06:00
Behdad Esfahbod 861b20b030 [coretext] Switch away from deprecated API 2025-04-25 09:31:19 -06:00
Behdad Esfahbod 441f3b68c4 [directwrite] Port off of deprecated API
https://github.com/harfbuzz/harfbuzz/pull/5299#issuecomment-2829435360
2025-04-25 09:27:40 -06:00
Behdad Esfahbod 5933468261 [shape] Only apply slant to shaping results if horizontal 2025-04-23 20:56:32 -06:00
Behdad Esfahbod 52f9ca11d6 [check-symbols] Ignore more Rust symbols 2025-04-23 20:05:59 -06:00
Behdad Esfahbod ff0b1f5497 [font] Comment 2025-04-23 19:28:54 -06:00
Behdad Esfahbod e71a88d318 [paint] Fix crash 2025-04-23 19:17:31 -06:00
Behdad Esfahbod 6688a03ce2 [sbix/CBDT] Fix memory leaks in error case 2025-04-23 19:06:52 -06:00
Behdad Esfahbod 29d9a7a5dd [font] Fix get_glyph_extents() logic 2025-04-23 18:55:52 -06:00
Behdad Esfahbod 40b03fdb88 [ft] Don't request NO_BITMAP in paint() 2025-04-23 18:33:14 -06:00
Behdad Esfahbod 01f485fdcf [cairo] Adjust draw/paint 2025-04-23 18:23:51 -06:00
Behdad Esfahbod 17238eae3d [ot/ft/fontations] Port to new _or_fail of draw/paint APIs 2025-04-23 18:23:51 -06:00
Behdad Esfahbod 38db1facf2 [paint] Change back return type of paint_glyph() to void
Add new "_or_fail" variants of draw_glyph and paint_glyph

New API:
+hb_font_draw_glyph_or_fail_func_t
+hb_font_paint_glyph_or_fail_func_t
+hb_font_funcs_set_draw_glyph_or_fail_func()
+hb_font_funcs_set_paint_glyph_or_fail_func()
+hb_font_draw_glyph_or_fail()
+hb_font_paint_glyph_or_fail()

Deprecated API:
-hb_font_draw_glyph_func_t
-hb_font_paint_glyph_func_t
-hb_font_funcs_set_draw_glyph_func()
-hb_font_funcs_set_paint_glyph_func()
2025-04-23 18:23:51 -06:00
Behdad Esfahbod eb226383a0 [font] Synthesize glyph extents if needed
See code for logic.

Fixes https://github.com/harfbuzz/harfbuzz/issues/5273
2025-04-23 01:20:48 -06:00
Behdad Esfahbod e78310bfaa [paint] Change return type to bool, and return false for outline glyphs
It was impossible to get synthetic bold/slant correctly with the
previous API. This is a minor API break, but one I'm willing to take.
2025-04-23 01:02:15 -06:00
Behdad Esfahbod a23021e168 [COLRv1] Simplify paint_glyph()
Pass a non-synthetic font to the client, so they don't have
to worry about it.

The only issue left, is that now when paint_glyph() paints
an outline glyph (not color glyph), it would be double-slanted.

I'm leaning towards removing painting of outline glyphs from
the paint API and change the paint API to return a boolean.
2025-04-23 00:43:56 -06:00
Behdad Esfahbod 023e229470 [cairo] Solely use public API
I actually don't know how hb-font.hh is pulled into hb-cairo.cc.
I can't figure it out!
2025-04-22 23:09:47 -06:00
Behdad Esfahbod 6f6d6e8c86 [cairo] Remove redundant include 2025-04-22 23:04:31 -06:00
Behdad Esfahbod 5d9cff80ec [font] Move is_synthetic() to .hh 2025-04-22 23:01:28 -06:00
Behdad Esfahbod b9a1cd7011 [cairo] Use hb_font_is_synthetic() to speed up clip_glyph 2025-04-22 22:54:34 -06:00
Behdad Esfahbod bf28ca5f5c [paint] Mention hb_font_is_synthetic() 2025-04-22 22:53:09 -06:00
Behdad Esfahbod 853720ead4 [font] Add hb_font_is_synthetic()
New API:
+hb_font_is_synthetic()
2025-04-22 22:51:40 -06:00
Behdad Esfahbod 4c0a925ee9 [paint] Document clip_glyph vs synthetic shapes hurdle 2025-04-22 22:36:28 -06:00
Behdad Esfahbod 01e9c77e30 [COLR] Fix clip-box
Was slanting it. Was wrong with new code.
2025-04-22 21:57:02 -06:00
Behdad Esfahbod c57f49f772 [ft] Return false from get_extents for COLR glyphs 2025-04-22 21:32:35 -06:00
Behdad Esfahbod fcbe76760f [fontations] Return false from get_extents for COLR glyphs 2025-04-22 21:32:31 -06:00
Behdad Esfahbod e9ae6cc524 [cairo] Draw unsynthetic glyphs during COLRv1
Fixes the double-slanting issue of COLRv1 glyphs.
2025-04-22 21:14:50 -06:00
Behdad Esfahbod 395bc27659 [font] Fix draw_glyph default implementation to new scheme 2025-04-22 21:05:53 -06:00
Behdad Esfahbod a69713b520 [color] Move slanting to font layer
COLRv1 is still being double-slanted. Investigating.
2025-04-22 21:02:45 -06:00
Behdad Esfahbod 9dbb84e6fd [font] Don't apply synthetic bold/slant to parent
Fixes https://github.com/harfbuzz/harfbuzz/issues/5274
2025-04-22 20:25:44 -06:00
Behdad Esfahbod 1a9e21758d [font/draw] Move slanting to font layer
I moved it to the draw layer in 11.0.0; That was a bad design:
font-funcs should NOT be responsible for synthetic bold & slant.

This design reverts that and makes the font layer apply it,
using a recording.

This is a minor API change from 11.0.0 since hb_draw_state_t::slant_xy
which was introduced in 11.0.0, is removed now. I believe no client
had started using it. It was only relevant to other font-funcs draw
implementations.
2025-04-22 19:52:21 -06:00
Behdad Esfahbod 9ef82f8926 [font] Embolden font_v_extents 2025-04-22 19:35:34 -06:00
Behdad Esfahbod 5ebd740ee8 [font] Move font_h_extents emboldening to font layer 2025-04-22 19:29:02 -06:00