Struct RetainedGraphicsState

Source
pub struct RetainedGraphicsState {
Show 15 fields pub auto_flip: bool, pub control_value_cutin: F26Dot6, pub delta_base: u16, pub delta_shift: u16, pub instruct_control: u8, pub min_distance: F26Dot6, pub scan_control: bool, pub scan_type: i32, pub single_width_cutin: F26Dot6, pub single_width: F26Dot6, pub target: Target, pub scale: i32, pub ppem: i32, pub is_rotated: bool, pub is_stretched: bool,
}
Expand description

The persistent graphics state.

Some of the graphics state is set by the control value program and persists between runs of the interpreter. This struct captures that state.

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html

Fields§

§auto_flip: bool

Controls whether the sign of control value table entries will be changed to match the sign of the actual distance measurement with which it is compared.

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#auto%20flip

§control_value_cutin: F26Dot6

Limits the regularizing effects of control value table entries to cases where the difference between the table value and the measurement taken from the original outline is sufficiently small.

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#control_value_cut-in

§delta_base: u16

Establishes the base value used to calculate the range of point sizes to which a given DELTAC[] or DELTAP[] instruction will apply.

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#delta%20base

§delta_shift: u16

Determines the range of movement and smallest magnitude of movement (the step) in a DELTAC[] or DELTAP[] instruction.

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#delta%20shift

§instruct_control: u8

Makes it possible to turn off instructions under some circumstances. When set to TRUE, no instructions will be executed

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#instruct%20control

§min_distance: F26Dot6

Establishes the smallest possible value to which a distance will be rounded.

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#minimum%20distance

§scan_control: bool

Determines whether the interpreter will activate dropout control for the current glyph.

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#scan%20control

§scan_type: i32

Type associated with scan_control.

§single_width_cutin: F26Dot6

The distance difference below which the interpreter will replace a CVT distance or an actual distance in favor of the single width value.

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#single_width_cut_in

§single_width: F26Dot6

The value used in place of the control value table distance or the actual distance value when the difference between that distance and the single width value is less than the single width cut-in.

See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#single_width_value

§target: Target

The user requested hinting target.

§scale: i32

The scale factor for the current instance. Conversion from font units to 26.6 for current ppem.

§ppem: i32

The nominal pixels per em value for the current instance.

§is_rotated: bool

True if a rotation is being applied.

§is_stretched: bool

True if a non-uniform scale is being applied.

Implementations§

Source§

impl RetainedGraphicsState

Source

pub fn new(scale: i32, ppem: i32, target: Target) -> Self

Trait Implementations§

Source§

impl Clone for RetainedGraphicsState

Source§

fn clone(&self) -> RetainedGraphicsState

Returns a duplicate 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 RetainedGraphicsState

Source§

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

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

impl Default for RetainedGraphicsState

Source§

fn default() -> Self

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

impl Copy for RetainedGraphicsState

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where T: Clone,

Source§

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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.