aboutsummaryrefslogtreecommitdiffstats
path: root/text/test-layout.c
Commit message (Collapse)AuthorAgeFilesLines
* Set text in a stack of fonts: each grapheme cluster in the first that has iteunhhu2026-09-281-1/+2
| | | | | | | | | | | | | | 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.
* Set paragraphs into lines: bidi, script runs, shaping, line breaking, visual ↵eunhhu2026-09-281-0/+188
order text/layout.c puts the checked parts together: a paragraph's levels, scripts resolved for Common and Inherited characters, break opportunities, one shaping to measure, lines broken at the last opportunity that fits (trailing spaces hang, and a line that shapes wider than measured backs off), then per line L1, runs of one level and one script shaped again, the runs in L2's order and their glyphs placed. test-layout checks 30,000 random mixed-script paragraphs: lines cover the text, mandatory breaks end lines, lines fit when they can, and glyphs come in the order UAX #9 gives the characters. vega-symbols paragraph draws a layout through the symbol file's glyphs.