#opentype #pdf #subsetting

subsetter

Reduces the size and coverage of OpenType fonts

3 unstable releases

0.2.0 Sep 4, 2024
0.1.1 Mar 19, 2023
0.1.0 Oct 14, 2022

#286 in Encoding

Download history 936/week @ 2024-07-21 701/week @ 2024-07-28 986/week @ 2024-08-04 846/week @ 2024-08-11 973/week @ 2024-08-18 1011/week @ 2024-08-25 1198/week @ 2024-09-01 956/week @ 2024-09-08 940/week @ 2024-09-15 1191/week @ 2024-09-22 2075/week @ 2024-09-29 1676/week @ 2024-10-06 2103/week @ 2024-10-13 2223/week @ 2024-10-20 1729/week @ 2024-10-27 1927/week @ 2024-11-03

8,115 downloads per month
Used in 11 crates (4 directly)

MIT/Apache

135KB
3K SLoC

subsetter

Crates.io Documentation

Reduces the size and coverage of OpenType fonts with TrueType or CFF outlines for embedding in PDFs. You can in general expect very good results in terms of font size, as most of the things that can be subsetted are also subsetted.

Scope

Note that the resulting font subsets will most likely be unusable in any other contexts than PDF writing, since a lot of information will be removed from the font which is not necessary in PDFs, but is necessary in other contexts. This is on purpose, and for now, there are no plans to expand the scope of this crate to become a general purpose subsetter, as this is a massive undertaking and will make the already complex codebase even more complex.

In the future, klippa will hopefully fill this gap.

For an example on how to use this crate, have a look at the documentation.

Limitations

As mentioned above, this crate is specifically aimed at subsetting a font with the purpose of including it in a PDF file. For any other purposes, this crate will most likely not be very useful.

Potential future work could include allowing to define variation coordinates for which to generate the subset for. However, apart from that there are no plans to increase the scope of this crate, apart from fixing bugs and adding new APIs to the existing interface.

Safety and Dependencies

This crate forbids unsafe code and has zero dependencies.

License

This crate is dual-licensed under the MIT and Apache 2.0 licenses.

No runtime deps