Crates.io | allsorts_no_std |
lib.rs | allsorts_no_std |
version | 0.5.2 |
source | src |
created_at | 2021-03-06 17:06:37.505039 |
updated_at | 2021-03-06 17:06:37.505039 |
description | Font parser, shaping engine, and subsetter for OpenType, WOFF, and WOFF2 |
homepage | https://github.com/yeslogic/allsorts |
repository | https://github.com/yeslogic/allsorts |
max_upload_size | |
id | 364854 |
size | 1,004,518 |
Allsorts is a font parser, shaping engine, and subsetter for OpenType, WOFF, and WOFF2 written entirely in Rust. It was extracted from Prince, a tool that typesets and lays out HTML and CSS documents into PDF.
The Allsorts shaping engine was developed in conjunction with a specification for OpenType shaping, which aims to specify OpenType font shaping behaviour.
ttf
), OpenType (otf
), WOFF, and WOFF2 files.Font shaping is the process of taking text in the form of Unicode codepoints and a font, and laying out glyphs from the font according to the text. This involves honouring kerning, ligatures, and substitutions specified by the font. For some languages this is relatively straightforward. For others, such as Indic scripts it is quite complex. After shaping, another library such as Pathfinder or FreeType is responsible for rendering the glyphs. To learn more about text rendering, Andrea Cognolato has a good overview of modern font rending on Linux. The concepts remain similar on other platforms.
Refer to the Allsorts Tools repository for a trio of tools that exercise Allsorts font parsing, shaping, and subsetting.
We don't currently support:
Known limitations:
cmap0
argument to
the subset function)
at the moment.Allsorts is still under active development but has reached its first release milestone with its inclusion in Prince 13. In Prince it is responsible for all font loading, and font shaping.
Currently the font parsing code is handwritten. It is planned for this to eventually be replaced by machine generated code via our declarative data definition language project.
Allsorts CI runs tests on Linux, macOS, and Windows. Via Prince it is also built for FreeBSD.
Minimum Supported Rust Version: 1.38.0
To build the crate ensure you have Rust 1.38.0 or newer installed.
Build with cargo build
and run the tests with cargo test
.
Contributions are welcome, please refer to the contributing document for more details.
We aim to uphold the Rust community standards:
We are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, disability, ethnicity, religion, or similar personal characteristic.
We follow the Rust code of conduct.
Allsorts is distributed under the terms of the Apache License (Version 2.0).
See LICENSE for details.