#pdf #opentype #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

#73 in Compression

Download history 668/week @ 2024-07-02 976/week @ 2024-07-09 962/week @ 2024-07-16 759/week @ 2024-07-23 914/week @ 2024-07-30 875/week @ 2024-08-06 867/week @ 2024-08-13 995/week @ 2024-08-20 1022/week @ 2024-08-27 1183/week @ 2024-09-03 1016/week @ 2024-09-10 932/week @ 2024-09-17 1214/week @ 2024-09-24 2137/week @ 2024-10-01 1668/week @ 2024-10-08 2420/week @ 2024-10-15

7,609 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