Open chrisduerr opened 4 years ago
I just stumbled across the same problem when trying to run webgpu-examples on ClearLinux. fc-list
yields the following search paths:
[...]
access("/usr/share/defaults/fonts/fonts.conf", R_OK) = 0
access("/usr/share/defaults/fonts/fonts.conf", R_OK) = 0
readlink("/usr/share/defaults/fonts/fonts.conf", 0x7fffcd5021c0, 4095) = -1 EINVAL (Invalid argument)
stat("/usr/share/defaults/fonts/fonts.conf", {st_mode=S_IFREG|0644, st_size=2532, ...}) = 0
openat(AT_FDCWD, "/usr/share/defaults/fonts/fonts.conf", O_RDONLY|O_CLOEXEC) = 3
read(3, "<?xml version=\"1.0\"?>\n<!DOCTYPE "..., 8192) = 2532
read(3, "", 8192) = 0
close(3) = 0
getrandom("\x3f\xbc\x81\x3a\xc4\x00\x4b\xae", 8, GRND_NONBLOCK) = 8
access("/usr/share/defaults/fonts/conf.d", R_OK) = 0
[...]
access("/usr/share/defaults/fonts/fonts.conf", R_OK) = 0
access("/etc/fonts/conf.d", R_OK) = -1 ENOENT (No such file or directory)
access("/etc/fonts/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
stat("/home/oleid/.config/fontconfig/conf.d", 0x7fffcd4ef4a0) = -1 ENOENT (No such file or directory)
access("/home/oleid/.config/fontconfig/conf.d", R_OK) = -1 ENOENT (No such file or directory)
access("/home/oleid/.fonts.conf.d", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/defaults/fonts/~/.fonts.conf.d", R_OK) = -1 ENOENT (No such file or directory)
access("/home/oleid/.fonts.conf.d", R_OK) = -1 ENOENT (No such file or directory)
access("/home/oleid/.fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
stat("/usr/share/fontconfig/conf.avail/51-local.conf", {st_mode=S_IFREG|0644, st_size=423, ...}) = 0
[...]
I'd also like to point out that there is now only a single major freetype and fontconfig library in use on crates.io. So there won't be any conflicts by making use of that.
Andrew seems to load the configuration file for fontconfig directly:
https://github.com/trimental/andrew/blob/30a2d2487e726520cfcf8a2e615fefab697649c7/src/text/fontconfig.rs#L15
This will obviously cause problems on systems that do not have the file in that location. Like Clear Linux for example: https://github.com/clearlinux/distribution/issues/639
Instead, the fontconfig provided function should be called to load the configuration file.