Repository navigation
Land textLength and baselines (#221, #222) on main - #223
Merged
Merged
Conversation
textLength and lengthAdjust are parsed on <text> and <tspan>; a negative or invalid length (inherit) is ignored. Each element's characters are fitted innermost first, as plain Swift over the shaped advances: lengthAdjust="spacing" spreads the difference over the space between them, and "spacingAndGlyphs" scales their advances, the space between them and their glyphs. The text after a fitted tspan moves on, by the gap after its last character too, as resvg does. An element whose characters a descendant already fitted, or that starts a new chunk within itself, keeps its natural length. Scaled glyphs are a GlyphRun with scaleX, stretched about each glyph's origin when its outlines are drawn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dominant-baseline (inherited) and alignment-baseline (not inherited, overriding it for its own element) take every common value: auto, alphabetic, middle, central, hanging, mathematical, ideographic, text-before-edge and text-after-edge, with the CSS Inline 3 and SVG 1.1 aliases (text-top, text-bottom, before-edge, after-edge, baseline, use-script; no-change and reset-size keep the parent's). Each comes from the font's ascent, descent and x-height in makeYOffset, as resvg derives them. The sign of hanging, which lifted the text instead of hanging it, is fixed. baseline-shift applies to tspans: sub and super from the font's OS/2 script offsets, lengths, and percentages of the font-size they are declared at. Shifts of nested tspans add up; baseline adds nothing, and inherit takes the parent's value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #223 +/- ##
==========================================
+ Coverage 95.24% 95.30% +0.06%
==========================================
Files 292 294 +2
Lines 30825 31129 +304
==========================================
+ Hits 29360 29669 +309
+ Misses 1465 1460 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
#221 (
textLength/lengthAdjust) and #222 (baselines andbaseline-shift) were stacked on #220. They merged into their base branches rather than intomain:claude/text-spacing;claude/text-length.So
mainhas only #220.claude/text-length(5c50f02) contains both: 7633c35 (#221) and a5364d5 (#222), with #222's merge commit on top. This PR brings them ontomainunchanged; the commits are the ones already reviewed in #221 and #222.main(3a92842, which includes Make concurrentFillsRunOnce deterministic #219 and Shape text once and lay out letter-spacing and word-spacing in Swift #220).🤖 Generated with Claude Code