read_fonts/generated/
generated_gvar.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 ['gvar' header](https://learn.microsoft.com/en-us/typography/opentype/spec/gvar#gvar-header)
9#[derive(Debug, Clone, Copy)]
10#[doc(hidden)]
11pub struct GvarMarker {
12    glyph_variation_data_offsets_byte_len: usize,
13}
14
15impl GvarMarker {
16    pub fn version_byte_range(&self) -> Range<usize> {
17        let start = 0;
18        start..start + MajorMinor::RAW_BYTE_LEN
19    }
20
21    pub fn axis_count_byte_range(&self) -> Range<usize> {
22        let start = self.version_byte_range().end;
23        start..start + u16::RAW_BYTE_LEN
24    }
25
26    pub fn shared_tuple_count_byte_range(&self) -> Range<usize> {
27        let start = self.axis_count_byte_range().end;
28        start..start + u16::RAW_BYTE_LEN
29    }
30
31    pub fn shared_tuples_offset_byte_range(&self) -> Range<usize> {
32        let start = self.shared_tuple_count_byte_range().end;
33        start..start + Offset32::RAW_BYTE_LEN
34    }
35
36    pub fn glyph_count_byte_range(&self) -> Range<usize> {
37        let start = self.shared_tuples_offset_byte_range().end;
38        start..start + u16::RAW_BYTE_LEN
39    }
40
41    pub fn flags_byte_range(&self) -> Range<usize> {
42        let start = self.glyph_count_byte_range().end;
43        start..start + GvarFlags::RAW_BYTE_LEN
44    }
45
46    pub fn glyph_variation_data_array_offset_byte_range(&self) -> Range<usize> {
47        let start = self.flags_byte_range().end;
48        start..start + u32::RAW_BYTE_LEN
49    }
50
51    pub fn glyph_variation_data_offsets_byte_range(&self) -> Range<usize> {
52        let start = self.glyph_variation_data_array_offset_byte_range().end;
53        start..start + self.glyph_variation_data_offsets_byte_len
54    }
55}
56
57impl MinByteRange for GvarMarker {
58    fn min_byte_range(&self) -> Range<usize> {
59        0..self.glyph_variation_data_offsets_byte_range().end
60    }
61}
62
63impl TopLevelTable for Gvar<'_> {
64    /// `gvar`
65    const TAG: Tag = Tag::new(b"gvar");
66}
67
68impl<'a> FontRead<'a> for Gvar<'a> {
69    fn read(data: FontData<'a>) -> Result<Self, ReadError> {
70        let mut cursor = data.cursor();
71        cursor.advance::<MajorMinor>();
72        cursor.advance::<u16>();
73        cursor.advance::<u16>();
74        cursor.advance::<Offset32>();
75        let glyph_count: u16 = cursor.read()?;
76        let flags: GvarFlags = cursor.read()?;
77        cursor.advance::<u32>();
78        let glyph_variation_data_offsets_byte_len = (transforms::add(glyph_count, 1_usize))
79            .checked_mul(<U16Or32 as ComputeSize>::compute_size(&flags)?)
80            .ok_or(ReadError::OutOfBounds)?;
81        cursor.advance_by(glyph_variation_data_offsets_byte_len);
82        cursor.finish(GvarMarker {
83            glyph_variation_data_offsets_byte_len,
84        })
85    }
86}
87
88/// The ['gvar' header](https://learn.microsoft.com/en-us/typography/opentype/spec/gvar#gvar-header)
89pub type Gvar<'a> = TableRef<'a, GvarMarker>;
90
91#[allow(clippy::needless_lifetimes)]
92impl<'a> Gvar<'a> {
93    /// Major/minor version number of the glyph variations table — set to (1,0).
94    pub fn version(&self) -> MajorMinor {
95        let range = self.shape.version_byte_range();
96        self.data.read_at(range.start).unwrap()
97    }
98
99    /// The number of variation axes for this font. This must be the
100    /// same number as axisCount in the 'fvar' table.
101    pub fn axis_count(&self) -> u16 {
102        let range = self.shape.axis_count_byte_range();
103        self.data.read_at(range.start).unwrap()
104    }
105
106    /// The number of shared tuple records. Shared tuple records can be
107    /// referenced within glyph variation data tables for multiple
108    /// glyphs, as opposed to other tuple records stored directly
109    /// within a glyph variation data table.
110    pub fn shared_tuple_count(&self) -> u16 {
111        let range = self.shape.shared_tuple_count_byte_range();
112        self.data.read_at(range.start).unwrap()
113    }
114
115    /// Offset from the start of this table to the shared tuple records.
116    pub fn shared_tuples_offset(&self) -> Offset32 {
117        let range = self.shape.shared_tuples_offset_byte_range();
118        self.data.read_at(range.start).unwrap()
119    }
120
121    /// Attempt to resolve [`shared_tuples_offset`][Self::shared_tuples_offset].
122    pub fn shared_tuples(&self) -> Result<SharedTuples<'a>, ReadError> {
123        let data = self.data;
124        let args = (self.shared_tuple_count(), self.axis_count());
125        self.shared_tuples_offset().resolve_with_args(data, &args)
126    }
127
128    /// The number of glyphs in this font. This must match the number
129    /// of glyphs stored elsewhere in the font.
130    pub fn glyph_count(&self) -> u16 {
131        let range = self.shape.glyph_count_byte_range();
132        self.data.read_at(range.start).unwrap()
133    }
134
135    /// Bit-field that gives the format of the offset array that
136    /// follows. If bit 0 is clear, the offsets are uint16; if bit 0 is
137    /// set, the offsets are uint32.
138    pub fn flags(&self) -> GvarFlags {
139        let range = self.shape.flags_byte_range();
140        self.data.read_at(range.start).unwrap()
141    }
142
143    /// Offset from the start of this table to the array of
144    /// GlyphVariationData tables.
145    pub fn glyph_variation_data_array_offset(&self) -> u32 {
146        let range = self.shape.glyph_variation_data_array_offset_byte_range();
147        self.data.read_at(range.start).unwrap()
148    }
149
150    /// Offsets from the start of the GlyphVariationData array to each
151    /// GlyphVariationData table.
152    pub fn glyph_variation_data_offsets(&self) -> ComputedArray<'a, U16Or32> {
153        let range = self.shape.glyph_variation_data_offsets_byte_range();
154        self.data.read_with_args(range, &self.flags()).unwrap()
155    }
156}
157
158#[cfg(feature = "experimental_traverse")]
159impl<'a> SomeTable<'a> for Gvar<'a> {
160    fn type_name(&self) -> &str {
161        "Gvar"
162    }
163    fn get_field(&self, idx: usize) -> Option<Field<'a>> {
164        match idx {
165            0usize => Some(Field::new("version", self.version())),
166            1usize => Some(Field::new("axis_count", self.axis_count())),
167            2usize => Some(Field::new("shared_tuple_count", self.shared_tuple_count())),
168            3usize => Some(Field::new(
169                "shared_tuples_offset",
170                FieldType::offset(self.shared_tuples_offset(), self.shared_tuples()),
171            )),
172            4usize => Some(Field::new("glyph_count", self.glyph_count())),
173            5usize => Some(Field::new("flags", self.flags())),
174            6usize => Some(Field::new(
175                "glyph_variation_data_array_offset",
176                self.glyph_variation_data_array_offset(),
177            )),
178            7usize => Some(Field::new(
179                "glyph_variation_data_offsets",
180                traversal::FieldType::Unknown,
181            )),
182            _ => None,
183        }
184    }
185}
186
187#[cfg(feature = "experimental_traverse")]
188#[allow(clippy::needless_lifetimes)]
189impl<'a> std::fmt::Debug for Gvar<'a> {
190    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
191        (self as &dyn SomeTable<'a>).fmt(f)
192    }
193}
194
195#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, bytemuck :: AnyBitPattern)]
196#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
197#[repr(transparent)]
198pub struct GvarFlags {
199    bits: u16,
200}
201
202impl GvarFlags {
203    /// If set, offsets to GlyphVariationData are 32 bits
204    pub const LONG_OFFSETS: Self = Self { bits: 1 };
205}
206
207impl GvarFlags {
208    ///  Returns an empty set of flags.
209    #[inline]
210    pub const fn empty() -> Self {
211        Self { bits: 0 }
212    }
213
214    /// Returns the set containing all flags.
215    #[inline]
216    pub const fn all() -> Self {
217        Self {
218            bits: Self::LONG_OFFSETS.bits,
219        }
220    }
221
222    /// Returns the raw value of the flags currently stored.
223    #[inline]
224    pub const fn bits(&self) -> u16 {
225        self.bits
226    }
227
228    /// Convert from underlying bit representation, unless that
229    /// representation contains bits that do not correspond to a flag.
230    #[inline]
231    pub const fn from_bits(bits: u16) -> Option<Self> {
232        if (bits & !Self::all().bits()) == 0 {
233            Some(Self { bits })
234        } else {
235            None
236        }
237    }
238
239    /// Convert from underlying bit representation, dropping any bits
240    /// that do not correspond to flags.
241    #[inline]
242    pub const fn from_bits_truncate(bits: u16) -> Self {
243        Self {
244            bits: bits & Self::all().bits,
245        }
246    }
247
248    /// Returns `true` if no flags are currently stored.
249    #[inline]
250    pub const fn is_empty(&self) -> bool {
251        self.bits() == Self::empty().bits()
252    }
253
254    /// Returns `true` if there are flags common to both `self` and `other`.
255    #[inline]
256    pub const fn intersects(&self, other: Self) -> bool {
257        !(Self {
258            bits: self.bits & other.bits,
259        })
260        .is_empty()
261    }
262
263    /// Returns `true` if all of the flags in `other` are contained within `self`.
264    #[inline]
265    pub const fn contains(&self, other: Self) -> bool {
266        (self.bits & other.bits) == other.bits
267    }
268
269    /// Inserts the specified flags in-place.
270    #[inline]
271    pub fn insert(&mut self, other: Self) {
272        self.bits |= other.bits;
273    }
274
275    /// Removes the specified flags in-place.
276    #[inline]
277    pub fn remove(&mut self, other: Self) {
278        self.bits &= !other.bits;
279    }
280
281    /// Toggles the specified flags in-place.
282    #[inline]
283    pub fn toggle(&mut self, other: Self) {
284        self.bits ^= other.bits;
285    }
286
287    /// Returns the intersection between the flags in `self` and
288    /// `other`.
289    ///
290    /// Specifically, the returned set contains only the flags which are
291    /// present in *both* `self` *and* `other`.
292    ///
293    /// This is equivalent to using the `&` operator (e.g.
294    /// [`ops::BitAnd`]), as in `flags & other`.
295    ///
296    /// [`ops::BitAnd`]: https://doc.rust-lang.org/std/ops/trait.BitAnd.html
297    #[inline]
298    #[must_use]
299    pub const fn intersection(self, other: Self) -> Self {
300        Self {
301            bits: self.bits & other.bits,
302        }
303    }
304
305    /// Returns the union of between the flags in `self` and `other`.
306    ///
307    /// Specifically, the returned set contains all flags which are
308    /// present in *either* `self` *or* `other`, including any which are
309    /// present in both.
310    ///
311    /// This is equivalent to using the `|` operator (e.g.
312    /// [`ops::BitOr`]), as in `flags | other`.
313    ///
314    /// [`ops::BitOr`]: https://doc.rust-lang.org/std/ops/trait.BitOr.html
315    #[inline]
316    #[must_use]
317    pub const fn union(self, other: Self) -> Self {
318        Self {
319            bits: self.bits | other.bits,
320        }
321    }
322
323    /// Returns the difference between the flags in `self` and `other`.
324    ///
325    /// Specifically, the returned set contains all flags present in
326    /// `self`, except for the ones present in `other`.
327    ///
328    /// It is also conceptually equivalent to the "bit-clear" operation:
329    /// `flags & !other` (and this syntax is also supported).
330    ///
331    /// This is equivalent to using the `-` operator (e.g.
332    /// [`ops::Sub`]), as in `flags - other`.
333    ///
334    /// [`ops::Sub`]: https://doc.rust-lang.org/std/ops/trait.Sub.html
335    #[inline]
336    #[must_use]
337    pub const fn difference(self, other: Self) -> Self {
338        Self {
339            bits: self.bits & !other.bits,
340        }
341    }
342}
343
344impl std::ops::BitOr for GvarFlags {
345    type Output = Self;
346
347    /// Returns the union of the two sets of flags.
348    #[inline]
349    fn bitor(self, other: GvarFlags) -> Self {
350        Self {
351            bits: self.bits | other.bits,
352        }
353    }
354}
355
356impl std::ops::BitOrAssign for GvarFlags {
357    /// Adds the set of flags.
358    #[inline]
359    fn bitor_assign(&mut self, other: Self) {
360        self.bits |= other.bits;
361    }
362}
363
364impl std::ops::BitXor for GvarFlags {
365    type Output = Self;
366
367    /// Returns the left flags, but with all the right flags toggled.
368    #[inline]
369    fn bitxor(self, other: Self) -> Self {
370        Self {
371            bits: self.bits ^ other.bits,
372        }
373    }
374}
375
376impl std::ops::BitXorAssign for GvarFlags {
377    /// Toggles the set of flags.
378    #[inline]
379    fn bitxor_assign(&mut self, other: Self) {
380        self.bits ^= other.bits;
381    }
382}
383
384impl std::ops::BitAnd for GvarFlags {
385    type Output = Self;
386
387    /// Returns the intersection between the two sets of flags.
388    #[inline]
389    fn bitand(self, other: Self) -> Self {
390        Self {
391            bits: self.bits & other.bits,
392        }
393    }
394}
395
396impl std::ops::BitAndAssign for GvarFlags {
397    /// Disables all flags disabled in the set.
398    #[inline]
399    fn bitand_assign(&mut self, other: Self) {
400        self.bits &= other.bits;
401    }
402}
403
404impl std::ops::Sub for GvarFlags {
405    type Output = Self;
406
407    /// Returns the set difference of the two sets of flags.
408    #[inline]
409    fn sub(self, other: Self) -> Self {
410        Self {
411            bits: self.bits & !other.bits,
412        }
413    }
414}
415
416impl std::ops::SubAssign for GvarFlags {
417    /// Disables all flags enabled in the set.
418    #[inline]
419    fn sub_assign(&mut self, other: Self) {
420        self.bits &= !other.bits;
421    }
422}
423
424impl std::ops::Not for GvarFlags {
425    type Output = Self;
426
427    /// Returns the complement of this set of flags.
428    #[inline]
429    fn not(self) -> Self {
430        Self { bits: !self.bits } & Self::all()
431    }
432}
433
434impl std::fmt::Debug for GvarFlags {
435    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
436        let members: &[(&str, Self)] = &[("LONG_OFFSETS", Self::LONG_OFFSETS)];
437        let mut first = true;
438        for (name, value) in members {
439            if self.contains(*value) {
440                if !first {
441                    f.write_str(" | ")?;
442                }
443                first = false;
444                f.write_str(name)?;
445            }
446        }
447        if first {
448            f.write_str("(empty)")?;
449        }
450        Ok(())
451    }
452}
453
454impl std::fmt::Binary for GvarFlags {
455    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
456        std::fmt::Binary::fmt(&self.bits, f)
457    }
458}
459
460impl std::fmt::Octal for GvarFlags {
461    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
462        std::fmt::Octal::fmt(&self.bits, f)
463    }
464}
465
466impl std::fmt::LowerHex for GvarFlags {
467    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
468        std::fmt::LowerHex::fmt(&self.bits, f)
469    }
470}
471
472impl std::fmt::UpperHex for GvarFlags {
473    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
474        std::fmt::UpperHex::fmt(&self.bits, f)
475    }
476}
477
478impl font_types::Scalar for GvarFlags {
479    type Raw = <u16 as font_types::Scalar>::Raw;
480    fn to_raw(self) -> Self::Raw {
481        self.bits().to_raw()
482    }
483    fn from_raw(raw: Self::Raw) -> Self {
484        let t = <u16>::from_raw(raw);
485        Self::from_bits_truncate(t)
486    }
487}
488
489#[cfg(feature = "experimental_traverse")]
490impl<'a> From<GvarFlags> for FieldType<'a> {
491    fn from(src: GvarFlags) -> FieldType<'a> {
492        src.bits().into()
493    }
494}
495
496/// Array of tuple records shared across all glyph variation data tables.
497#[derive(Debug, Clone, Copy)]
498#[doc(hidden)]
499pub struct SharedTuplesMarker {
500    axis_count: u16,
501    tuples_byte_len: usize,
502}
503
504impl SharedTuplesMarker {
505    pub fn tuples_byte_range(&self) -> Range<usize> {
506        let start = 0;
507        start..start + self.tuples_byte_len
508    }
509}
510
511impl MinByteRange for SharedTuplesMarker {
512    fn min_byte_range(&self) -> Range<usize> {
513        0..self.tuples_byte_range().end
514    }
515}
516
517impl ReadArgs for SharedTuples<'_> {
518    type Args = (u16, u16);
519}
520
521impl<'a> FontReadWithArgs<'a> for SharedTuples<'a> {
522    fn read_with_args(data: FontData<'a>, args: &(u16, u16)) -> Result<Self, ReadError> {
523        let (shared_tuple_count, axis_count) = *args;
524        let mut cursor = data.cursor();
525        let tuples_byte_len = (shared_tuple_count as usize)
526            .checked_mul(<Tuple as ComputeSize>::compute_size(&axis_count)?)
527            .ok_or(ReadError::OutOfBounds)?;
528        cursor.advance_by(tuples_byte_len);
529        cursor.finish(SharedTuplesMarker {
530            axis_count,
531            tuples_byte_len,
532        })
533    }
534}
535
536impl<'a> SharedTuples<'a> {
537    /// A constructor that requires additional arguments.
538    ///
539    /// This type requires some external state in order to be
540    /// parsed.
541    pub fn read(
542        data: FontData<'a>,
543        shared_tuple_count: u16,
544        axis_count: u16,
545    ) -> Result<Self, ReadError> {
546        let args = (shared_tuple_count, axis_count);
547        Self::read_with_args(data, &args)
548    }
549}
550
551/// Array of tuple records shared across all glyph variation data tables.
552pub type SharedTuples<'a> = TableRef<'a, SharedTuplesMarker>;
553
554#[allow(clippy::needless_lifetimes)]
555impl<'a> SharedTuples<'a> {
556    pub fn tuples(&self) -> ComputedArray<'a, Tuple<'a>> {
557        let range = self.shape.tuples_byte_range();
558        self.data.read_with_args(range, &self.axis_count()).unwrap()
559    }
560
561    pub(crate) fn axis_count(&self) -> u16 {
562        self.shape.axis_count
563    }
564}
565
566#[cfg(feature = "experimental_traverse")]
567impl<'a> SomeTable<'a> for SharedTuples<'a> {
568    fn type_name(&self) -> &str {
569        "SharedTuples"
570    }
571    fn get_field(&self, idx: usize) -> Option<Field<'a>> {
572        match idx {
573            0usize => Some(Field::new(
574                "tuples",
575                traversal::FieldType::computed_array("Tuple", self.tuples(), self.offset_data()),
576            )),
577            _ => None,
578        }
579    }
580}
581
582#[cfg(feature = "experimental_traverse")]
583#[allow(clippy::needless_lifetimes)]
584impl<'a> std::fmt::Debug for SharedTuples<'a> {
585    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
586        (self as &dyn SomeTable<'a>).fmt(f)
587    }
588}
589
590/// The [GlyphVariationData](https://learn.microsoft.com/en-us/typography/opentype/spec/gvar#the-glyphvariationdata-table-array) table
591#[derive(Debug, Clone, Copy)]
592#[doc(hidden)]
593pub struct GlyphVariationDataHeaderMarker {
594    tuple_variation_headers_byte_len: usize,
595}
596
597impl GlyphVariationDataHeaderMarker {
598    pub fn tuple_variation_count_byte_range(&self) -> Range<usize> {
599        let start = 0;
600        start..start + TupleVariationCount::RAW_BYTE_LEN
601    }
602
603    pub fn serialized_data_offset_byte_range(&self) -> Range<usize> {
604        let start = self.tuple_variation_count_byte_range().end;
605        start..start + Offset16::RAW_BYTE_LEN
606    }
607
608    pub fn tuple_variation_headers_byte_range(&self) -> Range<usize> {
609        let start = self.serialized_data_offset_byte_range().end;
610        start..start + self.tuple_variation_headers_byte_len
611    }
612}
613
614impl MinByteRange for GlyphVariationDataHeaderMarker {
615    fn min_byte_range(&self) -> Range<usize> {
616        0..self.tuple_variation_headers_byte_range().end
617    }
618}
619
620impl<'a> FontRead<'a> for GlyphVariationDataHeader<'a> {
621    fn read(data: FontData<'a>) -> Result<Self, ReadError> {
622        let mut cursor = data.cursor();
623        cursor.advance::<TupleVariationCount>();
624        cursor.advance::<Offset16>();
625        let tuple_variation_headers_byte_len = cursor.remaining_bytes();
626        cursor.advance_by(tuple_variation_headers_byte_len);
627        cursor.finish(GlyphVariationDataHeaderMarker {
628            tuple_variation_headers_byte_len,
629        })
630    }
631}
632
633/// The [GlyphVariationData](https://learn.microsoft.com/en-us/typography/opentype/spec/gvar#the-glyphvariationdata-table-array) table
634pub type GlyphVariationDataHeader<'a> = TableRef<'a, GlyphVariationDataHeaderMarker>;
635
636#[allow(clippy::needless_lifetimes)]
637impl<'a> GlyphVariationDataHeader<'a> {
638    /// A packed field. The high 4 bits are flags, and the low 12 bits
639    /// are the number of tuple variation tables for this glyph. The
640    /// number of tuple variation tables can be any number between 1
641    /// and 4095.
642    pub fn tuple_variation_count(&self) -> TupleVariationCount {
643        let range = self.shape.tuple_variation_count_byte_range();
644        self.data.read_at(range.start).unwrap()
645    }
646
647    /// Offset from the start of the GlyphVariationData table to the
648    /// serialized data
649    pub fn serialized_data_offset(&self) -> Offset16 {
650        let range = self.shape.serialized_data_offset_byte_range();
651        self.data.read_at(range.start).unwrap()
652    }
653
654    /// Attempt to resolve [`serialized_data_offset`][Self::serialized_data_offset].
655    pub fn serialized_data(&self) -> Result<FontData<'a>, ReadError> {
656        let data = self.data;
657        self.serialized_data_offset().resolve(data)
658    }
659
660    /// Array of tuple variation headers.
661    pub fn tuple_variation_headers(&self) -> VarLenArray<'a, TupleVariationHeader> {
662        let range = self.shape.tuple_variation_headers_byte_range();
663        VarLenArray::read(self.data.split_off(range.start).unwrap()).unwrap()
664    }
665}
666
667#[cfg(feature = "experimental_traverse")]
668impl<'a> SomeTable<'a> for GlyphVariationDataHeader<'a> {
669    fn type_name(&self) -> &str {
670        "GlyphVariationDataHeader"
671    }
672    fn get_field(&self, idx: usize) -> Option<Field<'a>> {
673        match idx {
674            0usize => Some(Field::new(
675                "tuple_variation_count",
676                traversal::FieldType::Unknown,
677            )),
678            1usize => Some(Field::new(
679                "serialized_data_offset",
680                traversal::FieldType::Unknown,
681            )),
682            2usize => Some(Field::new(
683                "tuple_variation_headers",
684                traversal::FieldType::Unknown,
685            )),
686            _ => None,
687        }
688    }
689}
690
691#[cfg(feature = "experimental_traverse")]
692#[allow(clippy::needless_lifetimes)]
693impl<'a> std::fmt::Debug for GlyphVariationDataHeader<'a> {
694    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
695        (self as &dyn SomeTable<'a>).fmt(f)
696    }
697}