Commit Graph

12694 Commits

Author SHA1 Message Date
Behdad Esfahbod d2998faad3
Merge pull request #3410 from harfbuzz/boring-expansion
[Boring Expansion] >64k loca & hmtx tables

This does two things:

The num-glyphs reported by the face now is the maximum reported by the maxp and that deduced from the length of the loca table; I think this is the right thing to do anyway; According to OpenType such loca tables are invalid.

The interpretation hmtx tables that have excessive bytes at the end, again, invalid according to OpenType, has changed. Previously we were interpreting those excessive bytes as extra lsb values. Now we interpret them as extra advance values, the last of which is repeated for all missing glyphs. Again, these are tables that are invalid according to OpenType, and the advances are for glyph indices beyond maxp table's num-glyphs.

The combined effect is that the font can have shapes and advances for gid's beyond the maxp limit of 64k. In fact, maxp table becomes optional.
2022-02-16 14:37:09 -06:00
Behdad Esfahbod 98079109e6 [ot-layout] Add +hb_ot_layout_get_horizontal_baseline_tag_for_script()
New API:
+hb_ot_layout_get_horizontal_baseline_tag_for_script()
2022-02-16 13:54:22 -06:00
Khaled Hosny cfa8cd7fb0 [autotools] Fix make distcheck
The test-draw.c can now optionally uses hb-ft, but automake file was not
passing FreeType cflags or libs to it.
2022-02-16 11:58:38 +02:00
Matthias Clasen 9909e33268 Improve docs for hb_ot_layout_get_ligature_carets
Add some relevant details to the documentation
for this function.

Fixes: #3168
2022-02-15 18:48:54 -06:00
Behdad Esfahbod a396543ae1
Merge pull request #3411 from harfbuzz/draw
[draw] Finish and release draw API
2022-02-15 18:47:55 -06:00
Behdad Esfahbod f567b55619 [face] Use max numGlyphs of maxp and loca 2022-02-15 18:26:43 -06:00
Behdad Esfahbod c8fd8c1337 [ot-face] Use core tables 2022-02-15 18:13:44 -06:00
Behdad Esfahbod 2a430790ad [machinery] Add "core table" machinery
To be used in subsequent commit; or tried anyway.
2022-02-15 17:53:33 -06:00
Behdad Esfahbod 67eb9acf79 [config] Add HB_NO_BORING_EXPANSION 2022-02-15 17:17:49 -06:00
Behdad Esfahbod 1bf588e28b [test/shape] Internal rename
Residual from e0d7060f80
2022-02-15 16:57:23 -06:00
Behdad Esfahbod d12c51e6e6 [ci] Rename configs-ci to configs-build
Since it doesn't run any tests.
2022-02-15 14:31:59 -06:00
Behdad Esfahbod 197ed8f592 [test/api] Fix leaks 2022-02-15 14:30:12 -06:00
Behdad Esfahbod 531c27d199 Fix build 2022-02-15 14:20:54 -06:00
Behdad Esfahbod 8b7ccc41c4 [hmtx] Implement [boring-expansion] >64k expansion
This implements https://github.com/be-fonts/boring-expansion-spec/issues/7
2022-02-15 14:15:12 -06:00
Behdad Esfahbod 379e526aa4 [test] Add test for current hmtx logic 2022-02-14 15:02:31 -06:00
Behdad Esfahbod 431c948ed7 [hmtx] Document 2022-02-14 14:13:04 -06:00
Behdad Esfahbod be4ddcc30b [hmtx] Rename internal num_advances to num_long_metrics 2022-02-14 14:12:07 -06:00
Behdad Esfahbod 622cbc485f [hmtx] Internal rename num_metrics to num_bearings 2022-02-14 14:09:40 -06:00
Behdad Esfahbod ed6d287d11 [ot-face] Load num-glyphs from `loca` table before `maxp`
Implements [boring-expansion] [maxp] Relax
https://github.com/be-fonts/boring-expansion-spec/issues/6
2022-02-14 13:52:30 -06:00
Behdad Esfahbod 93962977bc Remove return of void 2022-02-13 19:38:59 -06:00
Khaled Hosny c8b6036cf3 [meson] Update Cairo subproject
Fixes another color fonts issue.
2022-02-14 02:17:38 +02:00
Ebrahim Byagowi 6b75a30a73 [draw/test] Swap a freetype test case with a simpler one
As CI failure, apparently the my local freetype and CI one have different
result so let's switch the case with a simpler one just to test quadratic command
is emitted correctly.
2022-02-14 01:54:33 +03:30
Behdad Esfahbod ae223764a3 [test/draw] Typo 2022-02-13 15:39:14 -06:00
Ebrahim Byagowi 0429921c10 [draw/test] Add test for freetype callback
Let's have that part of the code also covered.
2022-02-14 00:18:13 +03:30
Ebrahim Byagowi d4588204e5 [draw/glyf] Emit empty contours
This makes it actually match freetype behaviour even though rasterizer
should filter such contours specially for stroking.

See https://github.com/harfbuzz/harfbuzz/pull/3411#discussion_r802283827 for the context.
2022-02-13 23:50:53 +03:30
Behdad Esfahbod 94517850dd [algs] Fix typo in hb_pair_t conversion operator
Fixes https://github.com/harfbuzz/harfbuzz/issues/2083
2022-02-13 13:39:26 -06:00
Khaled Hosny f942874fac [draw] Fix some introspection warnings 2022-02-13 13:21:15 -06:00
Khaled Hosny 2da6accda6 [meson] Update cairo submodule
To include the latest color glyph fixes
2022-02-13 13:21:15 -06:00
Behdad Esfahbod 0858463ac3 [draw/glyf] Don't skip empty contours of size 2
See:
https://github.com/harfbuzz/harfbuzz/pull/3411#discussion_r804988217
2022-02-13 13:21:15 -06:00
Khaled Hosny 0e357c504c [draw] Test scaling subfont differently from parent 2022-02-13 13:21:15 -06:00
Behdad Esfahbod 096121badb [util] Implement --sub-font
Internally creates a font at 2x and creates a sub-font from it...
2022-02-13 13:21:15 -06:00
Behdad Esfahbod 57aa8c3b3a [draw] Another try at a stable draw moveto semantic 2022-02-13 13:21:15 -06:00
Behdad Esfahbod 151f205819 [draw] Emit move_to immediately, like other operators 2022-02-13 13:21:15 -06:00
Khaled Hosny aca80a4a40 [draw] Add test for applying synthetic slant 2022-02-13 13:21:15 -06:00
Khaled Hosny 052fd2d8b9 [draw] Add test for hb_draw_move_to() etc 2022-02-13 13:21:15 -06:00
Behdad Esfahbod 640b6ffddd [util] Default font-funcs to 'ot' instead of 'ft' 2022-02-13 13:21:14 -06:00
Behdad Esfahbod 9cc9ffe352 [util/draw] If HB_DRAW is not set, choose depending on cairo version
If HB_DRAW=0, don't use it, if HB_DRAW=1, use it, if unset, choose depending
on cairo version
2022-02-13 13:21:14 -06:00
Behdad Esfahbod 22f2c78c28 [util/draw] Explicitly chain from render_color_glyph to render_glyph
This seems to be more robust.  See:
https://github.com/harfbuzz/harfbuzz/pull/3411#issuecomment-1033176635
2022-02-13 13:21:14 -06:00
Behdad Esfahbod 6a3dec357c [util/draw] Use hb-draw in hb-view only if HB_DRAW=1 2022-02-13 13:21:14 -06:00
Behdad Esfahbod 18b8a1c345 [draw] Fix conversion warnings 2022-02-13 13:21:14 -06:00
Behdad Esfahbod 6812f7ee1e [draw] Implement COLRv0 fonts 2022-02-13 13:21:14 -06:00
Khaled Hosny 74ebfc646a [meson] Update cairo subproject
Update to the current master branch so that is has
cairo_user_font_face_set_render_color_glyph_func().

I had to disable optimized builds on win[32|64] crossbuild setups
because they are now broken in the CI (something about cairo defining
_FORTIFY_SOURCE for optimized builds that MingW does not like).
2022-02-13 13:21:14 -06:00
Khaled Hosny 628847b5c8 [doc] Link to respective draw callback functions 2022-02-13 13:21:14 -06:00
Khaled Hosny 7245298e25 [doc] Document HB_DRAW_STATE_DEFAULT 2022-02-13 13:21:14 -06:00
Behdad Esfahbod 8f519d55ac [meson] Put back Experimental-API infrastructure
Just unused for now.
2022-02-13 13:21:14 -06:00
Khaled Hosny 8e892bdb54 [doc] Message draw documentation a bit 2022-02-13 13:21:14 -06:00
Khaled Hosny cf28821337 [meson] fix building with Cairo subproject
We can’t pass internal (subproject) dependency to cpp.has_function(), so
we manually hard-code the result.
2022-02-13 13:21:14 -06:00
Behdad Esfahbod cdf1cb35db [draw] Destroy callback data 2022-02-13 13:21:14 -06:00
Behdad Esfahbod 5c558586eb [util/draw] Apply slant to non-user-fonts as well 2022-02-13 13:21:14 -06:00
Behdad Esfahbod c56c13756b [draw] Document more 2022-02-13 13:21:14 -06:00