linebender / parley

Rich text layout library
Apache License 2.0
228 stars 28 forks source link

Italic CascadiaCove Nerd Font is loaded completely wrong #95

Closed fredizzimo closed 3 months ago

fredizzimo commented 4 months ago

StyleProperty::FontStack(FontStack::Source("CaskaydiaCove Nerd Font" )) StyleProperty::FontStyle(FontStyle::Italic)

Loads as semilight with embolden set to true: CaskaydiaCove NF SemiLight Italic, but CaskaydiaCove NF Italic should be loaded, which has the regular 400 weight, and does not need embolden.

So, this is like a combination of:

But in this case embolden is actually set, although a boolean is not very useful for this case, since if no 400 weight was available, it would only need to embolden 50 units, or almost nothing. Compared to almost doubling the weight to make it bold.

OS: Linux

dfrg commented 3 months ago

Hazarding a guess, this might have to do with the transform fontconfig applies in attempt to fit all fonts into the RBIZ model. We do try to undo this to achieve proper family grouping but it’s likely that some patterns have been missed leading to poor matching.

edit: this list is missing “SemiLight”: https://github.com/linebender/parley/blob/9af2072fc284d1122f301b3894bf01e99c5cf1a7/fontique/src/backend/fontconfig/mod.rs#L228

nicoburns commented 3 months ago

RBIZ model

For anyone else wondering what this is it's:

And the idea that these are the only 4 font variants (that fits neatly with the typical boolean Bold and Italic buttons in word processors)