Coverage Report

Created: 2026-11-11 07:51

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/fontations/read-fonts/data/generated/generated_tables.rs
Line
Count
Source
1
// THIS FILE IS AUTOGENERATED.
2
// Any changes to this file will be overwritten.
3
// Use ../../scripts/gen_tables.py to regenerate.
4
5
/// Holds some data for each possible table in a font.
6
#[derive(Clone, Default, Debug)]
7
struct PerTableData<T> {
8
    /// Anchor point table.
9
    ankr: T,
10
    /// Axis variation table.
11
    avar: T,
12
    /// Baseline table.
13
    base: T,
14
    /// Compact font format table.
15
    cff: T,
16
    /// Compact font format 2.0 table.
17
    cff2: T,
18
    /// Color bitmap data table.
19
    cbdt: T,
20
    /// Color bitmap location table.
21
    cblc: T,
22
    /// Color table.
23
    colr: T,
24
    /// Color palette table.
25
    cpal: T,
26
    /// Character to glyph mapping table.
27
    cmap: T,
28
    /// CVT variations table.
29
    cvar: T,
30
    /// Control value table.
31
    cvt: T,
32
    /// Delta character mapping table.
33
    dmap: T,
34
    /// Digital signature table.
35
    dsig: T,
36
    /// Embedded bitmap data table.
37
    ebdt: T,
38
    /// Embedded bitmap location data table.
39
    eblc: T,
40
    /// Font feature table.
41
    feat: T,
42
    /// Font program table.
43
    fpgm: T,
44
    /// Font variations table.
45
    fvar: T,
46
    /// Grid-fitting and scan-conversion procedure table.
47
    gasp: T,
48
    /// Glyph definition table.
49
    gdef: T,
50
    /// TrueType glyph data table.
51
    glyf: T,
52
    /// Extended glyph data table.
53
    glyf_extended: T,
54
    /// Glyph positioning table.
55
    gpos: T,
56
    /// Glyph substitution table.
57
    gsub: T,
58
    /// Glyph variation table.
59
    gvar: T,
60
    /// Extended glyph variation table.
61
    gvar_extended: T,
62
    /// Horizontal device metrics.
63
    hdmx: T,
64
    /// Font header table.
65
    head: T,
66
    /// Horizontal header table.
67
    hhea: T,
68
    /// Extended horizontal header table.
69
    hhea_extended: T,
70
    /// Horizontal metrics table.
71
    hmtx: T,
72
    /// Extended horizontal metrics table.
73
    hmtx_extended: T,
74
    /// Horizontal metrics variation table.
75
    hvar: T,
76
    /// Incremental font transfer table.
77
    ift: T,
78
    /// Incremental font transfer table.
79
    iftx: T,
80
    /// Justification table.
81
    jstf: T,
82
    /// Kerning table.
83
    kern: T,
84
    /// Extended kerning table.
85
    kerx: T,
86
    /// Index to location table.
87
    loca: T,
88
    /// Extended index to location table.
89
    loca_extended: T,
90
    /// Language tag table.
91
    ltag: T,
92
    /// Mathematical typesetting table.
93
    math: T,
94
    /// Maximum profile table.
95
    maxp: T,
96
    /// Extended maximum profile table.
97
    maxp_extended: T,
98
    /// Metadata table.
99
    meta: T,
100
    /// Metamorphosis table (deprecated).
101
    mort: T,
102
    /// Extended metamorphosis table.
103
    morx: T,
104
    /// Metrics variation table.
105
    mvar: T,
106
    /// Naming table.
107
    name: T,
108
    /// OS/2 and Windows-specific metrics table.
109
    os2: T,
110
    /// PostScript information table.
111
    post: T,
112
    /// Control value program table.
113
    prep: T,
114
    /// Standard bitmap graphics table.
115
    sbix: T,
116
    /// Style attributes table.
117
    stat: T,
118
    /// Scalable vector graphics table.
119
    svg: T,
120
    /// Tracking table.
121
    trak: T,
122
    /// Variable composite/component table.
123
    varc: T,
124
    /// Vertical header table.
125
    vhea: T,
126
    /// Extended vertical header table.
127
    vhea_extended: T,
128
    /// Vertical metrics table.
129
    vmtx: T,
130
    /// Extended vertical metrics table.
131
    vmtx_extended: T,
132
    /// Vertical origin table.
133
    vorg: T,
134
    /// Vertical metrics variation table.
135
    vvar: T,
136
}
137
138
impl<T> PerTableData<T> {
139
    /// Calls `f` with the tag and associated data for each table.
140
0
    fn init_all(&mut self, f: impl Fn(Tag, &mut T)) {
141
0
        f(Tag::new(b"ankr"), &mut self.ankr);
142
0
        f(Tag::new(b"avar"), &mut self.avar);
143
0
        f(Tag::new(b"BASE"), &mut self.base);
144
0
        f(Tag::new(b"CFF "), &mut self.cff);
145
0
        f(Tag::new(b"CFF2"), &mut self.cff2);
146
0
        f(Tag::new(b"CBDT"), &mut self.cbdt);
147
0
        f(Tag::new(b"CBLC"), &mut self.cblc);
148
0
        f(Tag::new(b"COLR"), &mut self.colr);
149
0
        f(Tag::new(b"CPAL"), &mut self.cpal);
150
0
        f(Tag::new(b"cmap"), &mut self.cmap);
151
0
        f(Tag::new(b"cvar"), &mut self.cvar);
152
0
        f(Tag::new(b"cvt "), &mut self.cvt);
153
0
        f(Tag::new(b"DMAP"), &mut self.dmap);
154
0
        f(Tag::new(b"DSIG"), &mut self.dsig);
155
0
        f(Tag::new(b"EBDT"), &mut self.ebdt);
156
0
        f(Tag::new(b"EBLC"), &mut self.eblc);
157
0
        f(Tag::new(b"feat"), &mut self.feat);
158
0
        f(Tag::new(b"fpgm"), &mut self.fpgm);
159
0
        f(Tag::new(b"fvar"), &mut self.fvar);
160
0
        f(Tag::new(b"gasp"), &mut self.gasp);
161
0
        f(Tag::new(b"GDEF"), &mut self.gdef);
162
0
        f(Tag::new(b"glyf"), &mut self.glyf);
163
0
        f(Tag::new(b"GLYF"), &mut self.glyf_extended);
164
0
        f(Tag::new(b"GPOS"), &mut self.gpos);
165
0
        f(Tag::new(b"GSUB"), &mut self.gsub);
166
0
        f(Tag::new(b"gvar"), &mut self.gvar);
167
0
        f(Tag::new(b"GVAR"), &mut self.gvar_extended);
168
0
        f(Tag::new(b"hdmx"), &mut self.hdmx);
169
0
        f(Tag::new(b"head"), &mut self.head);
170
0
        f(Tag::new(b"hhea"), &mut self.hhea);
171
0
        f(Tag::new(b"HHEA"), &mut self.hhea_extended);
172
0
        f(Tag::new(b"hmtx"), &mut self.hmtx);
173
0
        f(Tag::new(b"HMTX"), &mut self.hmtx_extended);
174
0
        f(Tag::new(b"HVAR"), &mut self.hvar);
175
0
        f(Tag::new(b"IFT "), &mut self.ift);
176
0
        f(Tag::new(b"IFTX"), &mut self.iftx);
177
0
        f(Tag::new(b"JSTF"), &mut self.jstf);
178
0
        f(Tag::new(b"kern"), &mut self.kern);
179
0
        f(Tag::new(b"kerx"), &mut self.kerx);
180
0
        f(Tag::new(b"loca"), &mut self.loca);
181
0
        f(Tag::new(b"LOCA"), &mut self.loca_extended);
182
0
        f(Tag::new(b"ltag"), &mut self.ltag);
183
0
        f(Tag::new(b"MATH"), &mut self.math);
184
0
        f(Tag::new(b"maxp"), &mut self.maxp);
185
0
        f(Tag::new(b"MAXP"), &mut self.maxp_extended);
186
0
        f(Tag::new(b"meta"), &mut self.meta);
187
0
        f(Tag::new(b"mort"), &mut self.mort);
188
0
        f(Tag::new(b"morx"), &mut self.morx);
189
0
        f(Tag::new(b"MVAR"), &mut self.mvar);
190
0
        f(Tag::new(b"name"), &mut self.name);
191
0
        f(Tag::new(b"OS/2"), &mut self.os2);
192
0
        f(Tag::new(b"post"), &mut self.post);
193
0
        f(Tag::new(b"prep"), &mut self.prep);
194
0
        f(Tag::new(b"sbix"), &mut self.sbix);
195
0
        f(Tag::new(b"STAT"), &mut self.stat);
196
0
        f(Tag::new(b"SVG "), &mut self.svg);
197
0
        f(Tag::new(b"trak"), &mut self.trak);
198
0
        f(Tag::new(b"VARC"), &mut self.varc);
199
0
        f(Tag::new(b"vhea"), &mut self.vhea);
200
0
        f(Tag::new(b"VHEA"), &mut self.vhea_extended);
201
0
        f(Tag::new(b"vmtx"), &mut self.vmtx);
202
0
        f(Tag::new(b"VMTX"), &mut self.vmtx_extended);
203
0
        f(Tag::new(b"VORG"), &mut self.vorg);
204
0
        f(Tag::new(b"VVAR"), &mut self.vvar);
205
0
    }
206
}
207
208
trait TableDataProvider<'a> where Self: 'a {
209
    type Entry;
210
211
    fn tables(&self) -> &'a PerTableData<Self::Entry>;
212
    fn table_state(&self, tag: Tag, entry: &'a Self::Entry) -> Option<TableState<'a>>;
213
214
    fn ankr(&self) -> Option<TableState<'a>> {
215
        self.table_state(Tag::new(b"ankr"), &self.tables().ankr)
216
    }
217
218
    fn avar(&self) -> Option<TableState<'a>> {
219
        self.table_state(Tag::new(b"avar"), &self.tables().avar)
220
    }
