write_fonts/
tables.rs

1//! A directory of all the font tables.
2
3// NOTE: if you add a new table, also add it to the test below to make sure
4// that serde works!
5
6pub mod avar;
7pub mod base;
8pub mod cmap;
9pub mod colr;
10pub mod cpal;
11pub mod fvar;
12pub mod gasp;
13pub mod gdef;
14pub mod glyf;
15pub mod gpos;
16pub mod gsub;
17pub mod gvar;
18pub mod head;
19pub mod hhea;
20pub mod hmtx;
21pub mod hvar;
22pub mod layout;
23pub mod loca;
24pub mod maxp;
25pub mod meta;
26pub mod mvar;
27pub mod name;
28pub mod os2;
29pub mod post;
30pub mod sbix;
31pub mod stat;
32pub mod variations;
33pub mod vhea;
34pub mod vmtx;
35
36#[cfg(feature = "ift")]
37pub mod ift;
38
39// ensure that all of our types implement the serde traits
40#[cfg(feature = "serde")]
41#[test]
42fn do_we_even_serde() {
43    #[derive(Default, serde::Deserialize, serde::Serialize)]
44    struct AllTables {
45        avar: avar::Avar,
46        base: base::Base,
47        cmap: cmap::Cmap,
48        cpal: cpal::Cpal,
49        fvar: fvar::Fvar,
50        gasp: gasp::Gasp,
51        gdef: gdef::Gdef,
52        glyf: glyf::Glyf,
53        gpos: gpos::Gpos,
54        gsub: gsub::Gsub,
55        gvar: gvar::Gvar,
56        head: head::Head,
57        hhea: hhea::Hhea,
58        hmtx: hmtx::Hmtx,
59        hvar: hvar::Hvar,
60        loca: loca::Loca,
61        maxp: maxp::Maxp,
62        meta: meta::Meta,
63        name: name::Name,
64        os2: os2::Os2,
65        post: post::Post,
66        sbix: sbix::Sbix,
67        stat: stat::Stat,
68        vhea: vhea::Vhea,
69        vmtx: vmtx::Vmtx,
70        ift: ift::Ift,
71    }
72    let tables = AllTables::default();
73    let dumped = bincode::serialize(&tables).unwrap();
74    let _loaded: AllTables = bincode::deserialize(&dumped).unwrap();
75}