write-fonts 0.48.1

Writing font files.
Documentation
// THIS FILE IS AUTOGENERATED.
// Any changes to this file will be overwritten.
// For more information about how codegen works, see font-codegen/README.md

#[allow(unused_imports)]
use crate::codegen_prelude::*;

/// The [cvar](https://learn.microsoft.com/en-us/typography/opentype/spec/cvar) table.
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Cvar {
    /// Array of tuple variation headers.
    pub tuple_variation_headers: CvarVariationData,
}

impl FontWrite for Cvar {
    #[allow(clippy::unnecessary_cast)]
    fn write_into(&self, writer: &mut TableWriter) {
        (MajorMinor::VERSION_1_0 as MajorMinor).write_into(writer);
        self.tuple_variation_headers.write_into(writer);
    }
    fn table_type(&self) -> TableType {
        TableType::TopLevel(Cvar::TAG)
    }
}

impl Validate for Cvar {
    fn validate_impl(&self, ctx: &mut ValidationCtx) {
        ctx.in_table("Cvar", |ctx| {
            ctx.in_field("tuple_variation_headers", |ctx| {
                self.tuple_variation_headers.validate_impl(ctx);
            });
        })
    }
}

impl TopLevelTable for Cvar {
    const TAG: Tag = Tag::new(b"cvar");
}