[][src]Crate ttf_parser

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

Goals

  • A high-level API.
  • Zero allocations.
  • Zero unsafe.
  • Zero dependencies.
  • Fast.
  • Simple and maintainable code (no magic numbers).

Limitations

  • Non ARGS_ARE_XY_VALUES transform is not supported yet.
  • Only 0, 4, 12 and 13 formats of cmap table are supported.

Safety

  • The library heavily relies on Rust's bounds checking and assumes that font is well-formed. You can invoke a checksums checking manually.
  • The library uses per table slices, so it can't read data outside the specified TrueType table.
  • The library forbids unsafe code.

Modules

cmap

The cmap table parsing primitives.

gdef

The GDEF table parsing primitives.

glyf

The glyf table parsing primitives.

hmtx

The hmtx table parsing primitives.

loca

The loca table parsing primitives.

name

The name table parsing primitives.

os2

The OS/2 table parsing primitives.

post

The post table parsing primitives.

Structs

Font

A font data handle.

LineMetrics

A line metrics.

Rect

Rectangle.

Tag

A TrueType's Tag data type.

Enums

Error

A font parsing error.

Functions

fonts_in_collection

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