221
222
    fn base(&self) -> Option<TableState<'a>> {
223
        self.table_state(Tag::new(b"BASE"), &self.tables().base)
224
    }
225
226
    fn cff(&self) -> Option<TableState<'a>> {
227
        self.table_state(Tag::new(b"CFF "), &self.tables().cff)
228
    }
229
230
    fn cff2(&self) -> Option<TableState<'a>> {
231
        self.table_state(Tag::new(b"CFF2"), &self.tables().cff2)
232
    }
233
234
    fn cbdt(&self) -> Option<TableState<'a>> {
235
        self.table_state(Tag::new(b"CBDT"), &self.tables().cbdt)
236
    }
237
238
    fn cblc(&self) -> Option<TableState<'a>> {
239
        self.table_state(Tag::new(b"CBLC"), &self.tables().cblc)
240
    }
241
242
    fn colr(&self) -> Option<TableState<'a>> {
243
        self.table_state(Tag::new(b"COLR"), &self.tables().colr)
244
    }
245
246
    fn cpal(&self) -> Option<TableState<'a>> {
247
        self.table_state(Tag::new(b"CPAL"), &self.tables().cpal)
248
    }
249
250
    fn cmap(&self) -> Option<TableState<'a>> {
251
        self.table_state(Tag::new(b"cmap"), &self.tables().cmap)
252
    }
253
254
    fn cvar(&self) -> Option<TableState<'a>> {
255
        self.table_state(Tag::new(b"cvar"), &self.tables().cvar)
256
    }
257
258
    fn cvt(&self) -> Option<TableState<'a>> {
259
        self.table_state(Tag::new(b"cvt "), &self.tables().cvt)
260
    }
261
262
    fn dmap(&self) -> Option<TableState<'a>> {
263
        self.table_state(Tag::new(b"DMAP"), &self.tables().dmap)
264
    }
265
266
    fn dsig(&self) -> Option<TableState<'a>> {
267
        self.table_state(Tag::new(b"DSIG"), &self.tables().dsig)
268
    }
269
270
    fn ebdt(&self) -> Option<TableState<'a>> {
271
        self.table_state(Tag::new(b"EBDT"), &self.tables().ebdt)
272
    }
273
274
    fn eblc(&self) -> Option<TableState<'a>> {
275
        self.table_state(Tag::new(b"EBLC"), &self.tables().eblc)
276
    }
277
278
    fn feat(&self) -> Option<TableState<'a>> {
279
        self.table_state(Tag::new(b"feat"), &self.tables().feat)
280
    }
281
282
    fn fpgm(&self) -> Option<TableState<'a>> {
283
        self.table_state(Tag::new(b"fpgm"), &self.tables().fpgm)
284
    }
285
286
    fn fvar(&self) -> Option<TableState<'a>> {
287
        self.table_state(Tag::new(b"fvar"), &self.tables().fvar)
288
    }
289
290
    fn gasp(&self) -> Option<TableState<'a>> {
291
        self.table_state(Tag::new(b"gasp"), &self.tables().gasp)
292
    }
293
294
    fn gdef(&self) -> Option<TableState<'a>> {
295
        self.table_state(Tag::new(b"GDEF"), &self.tables().gdef)
296
    }
297
298
    fn glyf(&self) -> Option<TableState<'a>> {
299
        self.table_state(Tag::new(b"glyf"), &self.tables().glyf)
300
    }
301
302
    fn glyf_extended(&self) -> Option<TableState<'a>> {
303
        self.table_state(Tag::new(b"GLYF"), &self.tables().glyf_extended)
304
    }
305
306
    fn gpos(&self) -> Option<TableState<'a>> {
307
        self.table_state(Tag::new(b"GPOS"), &self.tables().gpos)
308
    }
309
310
    fn gsub(&self) -> Option<TableState<'a>> {
311
        self.table_state(Tag::new(b"GSUB"), &self.tables().gsub)
312
    }
313
314
    fn gvar(&self) -> Option<TableState<'a>> {
315
        self.table_state(Tag::new(b"gvar"), &self.tables().gvar)
316
    }
317
318
    fn gvar_extended(&self) -> Option<TableState<'a>> {
319
        self.table_state(Tag::new(b"GVAR"), &self.tables().gvar_extended)
320
    }
321
322
    fn hdmx(&self) -> Option<TableState<'a>> {
323
        self.table_state(Tag::new(b"hdmx"), &self.tables().hdmx)
324
    }
325
326
    fn head(&self) -> Option<TableState<'a>> {
327
        self.table_state(Tag::new(b"head"), &self.tables().head)
328
    }
329
330
    fn hhea(&self) -> Option<TableState<'a>> {
331
        self.table_state(Tag::new(b"hhea"), &self.tables().hhea)
332
    }
