write-fonts 0.0.5

Writing font files.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
// 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::*;

pub use read_fonts::tables::stat::AxisValueTableFlags;

/// [STAT](https://docs.microsoft.com/en-us/typography/opentype/spec/stat) (Style Attributes Table)
#[derive(Clone, Debug, Default)]
pub struct Stat {
    /// Offset in bytes from the beginning of the STAT table to the
    /// start of the design axes array. If designAxisCount is zero, set
    /// to zero; if designAxisCount is greater than zero, must be
    /// greater than zero.
    pub design_axes: OffsetMarker<Vec<AxisRecord>, WIDTH_32>,
    /// Offset in bytes from the beginning of the STAT table to the
    /// start of the design axes value offsets array. If axisValueCount
    /// is zero, set to zero; if axisValueCount is greater than zero,
    /// must be greater than zero.
    pub offset_to_axis_values: OffsetMarker<Vec<OffsetMarker<AxisValue>>, WIDTH_32>,
    /// Name ID used as fallback when projection of names into a
    /// particular font model produces a subfamily name containing only
    /// elidable elements.
    pub elided_fallback_name_id: Option<u16>,
}

impl FontWrite for Stat {
    #[allow(clippy::unnecessary_cast)]
    fn write_into(&self, writer: &mut TableWriter) {
        let version = MajorMinor::VERSION_1_2 as MajorMinor;
        version.write_into(writer);
        (8 as u16).write_into(writer);
        (array_len(&self.design_axes).unwrap() as u16).write_into(writer);
        self.design_axes.write_into(writer);
        (array_len(&self.offset_to_axis_values).unwrap() as u16).write_into(writer);
        self.offset_to_axis_values.write_into(writer);
        version.compatible((1, 1)).then(|| {
            self.elided_fallback_name_id
                .as_ref()
                .expect("missing versioned field should have failed validation")
                .write_into(writer)
        });
    }
}

impl Validate for Stat {
    fn validate_impl(&self, ctx: &mut ValidationCtx) {
        ctx.in_table("Stat", |ctx| {
            let version: MajorMinor = MajorMinor::VERSION_1_2;
            ctx.in_field("design_axes", |ctx| {
                self.design_axes.validate_impl(ctx);
            });
            ctx.in_field("offset_to_axis_values", |ctx| {
                self.offset_to_axis_values.validate_impl(ctx);
            });
            ctx.in_field("elided_fallback_name_id", |ctx| {
                if version.compatible((1, 1)) && self.elided_fallback_name_id.is_none() {
                    ctx.report(format!("field must be present for version {version}"));
                }
            });
        })
    }
}

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

impl<'a> FromObjRef<read_fonts::tables::stat::Stat<'a>> for Stat {
    fn from_obj_ref(obj: &read_fonts::tables::stat::Stat<'a>, _: FontData) -> Self {
        let offset_data = obj.offset_data();
        Stat {
            design_axes: obj.design_axes().to_owned_obj(offset_data),
            offset_to_axis_values: convert_axis_value_offsets(obj.offset_to_axis_values()),
            elided_fallback_name_id: obj.elided_fallback_name_id(),
        }
    }
}

impl<'a> FromTableRef<read_fonts::tables::stat::Stat<'a>> for Stat {}

impl<'a> FontRead<'a> for Stat {
    fn read(data: FontData<'a>) -> Result<Self, ReadError> {
        <read_fonts::tables::stat::Stat as FontRead>::read(data).map(|x| x.to_owned_table())
    }
}

/// [Axis Records](https://docs.microsoft.com/en-us/typography/opentype/spec/stat#axis-records)
#[derive(Clone, Debug, Default)]
pub struct AxisRecord {
    /// A tag identifying the axis of design variation.
    pub axis_tag: Tag,
    /// The name ID for entries in the 'name' table that provide a
    /// display string for this axis.
    pub axis_name_id: u16,
    /// A value that applications can use to determine primary sorting
    /// of face names, or for ordering of labels when composing family
    /// or face names.
    pub axis_ordering: u16,
}

impl AxisRecord {
    /// Construct a new `AxisRecord`
    pub fn new(axis_tag: Tag, axis_name_id: u16, axis_ordering: u16) -> Self {
        Self {
            axis_tag,
            axis_name_id,
            axis_ordering,
        }
    }
}

impl FontWrite for AxisRecord {
    fn write_into(&self, writer: &mut TableWriter) {
        self.axis_tag.write_into(writer);
        self.axis_name_id.write_into(writer);
        self.axis_ordering.write_into(writer);
    }
}

