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
"no default font found" issue on FreeBSD #61
Comments
|
I'm dealing with the same issue regarding
Hope this being help Also with following setting in the
|
On lapce port 0.3.1 ( https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274852 )
lapce ships and compiles 2 fondb crates, 0.14.1 and 0.16.0 and I patched the two:
and
result: Maybe I missing something... Thanks |
Sorry, I closed this PR by mistake |
Hmm... I guess we do support |
This the implementation in Slint and related discussion |
Ok, I see in lib.rs:
Any sugestion for a new 'freebsd' block or use a existing one so I can patch and test? |
Hm... right now we're treating all Unixes as Linux (except for macos and android), which is probably incorrect. Or at least overly generic. Either way, right now building on FreeBSD with Can you check you're building The fontconfig root config file resolving logic is very convoluted, like everything in fontconfig, therefore we might simply not covering some edge case. |
lapce 0.3.1 is finally running and fontdb needs:
Also FONTCONFIG_FILE is an environment variable, not some kind of build parameter. It was nice to have some build variable that controls this config. |
In Clear Linux OS, the file is located in yet another path: Simply making hard-coded assumptions about the location of |
The distro/OS neutral way of doing this is having the config in |
It is explained in this answer. Apparently, it has something to do with the fact that Clear Linux OS is a stateless distro. Also, according to this answer in the same thread, libfontconfig can be used to resolve the file in a distro-independent manner. The environment variable Apparently, Alacritty used to have the same issue on Clear Linux OS, but that eventually got fixed, since I've been able to build and run Alacritty on this OS just fine. @panekj Do you have any reference to documentation that defines |
https://www.freedesktop.org/software/fontconfig/fontconfig-user.html |
Fair enough. And I just checked, and Clear Linux OS doesn't have the environment variable |
That's Linux for you. There is no such thing as "default". |
@nunotexbsd great. Then you can replace the current line with: #[cfg(target_os = "freebsd")]
{
let _ = fontconfig.merge_config(Path::new("/usr/local/etc/fonts/fonts.conf"));
}
#[cfg(not(target_os = "freebsd"))]
{
let _ = fontconfig.merge_config(Path::new("/etc/fonts/fonts.conf"));
} |
As for Clear Linux, just set |
I think we can close this PR now. Thanks all |
@nunotexbsd So what was the final solution? Setting |
I was looking for solutions for packagers (poudriere) and using src If fondb added a build option to do this adjustment, I used that, but since it's using corrects fonts path, I will patch it to adjust to FreeBSD. Just a side note: FreeBSD respects paths too, but it adds a PREFIX that separates files from OS to the others installed by user (src, pkgs, etc)
Just an example, we could delete /usr/local from system and continue to have a cleaned OS system. |
Adding a compile-time option to specify prefix sounds like most sensible way to resolve that, as package/system maintainers we would like for all packages to be integrated with system libraries/software. Adding hardcoded paths might resolve it as well, but its prone to breaking anytime downstream changes paths. |
Except it's not that easy to do in Rust. And I still have no idea what path exactly have to be configured. Once again, I don't use FreeBSD. If someone would send a working patch - I might merge it.
It's not my fault that fontconfig sucks. It's way too slow, limited and clunky. |
But you don't have to use FreeBSD, nor know the absolute paths. It's enough that we know #[cfg(all(
unix,
feature = "fontconfig",
not(any(target_os = "macos", target_os = "android"))
))]
const fn prefix() -> &'static str {
if let Some(prefix) = option_env!("FONTDB_PREFIX") {
prefix
} else {
"/"
}
} if read_global {
let _ = fontconfig.merge_config(Path::new(Self::prefix()).join("etc/fonts/local.conf"));
}
let _ = fontconfig.merge_config(Path::new(Self::prefix()).join("etc/fonts/fonts.conf"));
}
No one is blaming you, I'm just explaining the motivation behind compile time option. |
I also noticed another issue, |
It is documented: Line 39 in c3274d0
The reason we only mention Linux and not Unixes is because only Linux is "supported" right now, if you can call it "support". And the only reason fontconfig "support" is present to begin with is because Linux distros decided that putting fonts into a hardcoded directory is too easy. And yes, fontconfig is intentionally disabled for Windows and macOS. I know you can use fontconfig on them, but you absolutely shouldn't. The whole point of As for Linux support is already 90% of |
While this is issue is being discussed on lapce/lapce#2748 ,
could we have some opinion on fontdb-0.14.1 used in https://github.com/lapce/lapce 0.3.1 about the error, "no default font found"
Same problem was found on some linux distros, but we can find a way of fixing it on FreeBSD.
Any help is welcome,
Thanks
The text was updated successfully, but these errors were encountered: