-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retina weight is loaded instead of regular weight for FiraCode Nerd Font #92
Comments
On another Linux machine, it's actually loading the correct weight. I'm not sure what the difference is, both are Arch Linux install and use the same version of the |
@fredizzimo |
I will try to debug exactly what happens during the weekend when I have access to that machine. BTW, I have tests for all the bugs I have reported here: Those goes through our code, but it would probably be worth introducing something similar here as well. |
Thanks, I'll take another look. |
I have now debugged it, and here's what's happening The fontconfig information is correct
But not every font has a weight defined here parley/fontique/src/backend/fontconfig/cache.rs Lines 118 to 209 in 6ecf702
Because the weight and some other properties are not cleared here parley/fontique/src/backend/fontconfig/cache.rs Lines 77 to 82 in 6ecf702
Then the weight remains set to what it was before Then later on the Lines 208 to 224 in 6ecf702
Now, it's no longer matching in this condition parley/fontique/src/matching.rs Line 380 in 6ecf702
Changing the |
Yes adding: diff --git a/fontique/src/backend/fontconfig/cache.rs b/fontique/src/backend/fontconfig/cache.rs
index e13c93e..8b48501 100644
--- a/fontique/src/backend/fontconfig/cache.rs
+++ b/fontique/src/backend/fontconfig/cache.rs
@@ -79,6 +79,9 @@ impl CachedFont {
self.path.clear();
self.index = 0;
self.coverage.clear();
+ self.weight = Weight::default();
+ self.style = Style::default();
+ self.stretch = Stretch::default();
}
} Seems to fix this issue, and also these
|
Thank you for drilling down on this. I think that your last fix here is good. If you want you can put it up as a PR or I will do it. As for linking against actual fontconfig, we would like to avoid that for a variety of reasons. |
… cache (#104) The fonts do not always have these pattern elements defined, and then the value of the previous font was wrongly used. Clearing the values, fixes that and ensures that the default values are used. For a more detailed description see #92 (comment) * Fixes #93 * Fixes #95 * Fixes #96
Closing this, as it should have been closed by #104 |
When trying to load "FiraCode Nerd Font" using
StyleProperty::FontStack(FontStack::Source("FiraCode Nerd Font"))
the retina weight (450) is loaded instead of the regular 400 weight.FiraCodeNerdFont-Regular.ttf
has the normal 400 weight, so it should be loaded instead.NotoSerif Nerd Font
has a similar problem, but there it loads theMedium
weight instead ofNormal
This happens at least on Arch Linux with commit 5b60803
The text was updated successfully, but these errors were encountered: