[−][src]Crate fontconfig
A wrapper around [freedesktop.org's fontconfig library][homepage], for locating fonts on a UNIX like systems such as Linux and FreeBSD. Requires fontconfig to be installed.
See the fontconfig developer reference for more information.
Dependencies
- Arch Linux:
fontconfig
- Debian-based systems:
libfontconfig1-dev
- FreeBSD:
fontconfig
- Void Linux:
fontconfig-devel
Usage
Cargo.toml:
[dependencies]
fontconfig = "0.1.0"
main.rs:
extern crate fontconfig; use fontconfig::{Font, Fontconfig}; fn main() { let fc = Fontconfig::new().unwrap(); // `Font::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()); }
Structs
Font | A very high-level view of a font, only concerned with the name and its file location. |
FontSet | Wrapper around |
Fontconfig | Handle obtained after Fontconfig has been initialised. |
ObjectSet | Wrapper around |
Pattern | A safe wrapper around fontconfig's |
UnknownFontFormat | Error type returned from Pattern::format. |
Enums
FontFormat | The format of a font matched by Fontconfig. |
Constants
Functions
list_fonts | Return a |