Skip to main content

ttf_view/tables/cmap/
format14.rs

1use crate::types::{Offset32, uint16, uint24, uint32};
2
3#[repr(C)]
4#[non_exhaustive]
5pub struct Format14 {
6    pub num_var_selector_records: uint32,
7    var_selectors: [VariationSelector; 0],
8}
9
10#[repr(C)]
11pub struct VariationSelector {
12    pub var_selector: uint24,
13    pub default_uvs_offset: Offset32,
14    pub non_default_uvs_offset: Offset32,
15}
16
17#[repr(C)]
18#[non_exhaustive]
19pub struct DefaultUvsTable {
20    pub num_unicode_value_ranges: uint32,
21    ranges: [UnicodeRange; 0],
22}
23
24#[repr(C)]
25pub struct UnicodeRange {
26    pub start_unicode_value: uint24,
27    pub additional_count: u8,
28}
29
30#[repr(C)]
31#[non_exhaustive]
32pub struct NonDefaultUvsTable {
33    pub num_uvs_mappings: uint32,
34    uvs_mappings: [UvsMapping; 0],
35}
36
37#[repr(C)]
38pub struct UvsMapping {
39    pub unicode_value: uint24,
40    pub glyph_id: uint16,
41}
42
43impl super::CmapSubtableTrait for Format14 {
44    const FORMAT: u16 = 14;
45}
46
47// TODO: 'cmap' subtable format 14