Skip to content

Write a glyph outline's coordinates through NumericString::decimal() (#76) - #305

Merged
jakejackson1 merged 1 commit into
feature/76-svgfrom
feature/76-glyph-outline-numbers
Sep 22, 2026
Merged

jakejackson1 merged 1 commit into
feature/76-svgfrom
feature/76-glyph-outline-numbers

Conversation

@jakejackson1

@jakejackson1 jakejackson1 commented Sep 22, 2026

Copy link
Copy Markdown
Member

Part of #76. Stacked on #300, which adds NumericString::decimal().

GlyphOutline::number() trimmed a coordinate to three places by hand, exactly as NumericString::decimal($value, 3) does for the COLR and SVG glyph renderers and Image\Svg\Path. It now calls decimal(). Its shortcut for whole font units, a simple glyph's points, is gone: #300 moved it into decimal(), where every caller gets it. The output is unchanged: every snapshot and outline test still passes.

Calling the shared helper costs about 25 µs per distinct glyph outline (measured over 1000 Noto Emoji glyphs). Outlines are cached per document, so a page of emoji pays well under a millisecond.

Tests

  • GlyphOutlineTest: a composite scaled by about a third draws its fractional points to three places (166.656 233.319).

🤖 Generated with Claude Code

…76)

GlyphOutline::number() repeated NumericString::decimal($value, 3) by hand: three places, trailing
zeros trimmed, no -0. It now calls decimal(), which also writes a whole number as it is, as
number()'s own shortcut for a simple glyph's points did. The output is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jakejackson1
jakejackson1 force-pushed the feature/76-glyph-outline-numbers branch from 563b922 to 93ec1b8 Compare September 22, 2026 03:51
@jakejackson1
jakejackson1 merged commit bbbb65a into feature/76-svg Sep 22, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-upstream-pr enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant