13 releases (breaking)

new 0.10.1 Sep 28, 2023
0.9.0 Aug 4, 2023
0.8.0 Jul 20, 2023

#252 in Text processing

Download history 443/week @ 2023-06-09 504/week @ 2023-06-16 501/week @ 2023-06-23 251/week @ 2023-06-30 343/week @ 2023-07-07 364/week @ 2023-07-14 408/week @ 2023-07-21 495/week @ 2023-07-28 901/week @ 2023-08-04 468/week @ 2023-08-11 794/week @ 2023-08-18 1143/week @ 2023-08-25 823/week @ 2023-09-01 793/week @ 2023-09-08 606/week @ 2023-09-15 553/week @ 2023-09-22

2,981 downloads per month

MIT/Apache

2MB
40K 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 scaling

Current (✔️), near term (🔜) and planned (⌛) feature matrix:

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

* A working implementation exists for hinting but is not yet merged.

** This will be supported but is probably not desirable due the general affine transforms present in the paint graph.

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.

Dependencies