Crates.io | ttf-utils |
lib.rs | ttf-utils |
version | 0.1.3 |
source | src |
created_at | 2021-01-18 13:51:54.09505 |
updated_at | 2021-02-12 14:40:44.985499 |
description | ttf-parser utils |
homepage | |
repository | https://github.com/chrsan/ttf-utils |
max_upload_size | |
id | 343526 |
size | 31,780 |
Post-processing utilities for ttf-parser.
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);
The embolden algorithm is derived from the algorithm in FreeType.
Licensed under either of
at your option.
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.