1mod extended_kerning;
2mod feature_mappings;
3mod feature_selector;
4mod map;
5mod metamorphosis;
6mod tracking;
7
8pub use map::*;
9
10use crate::buffer::Buffer;
11use crate::plan::ShapePlan;
12use crate::Face;
13
14pub fn substitute(plan: &ShapePlan, face: &Face, buffer: &mut Buffer) {
15 metamorphosis::apply(plan, face, buffer);
16}
17
18pub fn position(plan: &ShapePlan, face: &Face, buffer: &mut Buffer) {
19 extended_kerning::apply(plan, face, buffer);
20}
21
22pub fn track(plan: &ShapePlan, face: &Face, buffer: &mut Buffer) {
23 tracking::apply(plan, face, buffer);
24}
25
26pub fn zero_width_deleted_glyphs(buffer: &mut Buffer) {
27 for i: usize in 0..buffer.len {
28 if buffer.info[i].glyph_id == 0xFFFF {
29 buffer.pos[i].x_advance = 0;
30 buffer.pos[i].y_advance = 0;
31 buffer.pos[i].x_offset = 0;
32 buffer.pos[i].y_offset = 0;
33 }
34 }
35}
36
37pub fn remove_deleted_glyphs(buffer: &mut Buffer) {
38 buffer.delete_glyphs_inplace(|info: &GlyphInfo| info.glyph_id == 0xFFFF)
39}
40