27 releases (breaking)

0.19.0 Apr 2, 2024
0.18.0 Mar 20, 2024
0.17.0 Mar 15, 2024
0.15.1 Dec 18, 2023
0.8.0 Jul 20, 2023

#81 in Parser implementations

Download history 1172/week @ 2023-12-30 537/week @ 2024-01-06 479/week @ 2024-01-13 693/week @ 2024-01-20 1764/week @ 2024-01-27 3332/week @ 2024-02-03 1778/week @ 2024-02-10 2440/week @ 2024-02-17 3449/week @ 2024-02-24 2686/week @ 2024-03-02 2474/week @ 2024-03-09 2228/week @ 2024-03-16 3936/week @ 2024-03-23 2503/week @ 2024-03-30 1636/week @ 2024-04-06

10,919 downloads per month
Used in 6 crates (3 directly)

MIT/Apache

2.5MB
54K SLoC

skrifa

Crates.io Docs MIT/Apache 2.0

This crate aims to be a robust, ergonomic, high performance library for reading OpenType fonts. It is built on top of the read-fonts low level parsing library and is also part of the oxidize project.

Features

Metadata

The following information is currently exposed:

  • Global font metrics with variation support (units per em, ascender, descender, etc)
  • Glyph metrics with variation support (advance width, left side-bearing, etc)
  • Codepoint to nominal glyph identifier mapping
    • Unicode variation sequences
  • Localized strings
  • Attributes (stretch, style and weight)
  • Variation axes and named instances
    • Conversion from user coordinates to normalized design coordinates

Future goals include:

  • Color palettes
  • Embedded bitmap strikes

Glyph formats

Source Decoding Variations Hinting
glyf ✔️ ✔️ ✔️
CFF ✔️ - ✔️
CFF2 ✔️ ✔️ ✔️
COLRv0 ✔️ - -
COLRv1 ✔️ ✔️ -
EBDT ✔️* - -
CBDT ✔️* - -
sbix ✔️* - -

* Raw support available through the read-fonts crate.

Panicking

This library should not panic regardless of API misuse or use of corrupted/malicious font files. Please file an issue if this occurs.

The name?

Following along with our theme, skrifa is Old Norse for "write" or "it is written." And so it is named.

Safety

Unsafe code is forbidden by a #![forbid(unsafe_code)] attribute in the root of the library.

Dependencies

~0.5–1MB
~24K SLoC