Struct write_fonts::tables::post::Post

source ·
pub struct Post {
    pub version: Version16Dot16,
    pub italic_angle: Fixed,
    pub underline_position: FWord,
    pub underline_thickness: FWord,
    pub is_fixed_pitch: u32,
    pub min_mem_type42: u32,
    pub max_mem_type42: u32,
    pub min_mem_type1: u32,
    pub max_mem_type1: u32,
    pub num_glyphs: Option<u16>,
    pub glyph_name_index: Option<Vec<u16>>,
    pub string_data: Option<Vec<PString>>,
}
Expand description

Fields§

§version: Version16Dot16

0x00010000 for version 1.0 0x00020000 for version 2.0 0x00025000 for version 2.5 (deprecated) 0x00030000 for version 3.0

§italic_angle: Fixed

Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).

§underline_position: FWord

This is the suggested distance of the top of the underline from the baseline (negative values indicate below baseline). The PostScript definition of this FontInfo dictionary key (the y coordinate of the center of the stroke) is not used for historical reasons. The value of the PostScript key may be calculated by subtracting half the underlineThickness from the value of this field.

§underline_thickness: FWord

Suggested values for the underline thickness. In general, the underline thickness should match the thickness of the underscore character (U+005F LOW LINE), and should also match the strikeout thickness, which is specified in the OS/2 table.

§is_fixed_pitch: u32

Set to 0 if the font is proportionally spaced, non-zero if the font is not proportionally spaced (i.e. monospaced).

§min_mem_type42: u32

Minimum memory usage when an OpenType font is downloaded.

§max_mem_type42: u32

Maximum memory usage when an OpenType font is downloaded.

§min_mem_type1: u32

Minimum memory usage when an OpenType font is downloaded as a Type 1 font.

§max_mem_type1: u32

Maximum memory usage when an OpenType font is downloaded as a Type 1 font.

§num_glyphs: Option<u16>

Number of glyphs (this should be the same as numGlyphs in ‘maxp’ table).

§glyph_name_index: Option<Vec<u16>>

Array of indices into the string data. See below for details.

§string_data: Option<Vec<PString>>

Storage for the string data.

Implementations§

source§

impl Post

source

pub fn new( italic_angle: Fixed, underline_position: FWord, underline_thickness: FWord, is_fixed_pitch: u32, min_mem_type42: u32, max_mem_type42: u32, min_mem_type1: u32, max_mem_type1: u32 ) -> Self

Construct a new Post

source§

impl Post

source

pub fn new_v2<'a>(order: impl IntoIterator<Item = &'a str>) -> Self

Construct a new version 2.0 table from a glyph order.

Trait Implementations§

source§

impl Clone for Post

source§

fn clone(&self) -> Post

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 Post

source§

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

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

impl Default for Post

source§

fn default() -> Self

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

impl<'a> FontRead<'a> for Post

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 Post

source§

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

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

fn table_type(&self) -> TableType

The type of this table. Read more
source§

impl TopLevelTable for Post

source§

const TAG: Tag = _

The table’s tag.
source§

impl Validate for Post

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 Post

§

impl Send for Post

§

impl Sync for Post

§

impl Unpin for Post

§

impl UnwindSafe for Post

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<'a, T> FontReadWithArgs<'a> for Twhere T: FontRead<'a>,

source§

fn read_with_args( data: FontData<'a>, _: &<T as ReadArgs>::Args ) -> Result<T, ReadError>

read an item, using the provided args. 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 Twhere 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<'a, T> ReadArgs for Twhere T: FontRead<'a>,

§

type Args = ()

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.
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.
source§

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

Performs the conversion.