Skip to main content

write_fonts/generated/
generated_cvar.rs

1// THIS FILE IS AUTOGENERATED.
2// Any changes to this file will be overwritten.
3// For more information about how codegen works, see font-codegen/README.md
4
5#[allow(unused_imports)]
6use crate::codegen_prelude::*;
7
8/// The [cvar](https://learn.microsoft.com/en-us/typography/opentype/spec/cvar) table.
9#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11pub struct Cvar {
12    /// Array of tuple variation headers.
13    pub tuple_variation_headers: CvarVariationData,
14}
15
16impl FontWrite for Cvar {
17    #[allow(clippy::unnecessary_cast)]
18    fn write_into(&self, writer: &mut TableWriter) {
19        (MajorMinor::VERSION_1_0 as MajorMinor).write_into(writer);
20        self.tuple_variation_headers.write_into(writer);
21    }
22    fn table_type(&self) -> TableType {
23        TableType::TopLevel(Cvar::TAG)
24    }
25}
26
27impl Validate for Cvar {
28    fn validate_impl(&self, ctx: &mut ValidationCtx) {
29        ctx.in_table("Cvar", |ctx| {
30            ctx.in_field("tuple_variation_headers", |ctx| {
31                self.tuple_variation_headers.validate_impl(ctx);
32            });
33        })
34    }
35}
36
37impl TopLevelTable for Cvar {
38    const TAG: Tag = Tag::new(b"cvar");
39}