Add the default for fontconfig cachedir#265
Add the default for fontconfig cachedir#265declantsien wants to merge 2 commits intolinebender:mainfrom
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.
Is unwrapping the right behaviour here? In case we couldn't determine $HOME previously, it looks like we just didn't parse this file?
| 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.
This does an awful lot of allocation, given that we only use one item from it.
3f6b28a to
1c73527
Compare
|
Not sure what's going on here https://github.com/linebender/parley/actions/runs/13114951204/job/36586895966?pr=265 |
| if root.tag_name().name() != "fontconfig" { | ||
| return; | ||
| } | ||
| let mut cachedir_count = 0; |
There was a problem hiding this comment.
I'd probably just use a boolean here, since the actual count doesn't matter.
|
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. |
4242d4e to
9e7beb5
Compare
|
Rebased on latest master branch |
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
cachediris$XDG_CACHE_HOME/fontconfigFYI, This PR add an extra dep (xdg) forfontiqueon linux.