JuliaGraphics/Fontconfig.jl

Name: Fontconfig.jl

Owner: JuliaGraphics

Description: Basic Julia bindings for fontconfig

Created: 2014-06-12 15:08:51.0

Updated: 2017-01-30 10:08:27.0

Pushed: 2017-05-18 21:03:21.0

Homepage: null

Size: 21

Language: Julia

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Fontconfig

Build Status Build status

Fontconfig.jl provides basic binding to fontconfig.

Pattern

Pattern corresponds to the fontconfig type FcPattern. It respresents a set of font properties used to match specific fonts.

It can be constructed in two ways. First with zero or more keyword arguments corresponding to fontconfig font properties.

config.Pattern(; args...)

For example

config.Pattern(family="Helvetica", size=10, hinting=true)

Secondly, it can be constructed with a fontconfig specifications string

config.Pattern(name::String)

For example

config.Pattern("Helvetica-10")

Match

The primary functionality fontconfig provides is matching font patterns. In Fontconfig.jl this is done with the match function, corresponding to FcMatch in fontconfig.

h(pat::Pattern)

It takes a Pattern and return a Pattern corresponding to the nearest matching installed font.

Format

Extracting property values from a Pattern can be done with the format function, which wraps FcPatternFormat.

at(pat::Pattern, fmt::String="%{=fclist}")

See man FcPatternFormat for the format string specification.

List

Fontconfig also provides a function list to enumerate all installed fonts. Optionally, a Pattern can be provided to list just matching fonts. The function will return a vector of Patterns

(pat::Pattern=Pattern())

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.