Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #525 +/- ##
=====================================
- Coverage 82% 82% -1%
=====================================
Files 305 305
Lines 21618 21628 +10
Branches 3196 3200 +4
=====================================
+ Hits 17875 17881 +6
- Misses 2932 2934 +2
- Partials 811 813 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Refactors text layout justification so it’s applied after line splitting, aiming to avoid justifying the final line and to ensure line metrics are recalculated at the right time.
Changes:
- Moves justification out of
TextLine.Finalize(...)and into a post-pass afterBreakLines()has produced all lines. - Updates
TextLine.Justify(...)to recalculate line metrics after modifying glyph advances. - Updates reference image outputs for text-justification tests (LFS pointers updated).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/SixLabors.Fonts/TextLayout.cs | Defers justification until after line breaking; adjusts finalize/justify responsibilities and metrics recalculation. |
| tests/Images/ReferenceOutput/TextJustification_InterWord_Vertical_400-direction_RightToLeft-TextJustification_InterWord.png | Updates expected rendered output (Git LFS pointer change). |
| tests/Images/ReferenceOutput/TextJustification_InterWord_Vertical_400-direction_LeftToRight-TextJustification_InterWord.png | Updates expected rendered output (Git LFS pointer change). |
| tests/Images/ReferenceOutput/TextJustification_InterWord_Horizontal_400-direction_RightToLeft-TextJustification_InterWord.png | Updates expected rendered output (Git LFS pointer change). |
| tests/Images/ReferenceOutput/TextJustification_InterWord_Horizontal_400-direction_LeftToRight-TextJustification_InterWord.png | Updates expected rendered output (Git LFS pointer change). |
| tests/Images/ReferenceOutput/TextJustification_InterCharacter_Vertical_400-direction_RightToLeft-TextJustification_InterCharacter.png | Updates expected rendered output (Git LFS pointer change). |
| tests/Images/ReferenceOutput/TextJustification_InterCharacter_Vertical_400-direction_LeftToRight-TextJustification_InterCharacter.png | Updates expected rendered output (Git LFS pointer change). |
| tests/Images/ReferenceOutput/TextJustification_InterCharacter_Horizontal_400-direction_RightToLeft-TextJustification_InterCharacter.png | Updates expected rendered output (Git LFS pointer change). |
| tests/Images/ReferenceOutput/TextJustification_InterCharacter_Horizontal_400-direction_LeftToRight-TextJustification_InterCharacter.png | Updates expected rendered output (Git LFS pointer change). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Prerequisites
Description
Refactors how text justification is handled in the
TextLayoutprocess. The change defers justification until after all lines are split, ensuring that only the appropriate lines are justified and metrics are recalculated correctly.