333
334
    fn hhea_extended(&self) -> Option<TableState<'a>> {
335
        self.table_state(Tag::new(b"HHEA"), &self.tables().hhea_extended)
336
    }
337
338
    fn hmtx(&self) -> Option<TableState<'a>> {
339
        self.table_state(Tag::new(b"hmtx"), &self.tables().hmtx)
340
    }
341
342
    fn hmtx_extended(&self) -> Option<TableState<'a>> {
343
        self.table_state(Tag::new(b"HMTX"), &self.tables().hmtx_extended)
344
    }
345
346
    fn hvar(&self) -> Option<TableState<'a>> {
347
        self.table_state(Tag::new(b"HVAR"), &self.tables().hvar)
348
    }
349
350
    fn ift(&self) -> Option<TableState<'a>> {
351
        self.table_state(Tag::new(b"IFT "), &self.tables().ift)
352
    }
353
354
    fn iftx(&self) -> Option<TableState<'a>> {
355
        self.table_state(Tag::new(b"IFTX"), &self.tables().iftx)
356
    }
357
358
    fn jstf(&self) -> Option<TableState<'a>> {
359
        self.table_state(Tag::new(b"JSTF"), &self.tables().jstf)
360
    }
361
362
    fn kern(&self) -> Option<TableState<'a>> {
363
        self.table_state(Tag::new(b"kern"), &self.tables().kern)
364
    }
365
366
    fn kerx(&self) -> Option<TableState<'a>> {
367
        self.table_state(Tag::new(b"kerx"), &self.tables().kerx)
368
    }
369
370
    fn loca(&self) -> Option<TableState<'a>> {
371
        self.table_state(Tag::new(b"loca"), &self.tables().loca)
372
    }
373
374
    fn loca_extended(&self) -> Option<TableState<'a>> {
375
        self.table_state(Tag::new(b"LOCA"), &self.tables().loca_extended)
376
    }
377
378
    fn ltag(&self) -> Option<TableState<'a>> {
379
        self.table_state(Tag::new(b"ltag"), &self.tables().ltag)
380
    }
381
382
    fn math(&self) -> Option<TableState<'a>> {
383
        self.table_state(Tag::new(b"MATH"), &self.tables().math)
384
    }
385
386
    fn maxp(&self) -> Option<TableState<'a>> {
387
        self.table_state(Tag::new(b"maxp"), &self.tables().maxp)
388
    }
389
390
    fn maxp_extended(&self) -> Option<TableState<'a>> {
391
        self.table_state(Tag::new(b"MAXP"), &self.tables().maxp_extended)
392
    }
393
394
    fn meta(&self) -> Option<TableState<'a>> {
395
        self.table_state(Tag::new(b"meta"), &self.tables().meta)
396
    }
397
398
    fn mort(&self) -> Option<TableState<'a>> {
399
        self.table_state(Tag::new(b"mort"), &self.tables().mort)
400
    }
401
402
    fn morx(&self) -> Option<TableState<'a>> {
403
        self.table_state(Tag::new(b"morx"), &self.tables().morx)
404
    }
405
406
    fn mvar(&self) -> Option<TableState<'a>> {
407
        self.table_state(Tag::new(b"MVAR"), &self.tables().mvar)
408
    }
409
410
    fn name(&self) -> Option<TableState<'a>> {
411
        self.table_state(Tag::new(b"name"), &self.tables().name)
412
    }
413
414
    fn os2(&self) -> Option<TableState<'a>> {
415
        self.table_state(Tag::new(b"OS/2"), &self.tables().os2)
416
    }
417
418
    fn post(&self) -> Option<TableState<'a>> {
419
        self.table_state(Tag::new(b"post"), &self.tables().post)
420
    }
421
422
    fn prep(&self) -> Option<TableState<'a>> {
423
        self.table_state(Tag::new(b"prep"), &self.tables().prep)
424
    }
425
426
    fn sbix(&self) -> Option<TableState<'a>> {
427
        self.table_state(Tag::new(b"sbix"), &self.tables().sbix)
428
    }
429
430
    fn stat(&self) -> Option<TableState<'a>> {
431
        self.table_state(Tag::new(b"STAT"), &self.tables().stat)
432
    }
433
434
    fn svg(&self) -> Option<TableState<'a>> {
435
        self.table_state(Tag::new(b"SVG "), &self.tables().svg)
436
    }
437
438
    fn trak(&self) -> Option<TableState<'a>> {
439
        self.table_state(Tag::new(b"trak"), &self.tables().trak)
440
    }
441
442
    fn varc(&self) -> Option<TableState<'a>> {
443
        self.table_state(Tag::new(b"VARC"), &self.tables().varc)
444
    }
445
446
    fn vhea(&self) -> Option<TableState<'a>> {
447
        self.table_state(Tag::new(b"vhea"), &self.tables().vhea)
448
    }
449
450
    fn vhea_extended(&self) -> Option<TableState<'a>> {
451
        self.table_state(Tag::new(b"VHEA"), &self.tables().vhea_extended)
452
    }
453
454
    fn vmtx(&self) -> Option<TableState<'a>> {
455
        self.table_state(Tag::new(b"vmtx"), &self.tables().vmtx)
456
    }
457
458
    fn vmtx_extended(&self) -> Option<TableState<'a>> {
459
        self.table_state(Tag::new(b"VMTX"), &self.tables().vmtx_extended)
460
    }
461
462
    fn vorg(&self) -> Option<TableState<'a>> {
463
        self.table_state(Tag::new(b"VORG"), &self.tables().vorg)
464
    }
465
466
    fn vvar(&self) -> Option<TableState<'a>> {
467
        self.table_state(Tag::new(b"VVAR"), &self.tables().vvar)
468
    }
469
470
}
471
472
impl Tables {
473
    /// Anchor point table data.
474
    ///
475
    /// See the [ankr](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ankr.html) specification.
476
    pub fn ankr_data(&self) -> Option<&'_ [u8]> {
477
        self.ankr_state().map(|state| state.data)
478
    }
479
480
    fn ankr_state(&self) -> Option<TableState<'_>> {
481
        match &self.0 {
482
            TableSource::None => None,
483
            TableSource::Blob(blob) => blob.ankr(),
484
            TableSource::Function(func) => func.ankr(),
485
        }
486
    }
487
488
    /// Axis variation table data.
489
    ///
490
    /// See the [avar](https://learn.microsoft.com/en-us/typography/opentype/spec/avar) specification.
491
    pub fn avar_data(&self) -> Option<&'_ [u8]> {
492
        self.avar_state().map(|state| state.data)
493
    }
494
495
    fn avar_state(&self) -> Option<TableState<'_>> {
496
        match &self.0 {
497
            TableSource::None => None,
498
            TableSource::Blob(blob) => blob.avar(),
499
            TableSource::Function(func) => func.avar(),
500
        }
501
    }
502
503
    /// Baseline table data.
504
    ///
505
    /// See the [BASE](https://learn.microsoft.com/en-us/typography/opentype/spec/base) specification.
506
    pub fn base_data(&self) -> Option<&'_ [u8]> {
507
        self.base_state().map(|state| state.data)
508
    }
509
510
    fn base_state(&self) -> Option<TableState<'_>> {
511
        match &self.0 {
512
            TableSource::None => None,
513
            TableSource::Blob(blob) => blob.base(),
514
            TableSource::Function(func) => func.base(),
515
        }
516
    }
