Skip to content

Conversation

Gillibald
Copy link
Contributor

@Gillibald Gillibald commented Aug 27, 2025

What does the pull request do?

The PR adjusts the baseline calculation so that a defined line gap is distributed evenly to the top and bottom of the text line

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

  • Added unit tests (if possible)?
  • Added XML documentation to any related classes?
  • Consider submitting a PR to https://github.com/AvaloniaUI/avalonia-docs with user documentation
  • Add a test for GlyphRun.BaselineOrigin
  • Add a test for TextLine.Baseline
  • Add a test for ShapedTextRun.Baseline

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes: #19547

miloush
miloush previously approved these changes Aug 27, 2025
@Gillibald Gillibald changed the title [WIP] Distribute LineGap evenly to top and bottom Distribute LineGap evenly to top and bottom Aug 27, 2025
@Gillibald Gillibald added the backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch label Aug 27, 2025
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0058619-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
Copy link
Member

MrJul commented Aug 27, 2025

I'm sorry to be that guy again, but please add a test so we can validate the calculated behavior and we won't regress it in the future.

@Gillibald Gillibald changed the title Distribute LineGap evenly to top and bottom [WIP] Distribute LineGap evenly to top and bottom Aug 27, 2025
@Gillibald
Copy link
Contributor Author

  • Add a test for GlyphRun.BaselineOrigin
  • Add a test for TextLine.Baseline
  • Add a test for ShapedTextRun.Baseline

@Gillibald
Copy link
Contributor Author

We need to find a font file that defines typoLineGap or hheaLineGap otherwise, we can only run the tests on Windows

@miloush
Copy link
Contributor

miloush commented Aug 27, 2025

We can create some or edit the current test fonts as needed

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0058704-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

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

Labels

area-textprocessing backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some fonts are not rendered with the correct baseline

4 participants