Repository navigation
fonts: Remove the "fast" shaper - #50236
Merged
Merged
Conversation
For years, Servo has had a rudimentary shaper that read the `kern` tables and tried to do a very basic version of shaping itself. This change removes that shaper and all associated code because: 1. It was rarely used: the fast shaper only ran on LTR ASCII text for fonts with neither `GSUB` nor `GPOS` tables. That covers a very small number of situations. 2. It isn't really faster: My measurements showed that even when bending over backwards to use the fast shaper the difference in performance was within noise or slower on both macOS and Linux. HarfBuzz is a lot faster nowadays and we do a lot more caching. 3. It produces inaccurate results. My testing showed that the fast shaper can produce degraded shaping results in certain conditions. 4. It added a lot of code complexity and was always considered to be a bad idea. For example see this comment: <servo#11273 (comment)>. There are interesting optimizations to shaping coming, so we should finally retire this workaround for a real shaper. Signed-off-by: Martin Robinson <[email protected]>
mrobinson
force-pushed
the
font-remove-fast-shaper
branch
from
November 25, 2026 16:09
358d19c to
1dd9945
Compare
jdm
approved these changes
Nov 25, 2026
|
Test results for linux-wpt from merge queue job (#45690783493): Flaky unexpected result (22)
Stable unexpected results that are known to be intermittent (4)
Stable unexpected results (38)
|
devin-ai-integration Bot
pushed a commit
to baigojahanzaib/servo
that referenced
this pull request
Nov 28, 2026
For years, Servo has had a rudimentary shaper that read the `kern` tables and tried to do a very basic version of shaping itself. This change removes that shaper and all associated code because: 1. It was rarely used: the fast shaper only ran on LTR ASCII text for fonts with neither `GSUB` nor `GPOS` tables. That covers a very small number of situations. 2. It isn't really faster: My measurements showed that even when bending over backwards to use the fast shaper the difference in performance was within noise or slower on both macOS and Linux. HarfBuzz is a lot faster nowadays and we do a lot more caching. 3. It produces inaccurate results. My testing showed that the fast shaper can produce degraded shaping results in certain conditions. 4. It added a lot of code complexity and was always considered to be a bad idea. For example see this comment: <servo#11273 (comment)>. There are interesting optimizations to shaping coming, so we should finally retire this workaround for a real shaper. Testing: This should have a very tiny change in behavior, which is unlikely to be reflected in test results. There isn't a good way to test removal of this obsolete fast path. Signed-off-by: Martin Robinson <[email protected]>
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.
For years, Servo has had a rudimentary shaper that read the
kerntables and tried to do a very basic version of shaping itself. This change removes that shaper and all associated code because:GSUBnorGPOStables. That covers a very small number of situations.There are interesting optimizations to shaping coming, so we should finally retire this workaround for a real shaper.
Testing: This should have a very tiny change in behavior, which is unlikely
to be reflected in test results. There isn't a good way to test removal
of this obsolete fast path.