impl Validate for AxisRecord {
    fn validate_impl(&self, _ctx: &mut ValidationCtx) {}
}

impl FromObjRef<read_fonts::tables::stat::AxisRecord> for AxisRecord {
    fn from_obj_ref(obj: &read_fonts::tables::stat::AxisRecord, _: FontData) -> Self {
        AxisRecord {
            axis_tag: obj.axis_tag(),
            axis_name_id: obj.axis_name_id(),
            axis_ordering: obj.axis_ordering(),
        }
    }
}

/// An array of [AxisValue] tables.
#[derive(Clone, Debug, Default)]
pub struct AxisValueArray {
    /// Array of offsets to axis value tables, in bytes from the start
    /// of the axis value offsets array.
    pub axis_values: Vec<OffsetMarker<AxisValue>>,
}

impl AxisValueArray {
    /// Construct a new `AxisValueArray`
    pub fn new(axis_values: Vec<AxisValue>) -> Self {
        Self {
            axis_values: axis_values.into_iter().map(Into::into).collect(),
        }
    }
}

impl FontWrite for AxisValueArray {
    fn write_into(&self, writer: &mut TableWriter) {
        self.axis_values.write_into(writer);
    }
}

impl Validate for AxisValueArray {
    fn validate_impl(&self, ctx: &mut ValidationCtx) {
        ctx.in_table("AxisValueArray", |ctx| {
            ctx.in_field("axis_values", |ctx| {
                if self.axis_values.len() > (u16::MAX as usize) {
                    ctx.report("array excedes max length");
                }
                self.axis_values.validate_impl(ctx);
            });
        })
    }
}

impl<'a> FromObjRef<read_fonts::tables::stat::AxisValueArray<'a>> for AxisValueArray {
    fn from_obj_ref(obj: &read_fonts::tables::stat::AxisValueArray<'a>, _: FontData) -> Self {
        AxisValueArray {
            axis_values: obj.axis_values().map(|x| x.to_owned_table()).collect(),
        }
    }
}

impl<'a> FromTableRef<read_fonts::tables::stat::AxisValueArray<'a>> for AxisValueArray {}

/// [Axis Value Tables](https://docs.microsoft.com/en-us/typography/opentype/spec/stat#axis-value-tables)
#[derive(Clone, Debug)]
pub enum AxisValue {
    Format1(AxisValueFormat1),
    Format2(AxisValueFormat2),
    Format3(AxisValueFormat3),
    Format4(AxisValueFormat4),
}

impl AxisValue {
    /// Construct a new `AxisValueFormat1` subtable
    pub fn format_1(
        axis_index: u16,
        flags: AxisValueTableFlags,
        value_name_id: u16,
        value: Fixed,
    ) -> Self {
        Self::Format1(AxisValueFormat1::new(
            axis_index,
            flags,
            value_name_id,
            value,
        ))
    }

    /// Construct a new `AxisValueFormat2` subtable
    pub fn format_2(
        axis_index: u16,
        flags: AxisValueTableFlags,
        value_name_id: u16,
        nominal_value: Fixed,
        range_min_value: Fixed,
        range_max_value: Fixed,
    ) -> Self {
        Self::Format2(AxisValueFormat2::new(
            axis_index,
            flags,
            value_name_id,
            nominal_value,
            range_min_value,
            range_max_value,
        ))
    }

    /// Construct a new `AxisValueFormat3` subtable
    pub fn format_3(
        axis_index: u16,
        flags: AxisValueTableFlags,
        value_name_id: u16,
        value: Fixed,
        linked_value: Fixed,
    ) -> Self {
        Self::Format3(AxisValueFormat3::new(
            axis_index,
            flags,
            value_name_id,
            value,
            linked_value,
        ))
    }

    /// Construct a new `AxisValueFormat4` subtable
    pub fn format_4(
        flags: AxisValueTableFlags,
        value_name_id: u16,
        axis_values: Vec<AxisValueRecord>,
    ) -> Self {
        Self::Format4(AxisValueFormat4::new(flags, value_name_id, axis_values))
    }
}

impl Default for AxisValue {
    fn default() -> Self {
        Self::Format1(Default::default())
    }
}

impl FontWrite for AxisValue {
    fn write_into(&self, writer: &mut TableWriter) {
        match self {
            Self::Format1(item) => item.write_into(writer),
            Self::Format2(item) => item.write_into(writer),
            Self::Format3(item) => item.write_into(writer),
            Self::Format4(item) => item.write_into(writer),
        }
    }
}