517
518
    /// Compact font format table data.
519
    ///
520
    /// See the [CFF](https://learn.microsoft.com/en-us/typography/opentype/spec/cff) specification.
521
    pub fn cff_data(&self) -> Option<&'_ [u8]> {
522
        self.cff_state().map(|state| state.data)
523
    }
524
525
    fn cff_state(&self) -> Option<TableState<'_>> {
526
        match &self.0 {
527
            TableSource::None => None,
528
            TableSource::Blob(blob) => blob.cff(),
529
            TableSource::Function(func) => func.cff(),
530
        }
531
    }
532
533
    /// Compact font format 2.0 table data.
534
    ///
535
    /// See the [CFF2](https://learn.microsoft.com/en-us/typography/opentype/spec/cff2) specification.
536
    pub fn cff2_data(&self) -> Option<&'_ [u8]> {
537
        self.cff2_state().map(|state| state.data)
538
    }
539
540
    fn cff2_state(&self) -> Option<TableState<'_>> {
541
        match &self.0 {
542
            TableSource::None => None,
543
            TableSource::Blob(blob) => blob.cff2(),
544
            TableSource::Function(func) => func.cff2(),
545
        }
546
    }
547
548
    /// Color bitmap data table data.
549
    ///
550
    /// See the [CBDT](https://learn.microsoft.com/en-us/typography/opentype/spec/cbdt) specification.
551
    pub fn cbdt_data(&self) -> Option<&'_ [u8]> {
552
        self.cbdt_state().map(|state| state.data)
553
    }
554
555
    fn cbdt_state(&self) -> Option<TableState<'_>> {
556
        match &self.0 {
557
            TableSource::None => None,
558
            TableSource::Blob(blob) => blob.cbdt(),
559
            TableSource::Function(func) => func.cbdt(),
560
        }
561
    }
562
563
    /// Color bitmap location table data.
564
    ///
565
    /// See the [CBLC](https://learn.microsoft.com/en-us/typography/opentype/spec/cblc) specification.
566
    pub fn cblc_data(&self) -> Option<&'_ [u8]> {
567
        self.cblc_state().map(|state| state.data)
568
    }
569
570
    fn cblc_state(&self) -> Option<TableState<'_>> {
571
        match &self.0 {
572
            TableSource::None => None,
573
            TableSource::Blob(blob) => blob.cblc(),
574
            TableSource::Function(func) => func.cblc(),
575
        }
576
    }
577
578
    /// Color table data.
579
    ///
580
    /// See the [COLR](https://learn.microsoft.com/en-us/typography/opentype/spec/colr) specification.
581
    pub fn colr_data(&self) -> Option<&'_ [u8]> {
582
        self.colr_state().map(|state| state.data)
583
    }
584
585
    fn colr_state(&self) -> Option<TableState<'_>> {
586
        match &self.0 {
587
            TableSource::None => None,
588
            TableSource::Blob(blob) => blob.colr(),
589
            TableSource::Function(func) => func.colr(),
590
        }
591
    }
592
593
    /// Color palette table data.
594
    ///
595
    /// See the [CPAL](https://learn.microsoft.com/en-us/typography/opentype/spec/cpal) specification.
596
    pub fn cpal_data(&self) -> Option<&'_ [u8]> {
597
        self.cpal_state().map(|state| state.data)
598
    }
599
600
    fn cpal_state(&self) -> Option<TableState<'_>> {
601
        match &self.0 {
602
            TableSource::None => None,
603
            TableSource::Blob(blob) => blob.cpal(),
604
            TableSource::Function(func) => func.cpal(),
605
        }
606
    }
607
608
    /// Character to glyph mapping table data.
609
    ///
610
    /// See the [cmap](https://learn.microsoft.com/en-us/typography/opentype/spec/cmap) specification.
611
    pub fn cmap_data(&self) -> Option<&'_ [u8]> {
612
        self.cmap_state().map(|state| state.data)
613
    }
614
615
    fn cmap_state(&self) -> Option<TableState<'_>> {
616
        match &self.0 {
617
            TableSource::None => None,
618
            TableSource::Blob(blob) => blob.cmap(),
619
            TableSource::Function(func) => func.cmap(),
620
        }
621
    }
622
623
    /// CVT variations table data.
624
    ///
625
    /// See the [cvar](https://learn.microsoft.com/en-us/typography/opentype/spec/cvar) specification.
626
    pub fn cvar_data(&self) -> Option<&'_ [u8]> {
627
        self.cvar_state().map(|state| state.data)
628
    }
629
630
    fn cvar_state(&self) -> Option<TableState<'_>> {
631
        match &self.0 {
632
            TableSource::None => None,
633
            TableSource::Blob(blob) => blob.cvar(),
634
            TableSource::Function(func) => func.cvar(),
635
        }
636
    }
637
638
    /// Control value table data.
639
    ///
640
    /// See the [cvt](https://learn.microsoft.com/en-us/typography/opentype/spec/cvt) specification.
641
    pub fn cvt_data(&self) -> Option<&'_ [u8]> {
642
        self.cvt_state().map(|state| state.data)
643
    }
644
645
    fn cvt_state(&self) -> Option<TableState<'_>> {
646
        match &self.0 {
647
            TableSource::None => None,
648
            TableSource::Blob(blob) => blob.cvt(),
649
            TableSource::Function(func) => func.cvt(),
650
        }
651
    }
652
653
    /// Delta character mapping table data.
654
    ///
655
    /// See the [DMAP](https://www.iso.org/obp/ui/#iso:std:iso-iec:14496:-22:ed-5:v1:en) specification.
656
    pub fn dmap_data(&self) -> Option<&'_ [u8]> {
657
        self.dmap_state().map(|state| state.data)
658
    }
659
660
    fn dmap_state(&self) -> Option<TableState<'_>> {
661
        match &self.0 {
662
            TableSource::None => None,
663
            TableSource::Blob(blob) => blob.dmap(),
664
            TableSource::Function(func) => func.dmap(),
665
        }
666
    }
667
668
    /// Digital signature table data.
669
    ///
670
    /// See the [DSIG](https://learn.microsoft.com/en-us/typography/opentype/spec/dsig) specification.
671
    pub fn dsig_data(&self) -> Option<&'_ [u8]> {
672
        self.dsig_state().map(|state| state.data)
673
    }
674
675
    fn dsig_state(&self) -> Option<TableState<'_>> {
676
        match &self.0 {
677
            TableSource::None => None,
678
            TableSource::Blob(blob) => blob.dsig(),
679
            TableSource::Function(func) => func.dsig(),
680
        }
681
    }
682
683
    /// Embedded bitmap data table data.
684
    ///
685
    /// See the [EBDT](https://learn.microsoft.com/en-us/typography/opentype/spec/ebdt) specification.
686
    pub fn ebdt_data(&self) -> Option<&'_ [u8]> {
687
        self.ebdt_state().map(|state| state.data)
688
    }
689
690
    fn ebdt_state(&self) -> Option<TableState<'_>> {
691
        match &self.0 {
692
            TableSource::None => None,
693
            TableSource::Blob(blob) => blob.ebdt(),
694
            TableSource::Function(func) => func.ebdt(),
695
        }
696
    }
697
698
    /// Embedded bitmap location data table data.
699
    ///
700
    /// See the [EBLC](https://learn.microsoft.com/en-us/typography/opentype/spec/eblc) specification.
