30 releases (19 breaking)

0.19.3 May 30, 2024
0.19.1 Apr 29, 2024
0.18.0 Mar 20, 2024
0.15.1 Dec 18, 2023
0.8.0 Jul 20, 2023

#66 in Parser implementations

Download history 2561/week @ 2024-02-21 3461/week @ 2024-02-28 2218/week @ 2024-03-06 2520/week @ 2024-03-13 3021/week @ 2024-03-20 3281/week @ 2024-03-27 2451/week @ 2024-04-03 2577/week @ 2024-04-10 2234/week @ 2024-04-17 3168/week @ 2024-04-24 3691/week @ 2024-05-01 3006/week @ 2024-05-08 2618/week @ 2024-05-15 3475/week @ 2024-05-22 4810/week @ 2024-05-29 1861/week @ 2024-06-05

13,078 downloads per month
Used in 13 crates (6 directly)

MIT/Apache

2.5MB
56K 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
~23K SLoC