Skip to content
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

gfx: Derive line-through metrics for fonts on MacOS #31756

Merged
merged 1 commit into from Mar 19, 2024

Conversation

mrobinson
Copy link
Member

@mrobinson mrobinson commented Mar 19, 2024

There is no platform-specific way to get metrics for line-through on
MacOS and currently striking through simply does not work. The correct
approach here is likely to first search for these metrics in font tables
and then fall back to deriving them. Searching the font tables is a
larger change, so this change adds the fallback mechanism first. This at
least makes sure that strike through renders at all on Mac.

In a followup change we can add support for getting metrics via HarfBuzz
in a platform-independent way, which is what Gecko does.

Fixes #942.


There is now platform-specific way to get metrics for `line-through` on
MacOS and currently striking through simply does not work. The correct
approach here is likely to first search for these metrics in font tables
and then falling back to deriving them. Searching the font tables is a
larger change, so this change adds the fallback mechanism first. This at
least makes sure that strike through renders at all on Mac.

In a followup change we can add support for getting metrics via HarfBuzz
in a platform-independent way, which is what Gecko does.

Fixes servo#942.
@mrobinson mrobinson added this pull request to the merge queue Mar 19, 2024
Merged via the queue into servo:main with commit f175679 Mar 19, 2024
11 checks passed
@mrobinson mrobinson deleted the derive-strike-through-macos branch March 19, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correctly calculate strikeout fields of FontMetrics struct for macos
2 participants