41 releases (24 breaking)

new 0.24.1 Nov 5, 2024
0.23.2 Nov 5, 2024
0.20.0 Jul 25, 2024
0.18.0 Mar 20, 2024
0.8.0 Jul 20, 2023

#47 in Parser implementations

Download history 18424/week @ 2024-07-21 18972/week @ 2024-07-28 22023/week @ 2024-08-04 22893/week @ 2024-08-11 16265/week @ 2024-08-18 16643/week @ 2024-08-25 17528/week @ 2024-09-01 20973/week @ 2024-09-08 22060/week @ 2024-09-15 22669/week @ 2024-09-22 24981/week @ 2024-09-29 26369/week @ 2024-10-06 21872/week @ 2024-10-13 18296/week @ 2024-10-20 20554/week @ 2024-10-27 21988/week @ 2024-11-03

84,666 downloads per month
Used in 157 crates (10 directly)

MIT/Apache

3.5MB
82K 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