impl Validate for AxisValue {
    fn validate_impl(&self, ctx: &mut ValidationCtx) {
        match self {
            Self::Format1(item) => item.validate_impl(ctx),
            Self::Format2(item) => item.validate_impl(ctx),
            Self::Format3(item) => item.validate_impl(ctx),
            Self::Format4(item) => item.validate_impl(ctx),
        }
    }
}

impl FromObjRef<read_fonts::tables::stat::AxisValue<'_>> for AxisValue {
    fn from_obj_ref(obj: &read_fonts::tables::stat::AxisValue, _: FontData) -> Self {
        use read_fonts::tables::stat::AxisValue as ObjRefType;
        match obj {
            ObjRefType::Format1(item) => AxisValue::Format1(item.to_owned_table()),
            ObjRefType::Format2(item) => AxisValue::Format2(item.to_owned_table()),
            ObjRefType::Format3(item) => AxisValue::Format3(item.to_owned_table()),
            ObjRefType::Format4(item) => AxisValue::Format4(item.to_owned_table()),
        }
    }
}

impl FromTableRef<read_fonts::tables::stat::AxisValue<'_>> for AxisValue {}

impl<'a> FontRead<'a> for AxisValue {
    fn read(data: FontData<'a>) -> Result<Self, ReadError> {
        <read_fonts::tables::stat::AxisValue as FontRead>::read(data).map(|x| x.to_owned_table())
    }
}

/// [Axis value table format 1](https://docs.microsoft.com/en-us/typography/opentype/spec/stat#axis-value-table-format-1)
#[derive(Clone, Debug, Default)]
pub struct AxisValueFormat1 {
    /// Zero-base index into the axis record array identifying the axis
    /// of design variation to which the axis value table applies. Must
    /// be less than designAxisCount.
    pub axis_index: u16,
    /// Flags — see below for details.
    pub flags: AxisValueTableFlags,
    /// The name ID for entries in the 'name' table that provide a
    /// display string for this attribute value.
    pub value_name_id: u16,
    /// A numeric value for this attribute value.
    pub value: Fixed,
}

impl AxisValueFormat1 {
    /// Construct a new `AxisValueFormat1`
    pub fn new(
        axis_index: u16,
        flags: AxisValueTableFlags,
        value_name_id: u16,
        value: Fixed,
    ) -> Self {
        Self {
            axis_index,
            flags,
            value_name_id,
            value,
        }
    }
}

impl FontWrite for AxisValueFormat1 {
    #[allow(clippy::unnecessary_cast)]
    fn write_into(&self, writer: &mut TableWriter) {
        (1 as u16).write_into(writer);
        self.axis_index.write_into(writer);
        self.flags.write_into(writer);
        self.value_name_id.write_into(writer);
        self.value.write_into(writer);
    }
}

impl Validate for AxisValueFormat1 {
    fn validate_impl(&self, _ctx: &mut ValidationCtx) {}
}

impl<'a> FromObjRef<read_fonts::tables::stat::AxisValueFormat1<'a>> for AxisValueFormat1 {
    fn from_obj_ref(obj: &read_fonts::tables::stat::AxisValueFormat1<'a>, _: FontData) -> Self {
        AxisValueFormat1 {
            axis_index: obj.axis_index(),
            flags: obj.flags(),
            value_name_id: obj.value_name_id(),
            value: obj.value(),
        }
    }
}

impl<'a> FromTableRef<read_fonts::tables::stat::AxisValueFormat1<'a>> for AxisValueFormat1 {}

impl<'a> FontRead<'a> for AxisValueFormat1 {
    fn read(data: FontData<'a>) -> Result<Self, ReadError> {
        <read_fonts::tables::stat::AxisValueFormat1 as FontRead>::read(data)
            .map(|x| x.to_owned_table())
    }
}

/// [Axis value table format 2](https://docs.microsoft.com/en-us/typography/opentype/spec/stat#axis-value-table-format-2)
#[derive(Clone, Debug, Default)]
pub struct AxisValueFormat2 {
    /// Zero-base index into the axis record array identifying the axis
    /// of design variation to which the axis value table applies. Must
    /// be less than designAxisCount.
    pub axis_index: u16,
    /// Flags — see below for details.
    pub flags: AxisValueTableFlags,
    /// The name ID for entries in the 'name' table that provide a
    /// display string for this attribute value.
    pub value_name_id: u16,
    /// A nominal numeric value for this attribute value.
    pub nominal_value: Fixed,
    /// The minimum value for a range associated with the specified
    /// name ID.
    pub range_min_value: Fixed,
    /// The maximum value for a range associated with the specified
    /// name ID.
    pub range_max_value: Fixed,
}

