vercel / geist-font

https://vercel.com/font
SIL Open Font License 1.1
2.49k stars 65 forks source link

Text Stroke Rendering Issue #112

Closed kyrylolvov closed 5 months ago

kyrylolvov commented 5 months ago

Font Name (Geist Sans/Geist Mono):

Description of the Issue: The Geist Sans font is incorrectly rendered when applying -webkit-text-stroke-color property.

Steps to Reproduce: Apply these styles:

-webkit-text-fill-color: white;
-webkit-text-stroke-width: 2px;
-webkit-text-stroke-color: black;

Screenshots:

Screenshot 2024-06-05 at 10 17 43 AM

Environment (please complete the following information):

kyrylolvov commented 5 months ago

@guidoferreyra Hello! Is this on the roadmap of fixes? As I saw a similar issue, but it was closed by the author.

guidoferreyra commented 5 months ago

Hi @kyrylolvov! On variable fonts it’s needed to keep the overlaps for better and smoother inteporlation. Unfortunately this get is the way of using outlines and strokes. It’s supossed that browsers and apps will change the way of how they apply outlines to text but is not possible to know when this will happen.

There is a CSS workaround using text shadow

.outline-text {
    color: white;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
kyrylolvov commented 5 months ago

Hi @kyrylolvov! On variable fonts it’s needed to keep the overlaps for better and smoother inteporlation. Unfortunately this get is the way of using outlines and strokes. It’s supossed that browsers and apps will change the way of how they apply outlines to text but is not possible to know when this will happen.

There is a CSS workaround using text shadow

.outline-text {
    color: white;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

Thank you for your answer and assistance, it works! :)