Crate ttf_parser[][src]

A high-level, safe, zero-allocation TrueType font parser.

Features

Safety

Error handling

ttf-parser is designed to parse well-formed fonts, so it does not have an Error enum. It doesn’t mean that it will crash or panic on malformed fonts, only that the error handling will boil down to Option::None. So you will not get a detailed cause of an error. By doing so we can simplify an API quite a lot since otherwise, we will have to use Result<Option<T>, Error>.

Modules

kern

A kerning table implementation.

name_id

A list of name ID’s.

Structs

Class

A value of Class Definition Table.

Font

A font data handle.

GlyphId

A type-safe wrapper for glyph ID.

LineMetrics

A line metrics.

Name

A Name Record.

Names

An iterator over font’s names.

RasterGlyphImage

A glyph’s raster image.

Rect

A rectangle.

ScriptMetrics

A script metrics used by subscript and superscript.

Tag

A 4-byte tag.

Variation

A font variation value.

VariationAxes

An iterator over variation axes.

VariationAxis

A variation axis.

Enums

GlyphClass

A glyph class.

PlatformId

A platform ID.

RasterImageFormat

A glyph raster image format.

TableName

A table name.

Weight

A font weight.

Width

A font width.

Traits

OutlineBuilder

A trait for glyph outline construction.

Functions

fonts_in_collection

Returns the number of fonts stored in a TrueType font collection.