Repository navigation
Conversation
Resolved font sizes include the layout's display scale, and that scaled size was passed to HarfRust as the point size. The AAT `trak` table's tracking is looked up by point size, so on a 2x display text got the tracking for twice its size (for San Francisco: negative tracking at 11px instead of positive). `ShapeOptions` now has a `point_size` that Parley sets to the font size before display scaling.
DJMcNab
approved these changes
Nov 5, 2026
DJMcNab
left a comment
Member
There was a problem hiding this comment.
Conceptually, I agree that this change is correct. The way this PR is structured made me need to research to work out what it's actually doing - I've made suggestions inline to more closely match my mental model.
It also isn't self-evident that storing the physical font size and then dividing it back out by the scale to get the logical font size is the right shape for this, although arguably that could just be kept as a todo?
Comment on lines
+62
to
+63
| // Resolved font sizes include the display scale, but size-dependent shaping (such as `trak`) | ||
| // must use the unscaled point size. |
Member
There was a problem hiding this comment.
Suggested change
| // Resolved font sizes include the display scale, but size-dependent shaping (such as `trak`) | |
| // must use the unscaled point size. |
I don't find the term "unscaled point size" to be a self-explanatory phrase, and this isn't something subtle which requires a comment.
Comment on lines
25
to
+31
| /// The font size to shape the item with. | ||
| pub font_size: f32, | ||
| /// The font size in points (CSS pixels), before any display scaling. | ||
| /// | ||
| /// Used by size-dependent shaping, such as the AAT `trak` table's tracking. This usually | ||
| /// equals `font_size` unless that has been multiplied by a display scale factor. | ||
| pub point_size: f32, |
Member
There was a problem hiding this comment.
I'd like to see this changed to something like:
Suggested change
| /// The font size to shape the item with. | |
| pub font_size: f32, | |
| /// The font size in points (CSS pixels), before any display scaling. | |
| /// | |
| /// Used by size-dependent shaping, such as the AAT `trak` table's tracking. This usually | |
| /// equals `font_size` unless that has been multiplied by a display scale factor. | |
| pub point_size: f32, | |
| /// The font size to shape the item with. | |
| /// | |
| /// This is a number of device/physical points, i.e. the logical font size | |
| /// multiplied by any active scale factor. | |
| pub font_size: f32, | |
| /// The logical font size in points (CSS pixels), i.e. ignoring . | |
| /// | |
| /// Used by size-dependent shaping, such as the AAT `trak` table's tracking. | |
| pub point_size: f32, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The AAT
traktable's tracking is looked up by the unscaled (logical pixel) font size, so we need to pass that size rather the scale (physical pixel) font size to HarfRust.Screenshot
Changelog