Crates.io | yeslogic-fontconfig |
lib.rs | yeslogic-fontconfig |
version | 0.1.1 |
source | src |
created_at | 2019-12-05 02:56:00.061107 |
updated_at | 2020-06-11 05:59:40.994391 |
description | RENAMED: use the fontconfig crate instead. |
homepage | https://github.com/yeslogic/fontconfig-rs |
repository | https://github.com/yeslogic/fontconfig-rs |
max_upload_size | |
id | 186604 |
size | 14,980 |
A wrapper around freedesktop.org's fontconfig library, for locating fonts on a UNIX like systems such as Linux and FreeBSD. Requires fontconfig to be installed.
fontconfig
libfontconfig1-dev
fontconfig
fontconfig-devel
Cargo.toml:
[dependencies]
yeslogic-fontconfig = "0.1.0"
main.rs:
use fontconfig::Fontconfig;
fn main() {
let fc = Fontconfig::new().unwrap();
// `Fontconfig::find()` returns `Option` (will rarely be `None` but still could be)
let font = fc.find("freeserif", None).unwrap();
// `name` is a `String`, `path` is a `Path`
println!("Name: {}\nPath: {}", font.name, font.path.display());
}
You could then, for example, use font.path
to create a GlyphCache
from opengl_graphics
and pass it to conrod
.
For our needs in Prince we wanted higher-level bindings that did not fall back on vendored versions of libraries, which is what the crates in this repo provide.