impl AxisValueFormat2 {
    /// Construct a new `AxisValueFormat2`
    pub fn new(
        axis_index: u16,
        flags: AxisValueTableFlags,
        value_name_id: u16,
        nominal_value: Fixed,
        range_min_value: Fixed,
        range_max_value: Fixed,
    ) -> Self {
        Self {
            axis_index,
            flags,
            value_name_id,
            nominal_value,
            range_min_value,
            range_max_value,
        }
    }
}

impl FontWrite for AxisValueFormat2 {
    #[allow(clippy::unnecessary_cast)]
    fn write_into(&self, writer: &mut TableWriter) {
        (2 as u16).write_into(writer);
        self.axis_index.write_into(writer);
        self.flags.write_into(writer);
        self.value_name_id.write_into(writer);
        self.nominal_value.write_into(writer);
        self.range_min_value.write_into(writer);
        self.range_max_value.write_into(writer);
    }
}

impl Validate for AxisValueFormat2 {
    fn validate_impl(&self, _ctx: &mut ValidationCtx) {}
}

impl<'a> FromObjRef<read_fonts::tables::stat::AxisValueFormat2<'a>> for AxisValueFormat2 {
    fn from_obj_ref(obj: &read_fonts::tables::stat::AxisValueFormat2<'a>, _: FontData) -> Self {
        AxisValueFormat2 {
            axis_index: obj.axis_index(),
            flags: obj.flags(),
            value_name_id: obj.value_name_id(),
            nominal_value: obj.nominal_value(),
            range_min_value: obj.range_min_value(),
            range_max_value: obj.range_max_value(),
        }
    }
}

impl<'a> FromTableRef<read_fonts::tables::stat::AxisValueFormat2<'a>> for AxisValueFormat2 {}

impl<'a> FontRead<'a> for AxisValueFormat2 {
    fn read(data: FontData<'a>) -> Result<Self, ReadError> {
        <read_fonts::tables::stat::AxisValueFormat2 as FontRead>::read(data)
            .map(|x| x.to_owned_table())
    }
}

/// [Axis value table format 3](https://docs.microsoft.com/en-us/typography/opentype/spec/stat#axis-value-table-format-3)
#[derive(Clone, Debug, Default)]
pub struct AxisValueFormat3 {
    /// Zero-base index into the axis record array identifying the axis
    /// of design variation to which the axis value table applies. Must
    /// be less than designAxisCount.
    pub axis_index: u16,
    /// Flags — see below for details.
    pub flags: AxisValueTableFlags,
    /// The name ID for entries in the 'name' table that provide a
    /// display string for this attribute value.
    pub value_name_id: u16,
    /// A numeric value for this attribute value.
    pub value: Fixed,
    /// The numeric value for a style-linked mapping from this value.
    pub linked_value: Fixed,
}

impl AxisValueFormat3 {
    /// Construct a new `AxisValueFormat3`
    pub fn new(
        axis_index: u16,
        flags: AxisValueTableFlags,
        value_name_id: u16,
        value: Fixed,
        linked_value: Fixed,
    ) -> Self {
        Self {
            axis_index,
            flags,
            value_name_id,
            value,
            linked_value,
        }
    }
}

impl FontWrite for AxisValueFormat3 {
    #[allow(clippy::unnecessary_cast)]
    fn write_into(&self, writer: &mut TableWriter) {
        (3 as u16).write_into(writer);
        self.axis_index.write_into(writer);
        self.flags.write_into(writer);
        self.value_name_id.write_into(writer);
        self.value.write_into(writer);
        self.linked_value.write_into(writer);
    }
}

impl Validate for AxisValueFormat3 {
    fn validate_impl(&self, _ctx: &mut ValidationCtx) {}
}

impl<'a> FromObjRef<read_fonts::tables::stat::AxisValueFormat3<'a>> for AxisValueFormat3 {
    fn from_obj_ref(obj: &read_fonts::tables::stat::AxisValueFormat3<'a>, _: FontData) -> Self {
        AxisValueFormat3 {
            axis_index: obj.axis_index(),
            flags: obj.flags(),
            value_name_id: obj.value_name_id(),
            value: obj.value(),
            linked_value: obj.linked_value(),
        }
    }
}

