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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Fontconfig.jl provides basic binding to fontconfig.
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")
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.
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.
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 Pattern
s
(pat::Pattern=Pattern())