Skip to content

Different rendering on windows #42

@PhilippSpo

Description

@PhilippSpo

Some fonts define a different ascent and descent value for windows.

Here is, for example, how capsize shows Tajawal's metrics on Windows vs. Mac:

Mac Windows
CleanShot 2021-08-22 at 21 20 55@2x CleanShot 2021-08-22 at 21 21 54@2x

I've run a script against all google fonts, and around 30% have different ascent or descent values for windows than for other operating systems.

To align fonts with their cap size reliably across operating systems, we have to take the Win Ascent and Descent numbers into account and use them instead of the "normal" HHead metrics on Windows systems.

This is not really an issue with capsize itself because capsize doesn't care where the user gets their font metrics from. If they provide the Windows metrics in browsers on Windows and the other metrics in all other operating systems, it works fine. It's just that probably a lot of people aren't aware of this.

Maybe we can add this to the FAQ section on the website? Additionally, we could extend the automatic font metrics detection logic on the site to use the windows metrics when being viewed on Windows. (The fontkit library only seems to provide the HHead numbers. I've had success with opentype.js to extract also the Win numbers.)

I'm happy to help on this if wanted/needed 🙋‍♂️.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions