-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Support text runs. #251
Support text runs. #251
Conversation
Codecov Report
@@ Coverage Diff @@
## main #251 +/- ##
====================================
- Coverage 83% 83% -1%
====================================
Files 183 186 +3
Lines 8985 9430 +445
Branches 1425 1478 +53
====================================
+ Hits 7542 7902 +360
- Misses 1118 1187 +69
- Partials 325 341 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good, couple of comments.
@tocsoft My reasoning re so the following naming looked correct.
It also made development a little chicken and eggy since the referenced Drawing version in the Samples project would not build if I change the name. Changing the name isn't great for upgrades but I'm sure we'll do worse before we ship an RC 😁 |
@tocsoft I've captured metrics for subscript, superscript, underline, and strikethrough that can be used for rendering. My assumption would be that this is performed in I'm gonna need some help with the actual render implementation though, drawing is still not a strong point of mine. |
Roughly correct and ported from another project I had this in before, but not exactly tested after porting, so may be some rough edges
First pass at POST table
TODO: Location offsets
Yeah the rendering side I should be able to tackle... ultimately for all this we will need to pass long a
|
@tocsoft I'm pinches fingers "this close" to cracking superscript and subscript rendering. I've got scaling and positioning working, I just need to fix an indexing issue with the runs (exclusive end turned out to be a bad idea.) so hold out please. |
@tocsoft Just did a BIG update to the layout engine to ensure we generate the correct line-height + offsets for mixed font sizes. Here's how we compare to Chromium based browsers rendering mixed font sizes. It's now exact. Six Labors - Left : Chromium - Right Horizontal Vertical Found and fixed a line-break issue in the process and also vertical and horizontal centering was a shade off. Test updates have also been verified visually. |
Too tired to fix the .NET 472 rounding silliness just now. Will fix tomorrow. |
@tocsoft I'm pretty happy with the shape of this now and with your blessing will get it merged. The last things I wanted to have a look at was font hinting and It looks like I've solved the horizontal alignment problem of the Tahoma 11.25pt @ 72 dpi Tahoma 11.25pt @ 96 dpi |
Prerequisites
Description
Adds initial support for individual text runs within a text shaping run. Fixes #10
TODO:
GlyphMetrics
Example API for setting
TextRun
properties.Start
andEnd
properties are measured in graphemes to avoid slicing up emoji and such like.Example Output.