ttf-parser-utils 0.1.0

A crate with embolden, slant, and modify bbox utils for ttf-parser
Documentation
  • Coverage
  • 100%
    15 out of 15 items documented0 out of 10 items with examples
  • Size
  • Source code size: 31.91 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 621.83 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 17s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • TimTheBig/ttf-utils
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • TimTheBig

ttf-utils

Crates.io Documentation

Post-processing utilities for ttf-parser.

Example

Embolden and slant a glyph outline.

let face = ttf_parser::Face::from_slice(&font_data, 0)
  .unwrap();
let glyph_id = face.glyph_index('c').unwrap();
let mut outline = ttf_utils::Outline::new(&face, glyph_id).unwrap();
outline.embolden(20.0);
outline.oblique(0.25);
outline.emit(&mut builder);

Credits

The embolden algorithm is derived from the algorithm in FreeType.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.