Expand description
Font enumeration and fallback.
§Features
The following crate feature flags are available:
std(enabled by default): Get floating point functions from the standard library (likely using your target’s libc).libm: Use floating point implementations from libm. This is useful forno_stdenvironments. However, note that thelibmcrate is not as efficient as the standard library.bytemuck: Forwarded toparlancewhich then implements traits frombytemuckon its types.system(enabled by default): Enable support for system font backends. This also enablesstd.fontconfig-dlopen: Use dlopen to load the fontconfig library. This allows Fontique to compile even if the system does not have fontconfig installed, although font fallback to system fonts will not work in this case.
At least one of std and libm is required; std overrides libm.
Note that Fontique requires that an allocator is available (i.e. it uses alloc).
Structs§
- Attributes
- Primary attributes for font matching:
FontWidth,FontStyleandFontWeight. - Axis
Info - An axis of variation for a variable font.
- Blob
- Shared data with an associated unique identifier.
- Charmap
- Mapping from Unicode codepoints to nominal glyph identifiers.
- Charmap
Index - Metadata for constructing a character map from font data.
- Collection
- Collection of fonts.
- Collection
Options - Options for a font collection.
- Fallback
Key - Describes a selector for fallback families.
- Family
Id - Unique identifier for a font family.
- Family
Info - Named set of fonts that are instances of a core design.
- Font
Info - Representation of a single font in a family.
- Font
Info Override - Helper for specifying aspects of a font’s metadata to be overridden when the
font is registered. Helpful when implementing a
@font-face-like API, which allows those defining the fonts to specify certain font properties manually. - Font
Weight - Visual weight class of a font, typically on a scale from 1.0 to 1000.0.
- Font
Width - Visual width of a font — a relative change from the normal aspect ratio, typically in the
range
0.5to2.0. - Language
- A compact, zero-allocation language tag.
- Query
- State for font selection.
- Query
Font - Candidate font generated by a
Query. - Script
- An ISO 15924 script identifier (four ASCII letters).
- Source
Cache - Cache for font data loaded from the file system.
- Source
Cache Options - Options for a source cache.
- Source
Id - Unique identifier for a font source.
- Source
Info - Handle that associates font data with a unique identifier.
- Synthesis
- Suggestions for synthesizing a set of font attributes for a given font.
Enums§
- Font
Style - Visual style or “slope” of a font.
- Generic
Family - Generic font families, named after CSS.
- Query
Family - Family descriptor for a font query.
- Query
Status - Determines whether a font query operation will continue.
- Source
Kind - Font data that is either a path to the font file or shared data in memory.
Traits§
- From
Fontconfig - Conversion from Fontconfig numeric values.
- Script
Ext