Skip to content

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Oct 12, 2025

Fonts can have style regular and non-zero italic angle. This however should not classify them as italic, even if they might look like it visually.

This makes it behave the same way as on desktop.

Fonts can have style regular and non-zero italic angle. This however
should not classify them as italic, even if they might look like it
visually.

This makes it behave the same way as on desktop.
@kjarosh kjarosh added A-web Area: Web & Extensions T-fix Type: Bug fix (in something that's supposed to work already) device-fonts Issues related to device fonts. They are usually very system-dependent. labels Oct 12, 2025
@kjarosh
Copy link
Member Author

kjarosh commented Oct 12, 2025

Also filed an issue to ttf parser about it: harfbuzz/ttf-parser#202

Comment on lines -474 to +475
is_italic: face.is_italic(),
// Note: do not use is_italic() here, as we don't care about italic_angle
is_italic: face.style() != ttf_parser::Style::Normal,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to look up ttf_parser::Style to see what the other "non-normal" styles are. As in - is "bold" in there, etc.
Just a nit of course, but do you think that checking for the (currently existing) other two variants explicitly would be nicer...?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the purpose?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being more self-explanatory. Not relying on other variants not mentioned there. Not prompting the reader to look up what those variants are. And again, I don't insist on this - just wanted to note that it wasn't immediately obvious (at least for me, before looking up the docs) that this is correct.

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

Labels

A-web Area: Web & Extensions device-fonts Issues related to device fonts. They are usually very system-dependent. T-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants