Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion web/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ impl RuffleInstanceBuilder {
player.register_device_font(FontDefinition::FontFile {
name: name.to_string(),
is_bold: face.is_bold(),
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,
Comment on lines -474 to +475
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.

data: FontFileData::new(bytes),
index,
});
Expand Down
Loading