701
    pub fn eblc_data(&self) -> Option<&'_ [u8]> {
702
        self.eblc_state().map(|state| state.data)
703
    }
704
705
    fn eblc_state(&self) -> Option<TableState<'_>> {
706
        match &self.0 {
707
            TableSource::None => None,
708
            TableSource::Blob(blob) => blob.eblc(),
709
            TableSource::Function(func) => func.eblc(),
710
        }
711
    }
712
713
    /// Font feature table data.
714
    ///
715
    /// See the [feat](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6feat.html) specification.
716
    pub fn feat_data(&self) -> Option<&'_ [u8]> {
717
        self.feat_state().map(|state| state.data)
718
    }
719
720
    fn feat_state(&self) -> Option<TableState<'_>> {
721
        match &self.0 {
722
            TableSource::None => None,
723
            TableSource::Blob(blob) => blob.feat(),
724
            TableSource::Function(func) => func.feat(),
725
        }
726
    }
727
728
    /// Font program table data.
729
    ///
730
    /// See the [fpgm](https://learn.microsoft.com/en-us/typography/opentype/spec/fpgm) specification.
731
    pub fn fpgm_data(&self) -> Option<&'_ [u8]> {
732
        self.fpgm_state().map(|state| state.data)
733
    }
734
735
    fn fpgm_state(&self) -> Option<TableState<'_>> {
736
        match &self.0 {
737
            TableSource::None => None,
738
            TableSource::Blob(blob) => blob.fpgm(),
739
            TableSource::Function(func) => func.fpgm(),
740
        }
741
    }
742
743
    /// Font variations table data.
744
    ///
745
    /// See the [fvar](https://learn.microsoft.com/en-us/typography/opentype/spec/fvar) specification.
746
    pub fn fvar_data(&self) -> Option<&'_ [u8]> {
747
        self.fvar_state().map(|state| state.data)
748
    }
749
750
    fn fvar_state(&self) -> Option<TableState<'_>> {
751
        match &self.0 {
752
            TableSource::None => None,
753
            TableSource::Blob(blob) => blob.fvar(),
754
            TableSource::Function(func) => func.fvar(),
755
        }
756
    }
757
758
    /// Grid-fitting and scan-conversion procedure table data.
759
    ///
760
    /// See the [gasp](https://learn.microsoft.com/en-us/typography/opentype/spec/gasp) specification.
761
    pub fn gasp_data(&self) -> Option<&'_ [u8]> {
762
        self.gasp_state().map(|state| state.data)
763
    }
764
765
    fn gasp_state(&self) -> Option<TableState<'_>> {
766
        match &self.0 {
767
            TableSource::None => None,
768
            TableSource::Blob(blob) => blob.gasp(),
769
            TableSource::Function(func) => func.gasp(),
770
        }
771
    }
772
773
    /// Glyph definition table data.
774
    ///
775
    /// See the [GDEF](https://learn.microsoft.com/en-us/typography/opentype/spec/gdef) specification.
776
    pub fn gdef_data(&self) -> Option<&'_ [u8]> {
777
        self.gdef_state().map(|state| state.data)
778
    }
779
780
    fn gdef_state(&self) -> Option<TableState<'_>> {
781
        match &self.0 {
782
            TableSource::None => None,
783
            TableSource::Blob(blob) => blob.gdef(),
784
            TableSource::Function(func) => func.gdef(),
785
        }
786
    }
787
788
    /// TrueType glyph data table data.
789
    ///
790
    /// See the [glyf](https://learn.microsoft.com/en-us/typography/opentype/spec/glyf) specification.
791
    pub fn glyf_data(&self) -> Option<&'_ [u8]> {
792
        self.glyf_state().map(|state| state.data)
793
    }
794
795
    fn glyf_state(&self) -> Option<TableState<'_>> {
796
        match &self.0 {
797
            TableSource::None => None,
798
            TableSource::Blob(blob) => blob.glyf(),
799
            TableSource::Function(func) => func.glyf(),
800
        }
801
    }
802
803
    /// Extended glyph data table data.
804
    ///
805
    /// See ISO/IEC 14496-22:2026, 5.2.8.
806
    pub fn glyf_extended_data(&self) -> Option<&'_ [u8]> {
807
        self.glyf_extended_state().map(|state| state.data)
808
    }
809
810
    fn glyf_extended_state(&self) -> Option<TableState<'_>> {
811
        match &self.0 {
812
            TableSource::None => None,
813
            TableSource::Blob(blob) => blob.glyf_extended(),
814
            TableSource::Function(func) => func.glyf_extended(),
815
        }
816
    }
817
818
    /// Glyph positioning table data.
819
    ///
820
    /// See the [GPOS](https://learn.microsoft.com/en-us/typography/opentype/spec/gpos) specification.
821
    pub fn gpos_data(&self) -> Option<&'_ [u8]> {
822
        self.gpos_state().map(|state| state.data)
823
    }
824
825
    fn gpos_state(&self) -> Option<TableState<'_>> {
826
        match &self.0 {
827
            TableSource::None => None,
828
            TableSource::Blob(blob) => blob.gpos(),
829
            TableSource::Function(func) => func.gpos(),
830
        }
831
    }
832
833
    /// Glyph substitution table data.
834
    ///
835
    /// See the [GSUB](https://learn.microsoft.com/en-us/typography/opentype/spec/gsub) specification.
836
    pub fn gsub_data(&self) -> Option<&'_ [u8]> {
837
        self.gsub_state().map(|state| state.data)
838
    }
839
840
    fn gsub_state(&self) -> Option<TableState<'_>> {
841
        match &self.0 {
842
            TableSource::None => None,
843
            TableSource::Blob(blob) => blob.gsub(),
844
            TableSource::Function(func) => func.gsub(),
845
        }
846
    }
847
848
    /// Glyph variation table data.
849
    ///
850
    /// See the [gvar](https://learn.microsoft.com/en-us/typography/opentype/spec/gvar) specification.
851
    pub fn gvar_data(&self) -> Option<&'_ [u8]> {
852
        self.gvar_state().map(|state| state.data)
853
    }
854
855
    fn gvar_state(&self) -> Option<TableState<'_>> {
856
        match &self.0 {
857
            TableSource::None => None,
858
            TableSource::Blob(blob) => blob.gvar(),
859
            TableSource::Function(func) => func.gvar(),
860
        }
861
    }
862
863
    /// Extended glyph variation table data.
864
    ///
865
    /// See ISO/IEC 14496-22:2026, 7.3.9.
866
    pub fn gvar_extended_data(&self) -> Option<&'_ [u8]> {
867
        self.gvar_extended_state().map(|state| state.data)
868
    }
869
870
    fn gvar_extended_state(&self) -> Option<TableState<'_>> {
871
        match &self.0 {
872
            TableSource::None => None,
873
            TableSource::Blob(blob) => blob.gvar_extended(),
874
            TableSource::Function(func) => func.gvar_extended(),
875
        }
876
    }
877
878
    /// Horizontal device metrics data.
879
    ///
880
    /// See the [hdmx](https://learn.microsoft.com/en-us/typography/opentype/spec/hdmx) specification.
881
    pub fn hdmx_data(&self) -> Option<&'_ [u8]> {
882
        self.hdmx_state().map(|state| state.data)
883
    }
884
885
    fn hdmx_state(&self) -> Option<TableState<'_>> {
886
        match &self.0 {
887
            TableSource::None => None,
888
            TableSource::Blob(blob) => blob.hdmx(),
889
            TableSource::Function(func) => func.hdmx(),
890
        }
891
    }
892
893
    /// Font header table data.
894
    ///
895
    /// See the [head](https://learn.microsoft.com/en-us/typography/opentype/spec/head) specification.
896
    pub fn head_data(&self) -> Option<&'_ [u8]> {
897
        self.head_state().map(|state| state.data)
898
    }
899
900
    fn head_state(&self) -> Option<TableState<'_>> {
901
        match &self.0 {
902
            TableSource::None => None,
903
            TableSource::Blob(blob) => blob.head(),
904
            TableSource::Function(func) => func.head(),
905
        }
906
    }
907
908
    /// Horizontal header table data.
909
    ///
910
    /// See the [hhea](https://learn.microsoft.com/en-us/typography/opentype/spec/hhea) specification.
911
    pub fn hhea_data(&self) -> Option<&'_ [u8]> {
912
        self.hhea_state().map(|state| state.data)
913
    }
914
915
    fn hhea_state(&self) -> Option<TableState<'_>> {
916
        match &self.0 {
917
            TableSource::None => None,
918
            TableSource::Blob(blob) => blob.hhea(),
919
            TableSource::Function(func) => func.hhea(),
920
        }
921
    }
922
923
    /// Extended horizontal header table data.
924
    ///
925
    /// See ISO/IEC 14496-22:2026, 5.1.10.
926
    pub fn hhea_extended_data(&self) -> Option<&'_ [u8]> {
927
        self.hhea_extended_state().map(|state| state.data)
928
    }
929
930
    fn hhea_extended_state(&self) -> Option<TableState<'_>> {
931
        match &self.0 {
932
            TableSource::None => None,
933
            TableSource::Blob(blob) => blob.hhea_extended(),
934
            TableSource::Function(func) => func.hhea_extended(),
935
        }
936
    }
937
938
    /// Horizontal metrics table data.
939
    ///
940
    /// See the [hmtx](https://learn.microsoft.com/en-us/typography/opentype/spec/hmtx) specification.
941
    pub fn hmtx_data(&self) -> Option<&'_ [u8]> {
942
        self.hmtx_state().map(|state| state.data)
943
    }
944
945
    fn hmtx_state(&self) -> Option<TableState<'_>> {
946
        match &self.0 {
947
            TableSource::None => None,
948
            TableSource::Blob(blob) => blob.hmtx(),
949
            TableSource::Function(func) => func.hmtx(),
950
        }
951
    }
952
953
    /// Extended horizontal metrics table data.
954
    ///
955
    /// See ISO/IEC 14496-22:2026, 5.1.11.
956
    pub fn hmtx_extended_data(&self) -> Option<&'_ [u8]> {
957
        self.hmtx_extended_state().map(|state| state.data)
958
    }
959
960
    fn hmtx_extended_state(&self) -> Option<TableState<'_>> {
961
        match &self.0 {
962
            TableSource::None => None,
963
            TableSource::Blob(blob) => blob.hmtx_extended(),
964
            TableSource::Function(func) => func.hmtx_extended(),
965
        }
966
    }
967
968
    /// Horizontal metrics variation table data.
969
    ///
970
    /// See the [HVAR](https://learn.microsoft.com/en-us/typography/opentype/spec/hvar) specification.
971
    pub fn hvar_data(&self) -> Option<&'_ [u8]> {
972
        self.hvar_state().map(|state| state.data)
973
    }
974
975
    fn hvar_state(&self) -> Option<TableState<'_>> {
976
        match &self.0 {
977
            TableSource::None => None,
978
            TableSource::Blob(blob) => blob.hvar(),
979
            TableSource::Function(func) => func.hvar(),
980
        }
981
    }
982
983
    /// Incremental font transfer table data.
984
    ///
985
    /// See the [IFT](https://www.w3.org/TR/IFT/#font-format-extensions) specification.
986
    pub fn ift_data(&self) -> Option<&'_ [u8]> {
987
        self.ift_state().map(|state| state.data)
988
    }
989
990
    fn ift_state(&self) -> Option<TableState<'_>> {
991
        match &self.0 {
992
            TableSource::None => None,
993
            TableSource::Blob(blob) => blob.ift(),
994
            TableSource::Function(func) => func.ift(),
995
        }
996
    }
997
998
    /// Incremental font transfer table data.
999
    ///
1000
    /// See the [IFTX](https://www.w3.org/TR/IFT/#font-format-extensions) specification.
1001
    pub fn iftx_data(&self) -> Option<&'_ [u8]> {
1002
        self.iftx_state().map(|state| state.data)
1003
    }
1004
1005
    fn iftx_state(&self) -> Option<TableState<'_>> {
1006
        match &self.0 {
1007
            TableSource::None => None,
1008
            TableSource::Blob(blob) => blob.iftx(),
1009
            TableSource::Function(func) => func.iftx(),
1010
        }
1011
    }
1012
1013
    /// Justification table data.
1014
    ///
1015
    /// See the [JSTF](https://learn.microsoft.com/en-us/typography/opentype/spec/jstf) specification.
1016
    pub fn jstf_data(&self) -> Option<&'_ [u8]> {
1017
        self.jstf_state().map(|state| state.data)
1018
    }
1019
1020
    fn jstf_state(&self) -> Option<TableState<'_>> {
1021
        match &self.0 {
1022
            TableSource::None => None,
1023
            TableSource::Blob(blob) => blob.jstf(),
1024
            TableSource::Function(func) => func.jstf(),
1025
        }
1026
    }
1027
1028
    /// Kerning table data.
1029
    ///
1030
    /// See the [kern](https://learn.microsoft.com/en-us/typography/opentype/spec/kern) specification.
1031
    pub fn kern_data(&self) -> Option<&'_ [u8]> {
1032
        self.kern_state().map(|state| state.data)
1033
    }
1034
1035
    fn kern_state(&self) -> Option<TableState<'_>> {
1036
        match &self.0 {
1037
            TableSource::None => None,
1038
            TableSource::Blob(blob) => blob.kern(),
1039
            TableSource::Function(func) => func.kern(),
1040
        }
1041
    }
1042
1043
    /// Extended kerning table data.
1044
    ///
1045
    /// See the [kerx](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6kerx.html) specification.
1046
    pub fn kerx_data(&self) -> Option<&'_ [u8]> {
1047
        self.kerx_state().map(|state| state.data)
1048
    }
1049
1050
    fn kerx_state(&self) -> Option<TableState<'_>> {
1051
        match &self.0 {
1052
            TableSource::None => None,
1053
            TableSource::Blob(blob) => blob.kerx(),
1054
            TableSource::Function(func) => func.kerx(),
1055
        }
1056
    }
1057
1058
    /// Index to location table data.
1059
    ///
1060
    /// See the [loca](https://learn.microsoft.com/en-us/typography/opentype/spec/loca) specification.
1061
    pub fn loca_data(&self) -> Option<&'_ [u8]> {
1062
        self.loca_state().map(|state| state.data)
1063
    }
1064
1065
    fn loca_state(&self) -> Option<TableState<'_>> {
1066
        match &self.0 {
1067
            TableSource::None => None,
1068
            TableSource::Blob(blob) => blob.loca(),
1069
            TableSource::Function(func) => func.loca(),
1070
        }
1071
    }
1072
1073
    /// Extended index to location table data.
1074
    ///
1075
    /// See ISO/IEC 14496-22:2026, 5.2.9.
1076
    pub fn loca_extended_data(&self) -> Option<&'_ [u8]> {
1077
        self.loca_extended_state().map(|state| state.data)
1078
    }
1079
1080
    fn loca_extended_state(&self) -> Option<TableState<'_>> {
1081
        match &self.0 {
1082
            TableSource::None => None,
1083
            TableSource::Blob(blob) => blob.loca_extended(),
1084
            TableSource::Function(func) => func.loca_extended(),
1085
        }
1086
    }
1087
1088
    /// Language tag table data.
1089
    ///
1090
    /// See the [ltag](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ltag.html) specification.
1091
    pub fn ltag_data(&self) -> Option<&'_ [u8]> {
1092
        self.ltag_state().map(|state| state.data)
1093
    }
1094
1095
    fn ltag_state(&self) -> Option<TableState<'_>> {
1096
        match &self.0 {
1097
            TableSource::None => None,
1098
            TableSource::Blob(blob) => blob.ltag(),
1099
            TableSource::Function(func) => func.ltag(),
1100
        }
1101
    }
1102
1103
    /// Mathematical typesetting table data.
1104
    ///
1105
    /// See the [MATH](https://learn.microsoft.com/en-us/typography/opentype/spec/math) specification.
1106
    pub fn math_data(&self) -> Option<&'_ [u8]> {
1107
        self.math_state().map(|state| state.data)
1108
    }
1109
1110
    fn math_state(&self) -> Option<TableState<'_>> {
1111
        match &self.0 {
1112
            TableSource::None => None,
1113
            TableSource::Blob(blob) => blob.math(),
1114
            TableSource::Function(func) => func.math(),
1115
        }
1116
    }
1117
1118
    /// Maximum profile table data.
1119
    ///
1120
    /// See the [maxp](https://learn.microsoft.com/en-us/typography/opentype/spec/maxp) specification.
1121
    pub fn maxp_data(&self) -> Option<&'_ [u8]> {
1122
        self.maxp_state().map(|state| state.data)
1123
    }
1124
1125
    fn maxp_state(&self) -> Option<TableState<'_>> {
1126
        match &self.0 {
1127
            TableSource::None => None,
1128
            TableSource::Blob(blob) => blob.maxp(),
1129
            TableSource::Function(func) => func.maxp(),
1130
        }
1131
    }
1132
1133
    /// Extended maximum profile table data.
1134
    ///
1135
    /// See ISO/IEC 14496-22:2026, 5.1.12.
1136
    pub fn maxp_extended_data(&self) -> Option<&'_ [u8]> {
1137
        self.maxp_extended_state().map(|state| state.data)
1138
    }
1139
1140
    fn maxp_extended_state(&self) -> Option<TableState<'_>> {
1141
        match &self.0 {
1142
            TableSource::None => None,
1143
            TableSource::Blob(blob) => blob.maxp_extended(),
1144
            TableSource::Function(func) => func.maxp_extended(),
1145
        }
1146
    }
1147
1148
    /// Metadata table data.
1149
    ///
1150
    /// See the [meta](https://learn.microsoft.com/en-us/typography/opentype/spec/meta) specification.
1151
    pub fn meta_data(&self) -> Option<&'_ [u8]> {
1152
        self.meta_state().map(|state| state.data)
1153
    }
1154
1155
    fn meta_state(&self) -> Option<TableState<'_>> {
1156
        match &self.0 {
1157
            TableSource::None => None,
1158
            TableSource::Blob(blob) => blob.meta(),
1159
            TableSource::Function(func) => func.meta(),
1160
        }
1161
    }
1162
1163
    /// Metamorphosis table (deprecated) data.
1164
    ///
1165
    /// See the [mort](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6mort.html) specification.
1166
    pub fn mort_data(&self) -> Option<&'_ [u8]> {
1167
        self.mort_state().map(|state| state.data)
1168
    }
1169
1170
    fn mort_state(&self) -> Option<TableState<'_>> {
1171
        match &self.0 {
1172
            TableSource::None => None,
1173
            TableSource::Blob(blob) => blob.mort(),
1174
            TableSource::Function(func) => func.mort(),
1175
        }
1176
    }
1177
1178
    /// Extended metamorphosis table data.
1179
    ///
1180
    /// See the [morx](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6morx.html) specification.
1181
    pub fn morx_data(&self) -> Option<&'_ [u8]> {
1182
        self.morx_state().map(|state| state.data)
1183
    }
1184
1185
    fn morx_state(&self) -> Option<TableState<'_>> {
1186
        match &self.0 {
1187
            TableSource::None => None,
1188
            TableSource::Blob(blob) => blob.morx(),
1189
            TableSource::Function(func) => func.morx(),
1190
        }
1191
    }
1192
1193
    /// Metrics variation table data.
1194
    ///
1195
    /// See the [MVAR](https://learn.microsoft.com/en-us/typography/opentype/spec/mvar) specification.
1196
    pub fn mvar_data(&self) -> Option<&'_ [u8]> {
1197
        self.mvar_state().map(|state| state.data)
1198
    }
1199
1200
    fn mvar_state(&self) -> Option<TableState<'_>> {
1201
        match &self.0 {
1202
            TableSource::None => None,
1203
            TableSource::Blob(blob) => blob.mvar(),
1204
            TableSource::Function(func) => func.mvar(),
1205
        }
1206
    }
1207
1208
    /// Naming table data.
1209
    ///
1210
    /// See the [name](https://learn.microsoft.com/en-us/typography/opentype/spec/name) specification.
1211
    pub fn name_data(&self) -> Option<&'_ [u8]> {
1212
        self.name_state().map(|state| state.data)
1213
    }
1214
1215
    fn name_state(&self) -> Option<TableState<'_>> {
1216
        match &self.0 {
1217
            TableSource::None => None,
1218
            TableSource::Blob(blob) => blob.name(),
1219
            TableSource::Function(func) => func.name(),
1220
        }
1221
    }
1222
1223
    /// OS/2 and Windows-specific metrics table data.
1224
    ///
1225
    /// See the [OS/2](https://learn.microsoft.com/en-us/typography/opentype/spec/os2) specification.
1226
    pub fn os2_data(&self) -> Option<&'_ [u8]> {
1227
        self.os2_state().map(|state| state.data)
1228
    }
1229
1230
    fn os2_state(&self) -> Option<TableState<'_>> {
1231
        match &self.0 {
1232
            TableSource::None => None,
1233
            TableSource::Blob(blob) => blob.os2(),
1234
            TableSource::Function(func) => func.os2(),
1235
        }
1236
    }
1237
1238
    /// PostScript information table data.
1239
    ///
1240
    /// See the [post](https://learn.microsoft.com/en-us/typography/opentype/spec/post) specification.
1241
    pub fn post_data(&self) -> Option<&'_ [u8]> {
1242
        self.post_state().map(|state| state.data)
1243
    }
1244
1245
    fn post_state(&self) -> Option<TableState<'_>> {
1246
        match &self.0 {
1247
            TableSource::None => None,
1248
            TableSource::Blob(blob) => blob.post(),
1249
            TableSource::Function(func) => func.post(),
1250
        }
1251
    }
1252
1253
    /// Control value program table data.
1254
    ///
1255
    /// See the [prep](https://learn.microsoft.com/en-us/typography/opentype/spec/prep) specification.
