rust-fontconfig
rust-fontconfig copied to clipboard
Monospace search doesn't work
The following code fails at the second assertion:
let cache = FcFontCache::build();
assert!(cache
.query(&FcPattern {
name: Some("DejaVu Sans Mono".into()),
..Default::default()
})
.is_none());
assert!(cache
.query(&FcPattern {
monospace: PatternMatch::True,
..Default::default()
})
.is_some());
Is it an expected behavior?
Also seems the issue related to #3
It's not expected behaviour, but then again, this entire library is ~400 lines of code, so it's not really advanced. The feature detection isn't very good. I should not have used "fontconfig" in the title, people now think it's a 1:1 replacement for fontconfig, while it's more or less just one single file.
Maybe use font-kit or fontdb instead for now.
Quiet funny that fontdb also fails for the same query. And font-kit is overkill for me, my case is to find a font by its name or otherwise provide a reasonable default (i.e. any monospace). And I never used fontconfig, tbh.
I guess I could look into the sources then, you're open to patches like this, right?
Also, fontsearch/font-search seems unused at crates.io, maybe switch to one of these instead?
Maybe try again with 1.0.7, some font search issues have been fixed