aboutsummaryrefslogtreecommitdiffstats
path: root/text/shape-build.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-28 13:54:31 +0100
committereunhhu <[email protected]>2026-09-28 13:54:31 +0100
commit88e16d6f971287afd0ab15d1cde73608cde43b1b (patch)
tree28a3108bb10d1b5de9e9c5a3ca50b73660d82155 /text/shape-build.h
parenta914fce69d3f2b12422d214380bfe6a086a7718c (diff)
downloadvega-88e16d6f971287afd0ab15d1cde73608cde43b1b.tar.gz
vega-88e16d6f971287afd0ab15d1cde73608cde43b1b.zip
Shape Hangul, kern with kern tables, and place marks without GPOS, as HarfBuzz does
The planner now picks who positions as HarfBuzz 10.2 does: GPOS, the old kern table when GPOS has no kern feature, and marks placed by combining class and ink boxes when there is no GPOS; the Hangul shaper composes syllables the font has whole, takes apart those it lacks into jamo for ljmo, vjmo and tjmo, and moves tone marks before their syllable. The section grows to an 80-byte header (the kern table, and each glyph's ink box when a plan places marks without GPOS) and 88-byte plans (the kern mask, the jamo masks). Kern tables are applied pair subtable by pair subtable with HarfBuzz's own binary search; state machines, class subtables and cross-stream kerning, which no installed font has, are refused. The check spells Hangul syllables every way text does. Every installed font Vega accepts shapes as HarfBuzz does (209 fonts, 1,520 plans, a thousand runs each), and the fonts refused before at 20,000 runs a plan: Noto Sans CJK KR and Baekmuk for Hangul, IPA Gothic and Noto Mono for marks without GPOS, FreeSans, FreeSerif, Liberation and DejaVu Sans ExtraLight for kern tables, Unifont's Latin, Greek, Cyrillic, Hebrew and Hangul.
Diffstat (limited to 'text/shape-build.h')
-rw-r--r--text/shape-build.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/text/shape-build.h b/text/shape-build.h
index dd93177..ad92085 100644
--- a/text/shape-build.h
+++ b/text/shape-build.h
@@ -10,12 +10,11 @@
typedef struct { unsigned char *bytes; size_t size; } VegaSection;
/* A section for face: plans for each script (ISO 15924 tags) and both
- * directions, compiled as
- * HarfBuzz's planner compiles it. Refuses a script HarfBuzz shapes with a
- * shaper other than the default, Arabic and Hebrew ones, or a font that
- * needs what those do without GPOS (fallback positioning, 'kern' tables,
- * AAT). glyphs, when given, gets every glyph shaping can reach from codes
- * (for their outlines). */
+ * directions, compiled as HarfBuzz's planner compiles it. Refuses a script
+ * HarfBuzz shapes with a shaper other than the default, Arabic, Hebrew and
+ * Hangul ones, and a font with AAT tables (morx, kerx, trak) or a kern
+ * table of state machines. glyphs, when given, gets every glyph shaping can
+ * reach from codes (for their outlines). */
bool vega_shaping_compile(hb_face_t *face, const uint32_t *scripts, size_t script_count, const uint32_t *codes,
size_t code_count, VegaSection *out, hb_set_t *glyphs, char *error, size_t error_size);