1256
    pub fn prep_data(&self) -> Option<&'_ [u8]> {
1257
        self.prep_state().map(|state| state.data)
1258
    }
1259
1260
    fn prep_state(&self) -> Option<TableState<'_>> {
1261
        match &self.0 {
1262
            TableSource::None => None,
1263
            TableSource::Blob(blob) => blob.prep(),
1264
            TableSource::Function(func) => func.prep(),
1265
        }
1266
    }
1267
1268
    /// Standard bitmap graphics table data.
1269
    ///
1270
    /// See the [sbix](https://learn.microsoft.com/en-us/typography/opentype/spec/sbix) specification.
1271
    pub fn sbix_data(&self) -> Option<&'_ [u8]> {
1272
        self.sbix_state().map(|state| state.data)
1273
    }
1274
1275
    fn sbix_state(&self) -> Option<TableState<'_>> {
1276
        match &self.0 {
1277
            TableSource::None => None,
1278
            TableSource::Blob(blob) => blob.sbix(),
1279
            TableSource::Function(func) => func.sbix(),
1280
        }
1281
    }
1282
1283
    /// Style attributes table data.
1284
    ///
1285
    /// See the [STAT](https://learn.microsoft.com/en-us/typography/opentype/spec/stat) specification.
1286
    pub fn stat_data(&self) -> Option<&'_ [u8]> {
1287
        self.stat_state().map(|state| state.data)
1288
    }
1289
1290
    fn stat_state(&self) -> Option<TableState<'_>> {
1291
        match &self.0 {
1292
            TableSource::None => None,
1293
            TableSource::Blob(blob) => blob.stat(),
1294
            TableSource::Function(func) => func.stat(),
1295
        }
1296
    }
1297
1298
    /// Scalable vector graphics table data.
1299
    ///
1300
    /// See the [SVG](https://learn.microsoft.com/en-us/typography/opentype/spec/svg) specification.
1301
    pub fn svg_data(&self) -> Option<&'_ [u8]> {
1302
        self.svg_state().map(|state| state.data)
1303
    }
1304
1305
    fn svg_state(&self) -> Option<TableState<'_>> {
1306
        match &self.0 {
1307
            TableSource::None => None,
1308
            TableSource::Blob(blob) => blob.svg(),
1309
            TableSource::Function(func) => func.svg(),
1310
        }
1311
    }
1312
1313
    /// Tracking table data.
1314
    ///
1315
    /// See the [trak](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6trak.html) specification.
1316
    pub fn trak_data(&self) -> Option<&'_ [u8]> {
1317
        self.trak_state().map(|state| state.data)
1318
    }
1319
1320
    fn trak_state(&self) -> Option<TableState<'_>> {
1321
        match &self.0 {
1322
            TableSource::None => None,
1323
            TableSource::Blob(blob) => blob.trak(),
1324
            TableSource::Function(func) => func.trak(),
1325
        }
1326
    }
1327
1328
    /// Variable composite/component table data.
1329
    ///
1330
    /// See the [VARC](https://github.com/harfbuzz/boring-expansion-spec/blob/main/VARC.md) specification.
1331
    pub fn varc_data(&self) -> Option<&'_ [u8]> {
1332
        self.varc_state().map(|state| state.data)
1333
    }
1334
1335
    fn varc_state(&self) -> Option<TableState<'_>> {
1336
        match &self.0 {
1337
            TableSource::None => None,
1338
            TableSource::Blob(blob) => blob.varc(),
1339
            TableSource::Function(func) => func.varc(),
1340
        }
1341
    }
1342
1343
    /// Vertical header table data.
1344
    ///
1345
    /// See the [vhea](https://learn.microsoft.com/en-us/typography/opentype/spec/vhea) specification.
1346
    pub fn vhea_data(&self) -> Option<&'_ [u8]> {
1347
        self.vhea_state().map(|state| state.data)
1348
    }
1349
1350
    fn vhea_state(&self) -> Option<TableState<'_>> {
1351
        match &self.0 {
1352
            TableSource::None => None,
1353
            TableSource::Blob(blob) => blob.vhea(),
1354
            TableSource::Function(func) => func.vhea(),
1355
        }
1356
    }
1357
1358
    /// Extended vertical header table data.
1359
    ///
1360
    /// See ISO/IEC 14496-22:2026, 5.6.13.
1361
    pub fn vhea_extended_data(&self) -> Option<&'_ [u8]> {
1362
        self.vhea_extended_state().map(|state| state.data)
1363
    }
1364
1365
    fn vhea_extended_state(&self) -> Option<TableState<'_>> {
1366
        match &self.0 {
1367
            TableSource::None => None,
1368
            TableSource::Blob(blob) => blob.vhea_extended(),
1369
            TableSource::Function(func) => func.vhea_extended(),
1370
        }
1371
    }
1372
1373
    /// Vertical metrics table data.
1374
    ///
1375
    /// See the [vmtx](https://learn.microsoft.com/en-us/typography/opentype/spec/vmtx) specification.
1376
    pub fn vmtx_data(&self) -> Option<&'_ [u8]> {
1377
        self.vmtx_state().map(|state| state.data)
1378
    }
1379
1380
    fn vmtx_state(&self) -> Option<TableState<'_>> {
1381
        match &self.0 {
1382
            TableSource::None => None,
1383
            TableSource::Blob(blob) => blob.vmtx(),
1384
            TableSource::Function(func) => func.vmtx(),
1385
        }
1386
    }
1387
1388
    /// Extended vertical metrics table data.
1389
    ///
1390
    /// See ISO/IEC 14496-22:2026, 5.6.14.
1391
    pub fn vmtx_extended_data(&self) -> Option<&'_ [u8]> {
1392
        self.vmtx_extended_state().map(|state| state.data)
1393
    }
1394
1395
    fn vmtx_extended_state(&self) -> Option<TableState<'_>> {
1396
        match &self.0 {
1397
            TableSource::None => None,
1398
            TableSource::Blob(blob) => blob.vmtx_extended(),
1399
            TableSource::Function(func) => func.vmtx_extended(),
1400
        }
1401
    }
1402
1403
    /// Vertical origin table data.
1404
    ///
1405
    /// See the [VORG](https://learn.microsoft.com/en-us/typography/opentype/spec/vorg) specification.
1406
    pub fn vorg_data(&self) -> Option<&'_ [u8]> {
1407
        self.vorg_state().map(|state| state.data)
1408
    }
1409
1410
    fn vorg_state(&self) -> Option<TableState<'_>> {
1411
        match &self.0 {
1412
            TableSource::None => None,
1413
            TableSource::Blob(blob) => blob.vorg(),
1414
            TableSource::Function(func) => func.vorg(),
1415
        }
1416
    }
1417
1418
    /// Vertical metrics variation table data.
1419
    ///
1420
    /// See the [VVAR](https://learn.microsoft.com/en-us/typography/opentype/spec/vvar) specification.
1421
    pub fn vvar_data(&self) -> Option<&'_ [u8]> {
1422
        self.vvar_state().map(|state| state.data)
1423
    }
1424
1425
    fn vvar_state(&self) -> Option<TableState<'_>> {
1426
        match &self.0 {
1427
            TableSource::None => None,
1428
            TableSource::Blob(blob) => blob.vvar(),
1429
            TableSource::Function(func) => func.vvar(),
1430
        }
1431
    }
1432
1433
}