fonttools 0.1.0

A library for reading, manipulating and writing OpenType font files
Documentation
use otspec::types::*;
use otspec_macros::tables;
use serde::{Deserialize, Serialize};

tables!(STATcore {
    uint16 majorVersion
    uint16 minorVersion
    uint16 designAxisSize
    uint16 designAxisCount
    uint32 designAxesOffset
    uint16 axisValueCount
    uint32 offsetToAxisValueOffsets
}

AxisRecord {
    Tag axisTag
    uint16 axisNameID
    uint16 axisOrdering
}

AxisValueFormat1 {
    uint16  format
    uint16  axisIndex
    uint16  flags
    uint16  valueNameID
    Fixed   value
}

AxisValueFormat2 {
    uint16  format
    uint16  axisIndex
    uint16  flags
    uint16  valueNameID
    Fixed   nominalValue
    Fixed   rangeMinValue
    Fixed   rangeMaxValue
}

AxisValueFormat3 {
    uint16  format
    uint16  axisIndex
    uint16  flags
    uint16  valueNameID
    Fixed   value
    Fixed   linkedValue
}

AxisValueFormat4Core {
    uint16  format
    uint16  axisCount
    uint16  flags
    uint16  valueNameID
}

AxisValueFormat4AxisValue {
    uint16  axisIndex
    Fixed   value
}
);

bitflags! {
    #[derive(Serialize, Deserialize)]
    /// The following axis value table flags are defined:
    pub struct AxisValueFlags: u16 {
        /// If set, this axis value table provides axis value information that is applicable to other fonts within the same font family.
        const OLDER_SIBLING_FONT_ATTRIBUTE = 0x0001;
        /// If set, it indicates that the axis value represents the “normal” value for the axis and may be omitted when composing name strings.
        const ELIDABLE_AXIS_VALUE_NAME = 0x0002;
    }
}

struct AxisValue {
    axis_index: uint16,
    flags: AxisValueFlags,

}

#[derive(Debug, PartialEq)]
#[allow(clippy::upper_case_acronyms)]
/// The Style Attributes table
pub struct STAT {
    // The *minor* version of the STAT table
    version: uint16,
    // The design axes array
    design_axes: Vec<AxisRecord>,
    // The axis value table array
    axis_values: Vec<AxisValue>
}

#[cfg(test)]
mod tests {
    use crate::STAT::STAT;
    use otspec::ser;

}