Struct write_fonts::tables::head::Head

source ·
pub struct Head {
Show 15 fields pub font_revision: Fixed, pub checksum_adjustment: u32, pub magic_number: u32, pub flags: u16, pub units_per_em: u16, pub created: LongDateTime, pub modified: LongDateTime, pub x_min: i16, pub y_min: i16, pub x_max: i16, pub y_max: i16, pub mac_style: u16, pub lowest_rec_ppem: u16, pub font_direction_hint: i16, pub index_to_loc_format: i16,
}
Expand description

Fields§

§font_revision: Fixed

Set by font manufacturer.

§checksum_adjustment: 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.

§magic_number: u32

Set to 0x5F0F3CF5.

§flags: u16

See the flags enum

§units_per_em: 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.

§created: LongDateTime

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

§modified: LongDateTime

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

§x_min: i16

Minimum x coordinate across all glyph bounding boxes.

§y_min: i16

Minimum y coordinate across all glyph bounding boxes.

§x_max: i16

Maximum x coordinate across all glyph bounding boxes.

§y_max: i16

Maximum y coordinate across all glyph bounding boxes.

§mac_style: u16

see somewhere else

§lowest_rec_ppem: u16

Smallest readable size in pixels.

§font_direction_hint: i16

Deprecated (Set to 2).

§index_to_loc_format: i16

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

Implementations§

source§

impl Head

source

pub fn new( font_revision: Fixed, checksum_adjustment: u32, flags: u16, units_per_em: u16, created: LongDateTime, modified: LongDateTime, x_min: i16, y_min: i16, x_max: i16, y_max: i16, mac_style: u16, lowest_rec_ppem: u16, index_to_loc_format: i16 ) -> Self

Construct a new Head

Trait Implementations§

source§

impl Clone for Head

source§

fn clone(&self) -> Head

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Head

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Head

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

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

source§

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

Read an instace of Self from the provided data, performing validation. Read more
source§

impl FontWrite for Head

source§

fn write_into(&self, writer: &mut TableWriter)

Write our data and information about offsets into this TableWriter.
source§

impl TopLevelTable for Head

source§

const TAG: Tag = _

The table’s tag.
source§

impl Validate for Head

source§

fn validate_impl(&self, _ctx: &mut ValidationCtx)

Validate this table. Read more
source§

fn validate(&self) -> Result<(), ValidationReport>

Ensure that this table is well-formed, reporting any errors. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Head

§

impl Send for Head

§

impl Sync for Head

§

impl Unpin for Head

§

impl UnwindSafe for Head

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<U, T> ToOwnedObj<U> for Twhere U: FromObjRef<T>,

source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
source§

impl<U, T> ToOwnedTable<U> for Twhere U: FromTableRef<T>,

source§

fn to_owned_table(&self) -> U

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.