Skip to main content

read_fonts/tables/glyf/bytecode/
program.rs

1//! The three programs a font can carry.
2
3/// Which of a font's three programs some bytecode came from.
4///
5/// They differ in more than provenance: only the font program may define
6/// functions and instructions, and only a glyph program has a glyph to work
7/// on.
8#[derive(Copy, Clone, PartialEq, Eq, Default, Debug)]
9#[repr(u8)]
10pub enum Program {
11    /// Initializes the function and instruction tables. Stored in `fpgm`.
12    #[default]
13    Font = 0,
14    /// Initializes the control value table and storage area for a size and
15    /// other parameters. Stored in `prep`.
16    ControlValue = 1,
17    /// Hints one glyph. Stored with the glyph in `glyf`.
18    Glyph = 2,
19}