46 releases (26 breaking)

new 0.26.2 Dec 12, 2024
0.26.0 Nov 20, 2024
0.23.3 Dec 12, 2024
0.20.0 Jul 25, 2024
0.8.0 Jul 20, 2023

#48 in Parser implementations

Download history 16379/week @ 2024-08-22 17189/week @ 2024-08-29 20359/week @ 2024-09-05 20804/week @ 2024-09-12 22161/week @ 2024-09-19 24456/week @ 2024-09-26 28332/week @ 2024-10-03 22128/week @ 2024-10-10 19306/week @ 2024-10-17 18882/week @ 2024-10-24 22727/week @ 2024-10-31 20049/week @ 2024-11-07 21985/week @ 2024-11-14 21847/week @ 2024-11-21 26601/week @ 2024-11-28 20067/week @ 2024-12-05

93,526 downloads per month
Used in 258 crates (10 directly)

MIT/Apache

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