impl<'a> FromTableRef<read_fonts::tables::stat::AxisValueFormat3<'a>> for AxisValueFormat3 {}

impl<'a> FontRead<'a> for AxisValueFormat3 {
    fn read(data: FontData<'a>) -> Result<Self, ReadError> {
        <read_fonts::tables::stat::AxisValueFormat3 as FontRead>::read(data)
            .map(|x| x.to_owned_table())
    }
}

/// [Axis value table format 4](https://docs.microsoft.com/en-us/typography/opentype/spec/stat#axis-value-table-format-4)
#[derive(Clone, Debug, Default)]
pub struct AxisValueFormat4 {
    /// Flags — see below for details.
    pub flags: AxisValueTableFlags,
    /// The name ID for entries in the 'name' table that provide a
    /// display string for this combination of axis values.
    pub value_name_id: u16,
    /// Array of AxisValue records that provide the combination of axis
    /// values, one for each contributing axis.
    pub axis_values: Vec<AxisValueRecord>,
}

impl AxisValueFormat4 {
    /// Construct a new `AxisValueFormat4`
    pub fn new(
        flags: AxisValueTableFlags,
        value_name_id: u16,
        axis_values: Vec<AxisValueRecord>,
    ) -> Self {
        Self {
            flags,
            value_name_id,
            axis_values: axis_values.into_iter().map(Into::into).collect(),
        }
    }
}

impl FontWrite for AxisValueFormat4 {
    #[allow(clippy::unnecessary_cast)]
    fn write_into(&self, writer: &mut TableWriter) {
        (4 as u16).write_into(writer);
        (array_len(&self.axis_values).unwrap() as u16).write_into(writer);
        self.flags.write_into(writer);
        self.value_name_id.write_into(writer);
        self.axis_values.write_into(writer);
    }
}

impl Validate for AxisValueFormat4 {
    fn validate_impl(&self, ctx: &mut ValidationCtx) {
        ctx.in_table("AxisValueFormat4", |ctx| {
            ctx.in_field("axis_values", |ctx| {
                if self.axis_values.len() > (u16::MAX as usize) {
                    ctx.report("array excedes max length");
                }
                self.axis_values.validate_impl(ctx);
            });
        })
    }
}

impl<'a> FromObjRef<read_fonts::tables::stat::AxisValueFormat4<'a>> for AxisValueFormat4 {
    fn from_obj_ref(obj: &read_fonts::tables::stat::AxisValueFormat4<'a>, _: FontData) -> Self {
        let offset_data = obj.offset_data();
        AxisValueFormat4 {
            flags: obj.flags(),
            value_name_id: obj.value_name_id(),
            axis_values: obj.axis_values().to_owned_obj(offset_data),
        }
    }
}

impl<'a> FromTableRef<read_fonts::tables::stat::AxisValueFormat4<'a>> for AxisValueFormat4 {}

impl<'a> FontRead<'a> for AxisValueFormat4 {
    fn read(data: FontData<'a>) -> Result<Self, ReadError> {
        <read_fonts::tables::stat::AxisValueFormat4 as FontRead>::read(data)
            .map(|x| x.to_owned_table())
    }
}

/// Part of [AxisValueFormat4]
#[derive(Clone, Debug, Default)]
pub struct AxisValueRecord {
    /// Zero-base index into the axis record array identifying the axis
    /// to which this value applies. Must be less than designAxisCount.
    pub axis_index: u16,
    /// A numeric value for this attribute value.
    pub value: Fixed,
}

impl AxisValueRecord {
    /// Construct a new `AxisValueRecord`
    pub fn new(axis_index: u16, value: Fixed) -> Self {
        Self { axis_index, value }
    }
}

impl FontWrite for AxisValueRecord {
    fn write_into(&self, writer: &mut TableWriter) {
        self.axis_index.write_into(writer);
        self.value.write_into(writer);
    }
}

impl Validate for AxisValueRecord {
    fn validate_impl(&self, _ctx: &mut ValidationCtx) {}
}

impl FromObjRef<read_fonts::tables::stat::AxisValueRecord> for AxisValueRecord {
    fn from_obj_ref(obj: &read_fonts::tables::stat::AxisValueRecord, _: FontData) -> Self {
        AxisValueRecord {
            axis_index: obj.axis_index(),
            value: obj.value(),
        }
    }
}

impl FontWrite for AxisValueTableFlags {
    fn write_into(&self, writer: &mut TableWriter) {
        writer.write_slice(&self.bits().to_be_bytes())
    }
}