# README

fontconfig for Golang

This package is a port from the C fontconfig library.

Its main purpose is to fetch the metadata of the fonts installed in a system, and use that database to select the best font to use given some user-specified query (name, style, weight, etc...).

Differences from the original C library

While the main fonctionnality of the original library are preserved, some simplifications have been made (mainly to avoid complex logic of file system handling).

Caching

The package drops support for advanced caching: it is deferred to the users. They can use the provided Serialize and LoadFontset functions, but its up to them to specified what to cache, when and where.

Configuration build

The main way to specify complex configurations remains the XML fontconfig format. However, it is not possible to use <include> directives. Several config files are simply added one by one.

Font directories

The XML format does not support specifying font directories. Instead, scans are explicitely triggered by the user, which provide a file (ScanFontFile), an in-memory content (ScanFontRessource) or a list of directories (ScanFontDirectories).

Dependencies

This is a pure Go implementation, which rely on fonts as a substitute of FreeType to handle the scanning of a font file.

# Packages

No description provided by the author
Read a set of language orthographies and build Go declarations for charsets which can then be used to identify which languages are supported by a given font.

# Functions

No description provided by the author
DefaultFontDirs return the OS-dependent usual directories for fonts, or an error if no one exists.
GenerateSubstitution exports the Standard family substitution rules.
LoadFontset reads a cache file, exported by the `Fontset.Serialize` method, and constructs the associated font set.
LoadFontsetFile is a convenience wrapper of `LoadFontset` for files.
NewConfig returns a new empty, initialized configuration.
NewLangset parse a set of language of the form <lang1>|<lang2>|..
NewPattern returns an empty, initalized pattern.
PartialScanFontDirectories walk through the given directories and scan each font file to extract a summary.
ReadFontFile tries for every supported font format, returning a valid font format if one matches.
ScanAndCache uses the standard config, scans the fonts on disk from the default directories, and caches the result into `fontsFileCache`.
WeightFromOT returns a float value to use with `WEIGHT`, from a float in the 1..1000 range, resembling the numbers from OpenType specification's OS/2 usWeight numbers, which are also similar to CSS font-weight numbers.
WeightToOT is the inverse of `WeightFromOT`.

# Constants

with type Bool.
with type Double.
with type Bool.
with type String.
with type Int.
No description provided by the author
with type CharSet.
with type Int.
with type Bool.
with type Bool.
unspecified.
with type Double.
No description provided by the author
with type Bool.
with type Bool.
common `false`.
with type String.
with type String.
with type String.
Custom objects should be defined starting from this value.
with type String.
with type Bool.
with type String.
with type String.
with type Int.
with type String.
with type String.
with type String.
with type Bool.
with type String.
No description provided by the author
No description provided by the author
hinting style */.
No description provided by the author
with type Int.
with type Bool.
with type Int.
with type LangSet.
No description provided by the author
with type Int.
No description provided by the author
No description provided by the author
LCD filter */.
Rules in the config to apply to the query pattern (FcMatchPattern).
Rules in the config to apply to the fonts returned as the result of a query (FcMatchFont).
Rules in the config to apply to the fonts obtained during the scan (FcMatchScan).
with type Matrix.
with type Bool.
No description provided by the author
with type String.
with type Int.
with type Bool.
No description provided by the author
with type Double.
with type String.
with type String.
No description provided by the author
with type String.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
with type Int.
No description provided by the author
No description provided by the author
No description provided by the author
sub-pixel order */.
No description provided by the author
No description provided by the author
with type Bool.
with type Double.
with type Range.
with type Int.
No description provided by the author
No description provided by the author
No description provided by the author
with type Int.
with type String.
with type String.
with type Bool.
common `true`.
No description provided by the author
No description provided by the author
with type Bool.
with type Bool.
with type Range.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
with type Range.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
Standard exposes the parsed configuration described in the 'confs' folder.

# Structs

Charset is a compact rune set.
Config holds a complete configuration of the library.
No description provided by the author
Langset holds the set of languages supported by a font.
No description provided by the author
PatternElement associate one value to a categorie (or Object).
No description provided by the author

# Interfaces

Value is a sum type for the values of the properties of a pattern.

# Type aliases

Bool is a tri-state boolean (see the associated constants).
No description provided by the author
FontFormat identifies the supported font file types.
Fontset contains a list of Patterns, containing the results of listing fonts.
No description provided by the author
Object encode the properties of a font.
An Pattern holds a set of names with associated value lists; each name refers to a property of a font, also called `Object`.
Result is returned when accessing elements of a pattern.
No description provided by the author