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

Internal lines visible when drawing as an outline using CSS text-stroke/fill, affects multiple fonts #8731

Open
willbroderick opened this issue Dec 12, 2024 · 4 comments

Comments

@willbroderick
Copy link

willbroderick commented Dec 12, 2024

This affects Instrument, Inter, Heebo, and more. (Possibly any font packaged after 2020)

Describe the bug

When using text-stroke/text-fill-color to draw the font as an outline, the Google copy of these fonts look incorrect, showing internal lines.

The original fonts do not show this issue, when testing using the version compiled for releases on their repos.

To Reproduce

Use any of these fonts via Google Fonts embed, or using the files downloaded from Google Fonts, on a web page.
Apply the following CSS to the text:

-webkit-text-stroke: 0.01em black;
-webkit-text-fill-color: white;

Expected behavior

The internal lines should not show. Like Lato, for example:

Additional context

Appears on both recent Windows/Mac.

This issue was raised before specifically for Heebo, but as this affects multiple fonts I'm raising a new issue as it does not appear to be font-specific.

This may affect all fonts packaged after 2020, so may be a font packager issue introduced around then.

@emmamarichal
Copy link
Collaborator

Hi @willbroderick!

Thank you for the report! Yes we are aware of this, we got several reports (Figtree, Radio Canada Display).
We are working on that.
Meantime, you can use the .otf, or you can build your own version through a repo fork, by merging outlines.

@simoncozens
Copy link
Collaborator

Hi @willbroderick - we discussed this today. This is a common issue with rendering variable fonts because of the way the glyphs are constructed. Static fonts and OTF format fonts are shipped with outlines removed, but that can't be done for variable fonts because it may cause incompatible outlines at different points in the design space.

Generally speaking, it's the job of the rendering engine - not the font - to remove the overlap before stroking the glyphs, and that's obviously happening in this case. Can I ask what browser you are seeing this in?

@emmamarichal emmamarichal mentioned this issue Dec 12, 2024
2 tasks
@willbroderick
Copy link
Author

Sure @simoncozens, I see it in Chrome v131.0.6778.140

@simoncozens
Copy link
Collaborator

Thanks. In which case it is an issue for @drott...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants