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 dsig;
12pub mod fvar;
13pub mod gasp;
14pub mod gdef;
15pub mod glyf;
16pub mod gpos;
17pub mod gsub;
18pub mod gvar;
19pub mod head;
20pub mod hhea;
21pub mod hmtx;
22pub mod hvar;
23pub mod layout;
24pub mod loca;
25pub mod maxp;
26pub mod meta;
27pub mod mvar;
28pub mod name;
29pub mod os2;
30pub mod post;
31pub mod sbix;
32pub mod stat;
33pub mod variations;
34pub mod vhea;
35pub mod vmtx;
36pub mod vvar;
37
38#[cfg(feature = "ift")]
39pub mod ift;
40
41// ensure that all of our types implement the serde traits
42#[cfg(feature = "serde")]
43#[test]
44fn do_we_even_serde() {
45    #[derive(Default, serde::Deserialize, serde::Serialize)]
46    struct AllTables {
47        avar: avar::Avar,
48        base: base::Base,
49        cmap: cmap::Cmap,
50        cpal: cpal::Cpal,
51        dsig: dsig::Dsig,
52        fvar: fvar::Fvar,
53        gasp: gasp::Gasp,
54        gdef: gdef::Gdef,
55        glyf: glyf::Glyf,
56        gpos: gpos::Gpos,
57        gsub: gsub::Gsub,
58        gvar: gvar::Gvar,
59        head: head::Head,
60        hhea: hhea::Hhea,
61        hmtx: hmtx::Hmtx,
62        hvar: hvar::Hvar,
63        loca: loca::Loca,
64        maxp: maxp::Maxp,
65        meta: meta::Meta,
66        name: name::Name,
67        os2: os2::Os2,
68        post: post::Post,
69        sbix: sbix::Sbix,
70        stat: stat::Stat,
71        vhea: vhea::Vhea,
72        vmtx: vmtx::Vmtx,
73        vvar: vvar::Vvar,
74        ift: ift::Ift,
75    }
76    let tables = AllTables::default();
77    let dumped = bincode::serialize(&tables).unwrap();
78    let _loaded: AllTables = bincode::deserialize(&dumped).unwrap();
79}