artery-font

Crates.ioartery-font
lib.rsartery-font
version1.0.1
sourcesrc
created_at2022-04-10 11:42:18.453625
updated_at2022-04-10 11:57:10.081847
descriptionA pure rust parser for artery font files
homepage
repositoryhttps://github.com/sidit77/artery-font/
max_upload_size
id565051
size26,747
(sidit77)

documentation

README

artery-font

A pure Rust parser for Artery Atlas font files. An Artery Atlas font file (*.arfont) wraps together the atlas bitmap(s), which can be compressed e.g. in PNG format, the layout of the atlas, as well as the font's and the individual glyphs' metrics and positioning data, including kerning pairs.

Artery Atlas font files can be generated using the Multi-channel signed distance field atlas generator.

This is a port of the C++ Reference Implementation.

Currently only PNG and RawBinary are supported as images.

Example

let arfont = ArteryFont::read(&include_bytes!("../data/test.arfont")[..]).unwrap();
let image = arfont.images.first().unwrap();
let variant = arfont.variants.first().unwrap();
assert_eq!(variant.image_type, ImageType::Msdf);
assert_eq!(variant.codepoint_type, CodepointType::Unicode);
let line_height = variant.metrics.line_height;

See the full Example

Cargo features

  • double: Configures this library to use f64 instead of f32 for floating point values. Needs to match the exporter.
  • no-checksum: Disables checksum calculation and verification. Note: this flag only affects this library and has no effect on the embedded image loading crates.
  • png: enables support for png compression

License

MIT License

Commit count: 26

cargo fmt