Fix missing thin outlines in BDN XML / Blu-ray SUP export#12372
Merged
Conversation
At small outline widths (1-2) the outline vanished on horizontal glyph edges in BDN XML / Blu-ray SUP export, depending on font and font size. Two causes: the stroke was centered on the glyph edge, so only half the requested width was outside the glyph and the fill drawn on top covered the rest; and stroking through the hinted glyph rasterizer snapped horizontal edges to the pixel grid, letting the fill wash out what little outline remained. Stroke the raw shaped glyph path with doubled width instead (the fill covers the inner half, so the visible outline matches the requested width), and disable hinting on export fonts so fill and outline stay registered. Fixes #12206 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 11, 2026
Merged
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.
Fixes #12206
At small outline widths (1–2) the outline vanished on horizontal glyph edges (top of T, E, H, …) in image-based exports, varying with font and font size — e.g. Franklin Gothic/Arial at size 44 lost top outlines while other sizes lost horizontal or vertical ones. v4.0.16 rendered the same settings correctly.
Root cause
Two compounding problems in
ImageRenderer.RenderTextToCanvas:outlineWidth / 2extended outside the glyph — and the fill drawn on top covered the inner half. At width 1, only half a pixel of outline could ever be visible.rgba(169,169,169,130)) instead of a black outline. Whether anything survives depends on where the cap-height edge lands on the pixel grid, which explains the font/size dependence reported in the issue.Fix
SKPath(viaSKShaperglyph positions, preserving HarfBuzz shaping) and stroke the path directly, bypassing the hinted glyph rasterizer.The same treatment is applied to the shadow outline pass. Glyphs without outline paths (e.g. color emoji) simply get no stroke; fills are unchanged.
Verification
Headless harness calling
ImageRenderer.GenerateBitmapwith white text / black outline width 1, "THE HEIGHT", Arial/Tahoma/Helvetica at sizes 44/45/53. Per-column check for outline pixels above the topmost fill pixel:Visual inspection at 4× zoom confirms a clean, uniform 1px outline on all edges, and a styled sample (bold/italic/font color + shadow + outline) renders correctly.
LibUiLogicTests(6) andSeConvTests(217) pass.🤖 Generated with Claude Code