Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Line Breaker. #438

Merged
merged 11 commits into from
Jan 8, 2025
Merged

Rewrite Line Breaker. #438

merged 11 commits into from
Jan 8, 2025

Conversation

JimBobSquarePants
Copy link
Member

Prerequisites

  • 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

A complete rewrite of the line breaker to fix a series of issues including #434 I've not benchmarked this but in addition to fixing bugs the code is now doing far less work per code point so should be faster.

I've also added testing that will generate output using ImageSharp.Drawing which allows us to better visualize the layout. Adding this helped identify multiple issues. The generation code is togglable via a compiler condition introduced via the csproj file. This allows us to turn them off should we introduce breaking changes.

All output has been sense checked and compared to browser output to ensure correctness.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 46 out of 66 changed files in this pull request and generated no comments.

Files not reviewed (20)
  • tests/Images/ReferenceOutput/CountLinesWrappingLength_100-4.png: Language not supported
  • tests/Images/ReferenceOutput/CountLinesWrappingLength_200-3.png: Language not supported
  • tests/Images/ReferenceOutput/CountLinesWrappingLength_25-6.png: Language not supported
  • tests/Images/ReferenceOutput/CountLinesWrappingLength_50-5.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreakMatchesMDN_238-layoutMode_HorizontalBottomTop-wordBreaking_BreakAll.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreakMatchesMDN_238-layoutMode_HorizontalBottomTop-wordBreaking_BreakWord.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreakMatchesMDN_238-layoutMode_HorizontalBottomTop-wordBreaking_KeepAll.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreakMatchesMDN_238-layoutMode_HorizontalBottomTop-wordBreaking_Standard.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreakMatchesMDN_238-layoutMode_HorizontalTopBottom-wordBreaking_BreakAll.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreakMatchesMDN_238-layoutMode_HorizontalTopBottom-wordBreaking_BreakWord.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreakMatchesMDN_238-layoutMode_HorizontalTopBottom-wordBreaking_KeepAll.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreakMatchesMDN_238-layoutMode_HorizontalTopBottom-wordBreaking_Standard.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreak_500-layoutMode_HorizontalBottomTop-wordBreaking_BreakAll.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreak_500-layoutMode_HorizontalBottomTop-wordBreaking_BreakWord.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreak_500-layoutMode_HorizontalBottomTop-wordBreaking_KeepAll.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreak_500-layoutMode_HorizontalBottomTop-wordBreaking_Standard.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreak_500-layoutMode_HorizontalTopBottom-wordBreaking_BreakAll.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreak_500-layoutMode_HorizontalTopBottom-wordBreaking_BreakWord.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreak_500-layoutMode_HorizontalTopBottom-wordBreaking_KeepAll.png: Language not supported
  • tests/Images/ReferenceOutput/MeasureTextWordBreak_500-layoutMode_HorizontalTopBottom-wordBreaking_Standard.png: Language not supported
tocsoft
tocsoft previously approved these changes Jan 7, 2025
Copy link
Member

@tocsoft tocsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@JimBobSquarePants JimBobSquarePants merged commit bcea187 into main Jan 8, 2025
8 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-line-break branch January 8, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants