From a4ca275ad1b5edc15474407e2852f8fe9abaac4e Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 28 Sep 2026 15:52:13 +0100 Subject: 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. --- text/shape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'text/shape.c') diff --git a/text/shape.c b/text/shape.c index c9b8c0c..0ea2968 100644 --- a/text/shape.c +++ b/text/shape.c @@ -584,7 +584,7 @@ static bool cased_or_other_letter_or_space(unsigned c) { /* HarfBuzz's Default_Ignorable: Unicode's, less the Hangul fillers and a * few others that fonts draw. */ -static bool default_ignorable(uint32_t ch) { +bool vega_default_ignorable(uint32_t ch) { uint32_t plane = ch >> 16; if (!plane) { switch (ch >> 8) { @@ -651,7 +651,7 @@ static void init_unicode_props(Info *info, uint32_t *scratch) { unsigned gen = vega_category(u), props = gen; if (u >= 0x80) { *scratch |= HAS_NON_ASCII; - if (default_ignorable(u)) { + if (vega_default_ignorable(u)) { *scratch |= HAS_DEFAULT_IGNORABLES; props |= UPROPS_IGNORABLE; if (u == 0x200C) props |= UPROPS_ZWNJ; -- cgit v1.2.3