1 | mod extended_kerning; |
2 | mod feature_mappings; |
3 | mod feature_selector; |
4 | mod map; |
5 | mod metamorphosis; |
6 | mod tracking; |
7 | |
8 | pub use map::*; |
9 | |
10 | use crate::buffer::Buffer; |
11 | use crate::plan::ShapePlan; |
12 | use crate::Face; |
13 | |
14 | pub fn substitute(plan: &ShapePlan, face: &Face, buffer: &mut Buffer) { |
15 | metamorphosis::apply(plan, face, buffer); |
16 | } |
17 | |
18 | pub fn position(plan: &ShapePlan, face: &Face, buffer: &mut Buffer) { |
19 | extended_kerning::apply(plan, face, buffer); |
20 | } |
21 | |
22 | pub fn track(plan: &ShapePlan, face: &Face, buffer: &mut Buffer) { |
23 | tracking::apply(plan, face, buffer); |
24 | } |
25 | |
26 | pub 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 | |
37 | pub fn remove_deleted_glyphs(buffer: &mut Buffer) { |
38 | buffer.delete_glyphs_inplace(|info: &GlyphInfo| info.glyph_id == 0xFFFF) |
39 | } |
40 | |