Repository navigation
Conversation
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
mikernet
added a commit
to Singulink/uno
that referenced
this pull request
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: closes #26670
PR Type:
🐞 Bugfix
What changed? 🚀
On iOS with the WebGPU renderer (and likely macOS and Mac Catalyst, which use the same scaler), every glyph of a font with a
COLRtable drew black, including the glyphs without colour layers (#26670). For example, all the monochrome icons of an icon font that has a few COLR colour icons drew black, whatever theForeground.Cause: Skia's CoreText scaler treats the font's colour-glyphs trait, which CoreText sets for the whole font when it has
COLR, as applying to every glyph, soSKFont.GetGlyphPathgives no path for any glyph of the font (neverRequestPathinSkScalerContext_Mac).SkiaFont.BuildGlyphRuntook each of them for a colour glyph and rasterized it withRasterizeColorGlyph, whose defaultSKPaintis black. DirectWrite and FreeType outline the plain glyphs, so other platforms were unaffected. The Skia renderer draws text throughSKCanvas, so its text drew correctly.Fix: on Apple, for a font whose colour glyphs come from
COLRalone (nosbix,CBDTorSVG),SkiaFontFacenow builds aSkiaColrOutlineSourcethe first time a glyph outline is asked for:COLRcolours, read from its v0 base glyph records and v1 base glyph list. Those still go toRasterizeColorGlyphas before;COLR,CPALandDSIG, built in memory and loaded as anSKTypefaceat the original's variation position (exceptopsz, which CoreText sets from the text size).SkiaFonttakes the outlines of all other glyphs from it, so they fill with the text's brush.If the
COLRtable is malformed or of an unknown version, or the copy doesn't load as a font withoutCOLR(for example if CoreText resolves it back to an installed font), there is no source and the font draws as before.Cost: on Apple, per font face with
COLRalone (a face is a font file at one weight, stretch and style): the copy (about the size of the font, in native memory) and an 8 KB glyph bitset, built once on first use, plus one extraSKFontper size that draws such a font. Other platforms and fonts are unchanged.Tests (runtime tests, Skia):
Given_SkiaColrOutlineSourceruns on every Skia platform with a small self-made test font (colr-mixed-glyphs.ttf, 1.2 KB, made with fontTools (script below): two plain glyphs, a COLR v0 and a COLR v1 colour glyph, each colour glyph with a monochrome fallback outline). It checks the colour glyphs read fromCOLRand the outlines of the copy.Given_Geometry.ColrFont_PlainGlyph_Outlines_And_ColorGlyph_Rasterizes_To_Imagechecks thatBuildGlyphRungives an outline for a plain glyph of the test font and an image for a colour glyph. Without the fix it fails on Apple platforms only.Validation:
Given_Geometry,Given_IFont_AlternativeBackendandGiven_GlyphRunRenderer. TheGiven_SkiaColrOutlineSourcetests fail when v0 or v1 glyphs aren't read, or when the copy keepsCOLR.SkiaColrOutlineSourceread colour glyphs 3 and 4, and the copy's outlines had the bounds the tests expect. The runtime tests themselves were not run on iOS. An app build with the fix also draws an icon font with COLR glyphs correctly on an iPhone. These iOS checks ran before the last review changes (an early return for an empty COLR v1 base glyph list, a spec-correctheadchecksum in the copy, comments). Both were checked on Windows against the same code: the empty list now gives colour glyphs instead of no source, and fontTools accepts the copy's checksums.Test font generator (Python, fontTools)
PR Checklist ✅
Screenshots Compare Test Runresults.