-
Notifications
You must be signed in to change notification settings - Fork 38
Add the default for fontconfig cachedir #265
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
base: main
Are you sure you want to change the base?
Add the default for fontconfig cachedir #265
Conversation
028e7bf
to
ead42bf
Compare
.as_path(), | ||
&mut config, | ||
); | ||
let xdg_dirs = xdg::BaseDirectories::with_prefix("fontconfig").unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is unwrapping the right behaviour here? In case we couldn't determine $HOME
previously, it looks like we just didn't parse this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the xdg dep
impl Config { | ||
pub fn cache_dirs(&self) -> Vec<PathBuf> { | ||
if self.cache_dirs.is_empty() { | ||
let xdg_dirs = xdg::BaseDirectories::with_prefix("fontconfig").unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does an awful lot of allocation, given that we only use one item from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
3f6b28a
to
1c73527
Compare
Not sure what's going on here https://github.com/linebender/parley/actions/runs/13114951204/job/36586895966?pr=265 |
@@ -30,6 +30,7 @@ pub fn parse_config(path: &Path, sink: &mut impl ParserSink) { | |||
if root.tag_name().name() != "fontconfig" { | |||
return; | |||
} | |||
let mut cachedir_count = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably just use a boolean here, since the actual count doesn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
It looks like the test failure is hitting against the TODO in parley/parley/src/layout/cluster.rs Line 477 in 13fd37b
|
1c73527
to
b26737a
Compare
I believe this PR isn't the cause of the test failure, but simply uncovered an issue where the test isn't explicitly using a known font. I'll likely have time to look at it, but perhaps not today. |
I have a fontconfig configuration file without
cachedir
.Without this change
Collection.family_names()
is empty.According to FontConfig User Documation, the default value for
cachedir
is$XDG_CACHE_HOME/fontconfig
FYI, This PR add an extra dep (xdg) forfontique
on linux.