read_fonts::tables::head

Type Alias Head

Source
pub type Head<'a> = TableRef<'a, HeadMarker>;
Expand description

The head (font header) table.

Aliased Type§

struct Head<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Head<'a>

Source

pub fn version(&self) -> MajorMinor

Version number of the font header table, set to (1, 0)

Source

pub fn font_revision(&self) -> Fixed

Set by font manufacturer.

Source

pub fn checksum_adjustment(&self) -> u32

To compute: set it to 0, sum the entire font as uint32, then store 0xB1B0AFBA - sum. If the font is used as a component in a font collection file, the value of this field will be invalidated by changes to the file structure and font table directory, and must be ignored.

Source

pub fn magic_number(&self) -> u32

Set to 0x5F0F3CF5.

Source

pub fn flags(&self) -> u16

See the flags enum

Source

pub fn units_per_em(&self) -> u16

Set to a value from 16 to 16384. Any value in this range is valid. In fonts that have TrueType outlines, a power of 2 is recommended as this allows performance optimizations in some rasterizers.

Source

pub fn created(&self) -> LongDateTime

Number of seconds since 12:00 midnight that started January 1st 1904 in GMT/UTC time zone.

Source

pub fn modified(&self) -> LongDateTime

Number of seconds since 12:00 midnight that started January 1st 1904 in GMT/UTC time zone.

Source

pub fn x_min(&self) -> i16

Minimum x coordinate across all glyph bounding boxes.

Source

pub fn y_min(&self) -> i16

Minimum y coordinate across all glyph bounding boxes.

Source

pub fn x_max(&self) -> i16

Maximum x coordinate across all glyph bounding boxes.

Source

pub fn y_max(&self) -> i16

Maximum y coordinate across all glyph bounding boxes.

Source

pub fn mac_style(&self) -> MacStyle

Bits identifying the font’s style; see MacStyle

Source

pub fn lowest_rec_ppem(&self) -> u16

Smallest readable size in pixels.

Source

pub fn font_direction_hint(&self) -> i16

Deprecated (Set to 2).

Source

pub fn index_to_loc_format(&self) -> i16

0 for short offsets (Offset16), 1 for long (Offset32).

Source

pub fn glyph_data_format(&self) -> i16

0 for current format.

Trait Implementations§

Source§

impl<'a> FontRead<'a> for Head<'a>

Source§

fn read(data: FontData<'a>) -> Result<Self, ReadError>

Read an instance of Self from the provided data, performing validation. Read more
Source§

impl TopLevelTable for Head<'_>

Source§

const TAG: Tag = _

head