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> Debug for Head<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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<'a> SomeTable<'a> for Head<'a>

source§

fn type_name(&self) -> &str

The name of this table
source§

fn get_field(&self, idx: usize) -> Option<Field<'a>>

Access this table’s fields, in declaration order.
source§

impl TopLevelTable for Head<'_>

source§

const TAG: Tag = _

head