Account for the Firefox font size quantization in the text layer - #21810
Open
calixteman wants to merge 1 commit into
Open
Account for the Firefox font size quantization in the text layer#21810calixteman wants to merge 1 commit into
calixteman wants to merge 1 commit into
Conversation
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 21, 2026 18:37 — with
GitHub Actions
Inactive
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21810 +/- ##
==========================================
- Coverage 90.20% 90.19% -0.01%
==========================================
Files 264 264
Lines 67339 67345 +6
==========================================
+ Hits 60741 60743 +2
- Misses 6598 6602 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Firefox rounds the font size set on a canvas 2d context, once divided by the device pixel ratio, to 7 bits of precision. Hence `measureText` can return a width up to ~1% off the one the spans are laid out with, which made `--scale-x` slightly wrong in a zoom dependent way. Measure with a size left untouched by that rounding and rescale the returned width, which is linear in the font size.
calixteman
force-pushed
the
quantize_measured_font_size
branch
from
August 22, 2026 12:30
8f6f3ed to
cb79d37
Compare
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
calixteman
temporarily deployed
to
code-coverage
August 22, 2026 12:30 — with
GitHub Actions
Inactive
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.
Firefox rounds the font size set on a canvas 2d context, once divided by the device pixel ratio, to 7 bits of precision. Hence
measureTextcan return a width up to ~1% off the one the spans are laid out with, which made--scale-xslightly wrong in a zoom dependent way. Measure with a size left untouched by that rounding and rescale the returned width, which is linear in the font size.