yeslogic-fontconfig 0.1.1

RENAMED: use the fontconfig crate instead.
Documentation

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:

use fontconfig::{Font, 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());
}