Skip to content
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

Use something other than font-kit and/or put it behind feature gate #58

Closed
fu5ha opened this issue Nov 16, 2019 · 3 comments · Fixed by #370
Closed

Use something other than font-kit and/or put it behind feature gate #58

fu5ha opened this issue Nov 16, 2019 · 3 comments · Fixed by #370
Labels
feature New feature or request improvement An internal improvement

Comments

@fu5ha
Copy link

fu5ha commented Nov 16, 2019

font-kit seems like a nice lib, however it's very much not pure Rust, requiring not only a full c++ build system but also several C libs and their associated header files to be installed on a system (at least on Linux), and as such presents a fairly significant bar to entry. It would be nice not to depend on it. Also, even after getting it to compile on Fedora, I stlil get this output in my terminal when runing the todos example, though it does seem to work at least.

edit

error output was fixed by updating outdated fontconfig-devel.

Just for reference, on Fedora 30, I had to install cmake, g++, freetype, freetype-devel, expat-devel, and fontconfig-devel for it to work.

@hecrj
Copy link
Member

hecrj commented Nov 16, 2019

This seems to be caused by libfontconfig, which compiles and statically links itself if it can't find an appropriate system version with pkg-config. Here is the relevant code: https://github.com/servo/libfontconfig/blob/master/build.rs#L20

That said, a feature gate would be nice for cases where system font loading isn't needed (for instance, when embedding fonts in games).

@AlienKevin
Copy link

Just in case someone on ubuntu wants to install these missing dependencies:

sudo apt install pkg-config
sudo apt install cmake
sudo apt install libfreetype6-dev
sudo apt-get install expat
sudo apt-get install libexpat-dev

After installing the above, the counter example builds successfully.

@valpackett
Copy link
Contributor

servo/libfontconfig#55 would add a force_system_lib feature to libfontconfig that would allow us to get an error instead of building the silly/annoying cache-incompatible embedded fontconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request improvement An internal improvement
Projects
None yet
4 participants