aboutsummaryrefslogtreecommitdiffstats
path: root/text/shape.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-28 15:52:13 +0100
committereunhhu <[email protected]>2026-09-28 15:52:13 +0100
commita4ca275ad1b5edc15474407e2852f8fe9abaac4e (patch)
treef854692c7906627054a6b6ce98d8646bd678cb48 /text/shape.h
parent43a63f5aab95bf5fdfc4bce70286802854f7a07a (diff)
downloadvega-a4ca275ad1b5edc15474407e2852f8fe9abaac4e.tar.gz
vega-a4ca275ad1b5edc15474407e2852f8fe9abaac4e.zip
Set text in a stack of fonts: each grapheme cluster in the first that has it
vega_layout takes fonts in order of preference (VegaFonts). A grapheme cluster goes to the first font that has all its characters (default ignorables aside: shaping hides them); a cluster of Common and Inherited characters stays in the font before it when that one has it, so the spaces between Arabic words stay in the Arabic font; failing that, the first font with its first character, else the first font. Runs split where the font changes too. Positions are in the first font's units, a run's pen scaled as a whole so rounding does not add up. Callers can narrow what a font has (a symbol file holds only the glyphs its codes reach). vega_default_ignorable is shape.c's HarfBuzz 10.2 set, now public.
Diffstat (limited to 'text/shape.h')
-rw-r--r--text/shape.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/text/shape.h b/text/shape.h
index 9381754..cafa9b4 100644
--- a/text/shape.h
+++ b/text/shape.h
@@ -128,6 +128,9 @@ bool vega_shaping_open(VegaShaping *, const unsigned char *bytes, size_t size, c
void vega_shaping_close(VegaShaping *);
/* The font's glyph for a character, or 0. */
uint32_t vega_shaping_glyph(const VegaShaping *, uint32_t code);
+/* Default_Ignorable_Code_Point as HarfBuzz 10.2 has it: what shaping hides
+ * (a zero-width space in its place, or nothing). */
+bool vega_default_ignorable(uint32_t code);
/* A shaped glyph, as HarfBuzz gives it: in visual order (left to right),
* cluster the index of the first character it came from; each glyph is