Skip to content

Remove vertical ascent compensation and update test references#505

Merged
JimBobSquarePants merged 2 commits intomainfrom
js/linemetrics
Mar 4, 2026
Merged

Remove vertical ascent compensation and update test references#505
JimBobSquarePants merged 2 commits intomainfrom
js/linemetrics

Conversation

@JimBobSquarePants
Copy link
Copy Markdown
Member

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

This pull request refines the vertical glyph layout logic in TextLayout.cs by removing first-line ascent compensation for vertical and vertical-mixed text flows. This change prevents unwanted extra spacing before the first glyph, ensuring more visually consistent vertical text rendering. Additionally, several reference images for composed character vertical rendering tests have been updated to reflect the improved layout.

Vertical layout logic improvements:

  • Removed first-line Y ascent compensation in both LayoutLineVertical and LayoutLineVerticalMixed, restricting baseline adjustment to X-origin block alignment only. This prevents unnecessary leading space above the first glyph in vertical text columns. [1] [2]
  • Updated glyph advance calculations to exclude extra ascent, ensuring advances are based solely on the actual glyph metrics. [1] [2] [3] [4] [5]

Test reference updates:

  • Updated output images for composed character vertical rendering tests to match the new, corrected layout behavior. [1] [2] [3] [4]### Prerequisites

@JimBobSquarePants JimBobSquarePants merged commit c5043c1 into main Mar 4, 2026
9 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/linemetrics branch March 4, 2026 04:37
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83%. Comparing base (8d3c065) to head (933f4c1).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #505   +/-   ##
=====================================
  Coverage     83%     83%           
=====================================
  Files        274     274           
  Lines      19184   19171   -13     
  Branches    2719    2717    -2     
=====================================
- Hits       16081   16071   -10     
+ Misses      2426    2424    -2     
+ Partials     677     676    -1     
Flag Coverage Δ
unittests 83% <100%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant