Skip to main content

ttf_view/tables/cmap/
format0.rs

1use crate::tables::cmap::GlyphId;
2
3#[repr(C)]
4pub struct Format0 {
5    pub glyph_id_array: [u8; 256],
6}
7
8impl super::CmapSubtableTrait for Format0 {
9    const FORMAT: u16 = 0;
10}
11
12impl Format0 {
13    pub const fn map(&self, codepoint: u8) -> GlyphId {
14        self.glyph_id_array[codepoint as usize].into()
15    }
16}