aboutsummaryrefslogtreecommitdiffstats
path: root/text/shape.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-28 16:07:05 +0100
committereunhhu <[email protected]>2026-09-28 16:07:05 +0100
commitcf6bcf8697589d2a6fc3c6d98bc52bf7eb1ea4ae (patch)
tree83e119a62ecbf8ee4fd5e799456fb6997cc36c5d /text/shape.h
parent960fa21762484d3014a6778a7673f15acf2d34bb (diff)
downloadvega-cf6bcf8697589d2a6fc3c6d98bc52bf7eb1ea4ae.tar.gz
vega-cf6bcf8697589d2a6fc3c6d98bc52bf7eb1ea4ae.zip
Carry variation sequences (cmap format 14)
The section now carries each sequence the font maps, a base and a selector, with the glyph HarfBuzz gives the pair (a default one's the base's own). As HarfBuzz's normalizer does, a sequence the font has becomes that one glyph, the two characters' clusters merged; one it lacks still passes on as two, the selector hidden. The header grows to 88 bytes for the table. The random check now mixes in the font's own sequences and stray selectors: 30000 runs over Noto Sans CJK's 14787 ideographic variation sequences are HarfBuzz's, and so are the installed fonts' and Noto's. HarfBuzz's suite: 5014 of 5199 the same, none different; what is left is what the build refuses and one run without a plan.
Diffstat (limited to 'text/shape.h')
-rw-r--r--text/shape.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/text/shape.h b/text/shape.h
index 3fe3ff8..690430c 100644
--- a/text/shape.h
+++ b/text/shape.h
@@ -41,6 +41,9 @@
* medi, fina, isol, rlig x3), u32
* size, then a GSUB table of just
* those lookups)
+ * u32 sequence_count, u32 offset (variation sequences, cmap format
+ * 14: u32 base, u32 selector, u32
+ * glyph; by base, then selector)
* Offsets are from the section's start. A plan (VEGA_PLAN_BYTES):
* u32 script (ISO 15924 as a tag: 'Latn'), u8 direction, u8 native
* direction (of its script; 0 when it has none), u8 shaper, u8 flags,
@@ -53,7 +56,7 @@
* A step, a lookup to run: u16 lookup index, u8 flags, u8 0, u32 mask; or
* a pause, where the shaper does its part: u16 VEGA_STEP_PAUSE, u8 which
* (VEGA_PAUSE_...), u8 0, u32 0. */
-enum { VEGA_SHAPING_HEADER = 80, VEGA_PLAN_BYTES = 144, VEGA_STEP_BYTES = 8, VEGA_PLAN_MASKS = 16,
+enum { VEGA_SHAPING_HEADER = 88, VEGA_PLAN_BYTES = 144, VEGA_STEP_BYTES = 8, VEGA_PLAN_MASKS = 16,
VEGA_PLAN_STAGES = 5 };
enum { VEGA_SHAPE_LTR = 1, VEGA_SHAPE_RTL = 2 };
enum { VEGA_SHAPER_DEFAULT, VEGA_SHAPER_ARABIC, VEGA_SHAPER_HEBREW, VEGA_SHAPER_HANGUL, VEGA_SHAPER_INDIC,
@@ -115,6 +118,8 @@ typedef struct {
uint16_t upem, glyph_count;
uint32_t cmap_groups, plan_count;
const unsigned char *cmap, *advances, *plans, *steps, *extents;
+ const unsigned char *sequences; /* variation sequences */
+ uint32_t sequence_count;
VegaTable gdef, gsub, gpos, kern;
VegaTable fallback; /* Arabic fallback shaping's lookups, a GSUB table */
uint32_t fallback_count;