NameTable

Struct NameTable 

Source
pub struct NameTable<'a> {
    pub string_storage: ReadScope<'a>,
    pub name_records: ReadArray<'a, NameRecord>,
    pub opt_langtag_records: Option<ReadArray<'a, LangTagRecord>>,
}
Expand description

Fields§

§string_storage: ReadScope<'a>§name_records: ReadArray<'a, NameRecord>§opt_langtag_records: Option<ReadArray<'a, LangTagRecord>>

Language tag records

Present if name table version is 1 or newer. If present, language ids >= 0x8000 refer to language tag records with 0x8000 the first record, 0x8001 the second, etc.

Implementations§

Source§

impl NameTable<'_>

Source

pub const COPYRIGHT_NOTICE: u16 = 0u16

Source

pub const FONT_FAMILY_NAME: u16 = 1u16

Source

pub const FONT_SUBFAMILY_NAME: u16 = 2u16

Source

pub const UNIQUE_FONT_IDENTIFIER: u16 = 3u16

Source

pub const FULL_FONT_NAME: u16 = 4u16

Source

pub const VERSION_STRING: u16 = 5u16

Source

pub const POSTSCRIPT_NAME: u16 = 6u16

Source

pub const TRADEMARK: u16 = 7u16

Source

pub const MANUFACTURER_NAME: u16 = 8u16

Source

pub const DESIGNER: u16 = 9u16

Source

pub const DESCRIPTION: u16 = 10u16

Source

pub const URL_VENDOR: u16 = 11u16

Source

pub const URL_DESIGNER: u16 = 12u16

Source

pub const LICENSE_DESCRIPTION: u16 = 13u16

Source

pub const LICENSE_INFO_URL: u16 = 14u16

Source

pub const TYPOGRAPHIC_FAMILY_NAME: u16 = 16u16

Source

pub const TYPOGRAPHIC_SUBFAMILY_NAME: u16 = 17u16

Source

pub const COMPATIBLE_FULL: u16 = 18u16

Source

pub const SAMPLE_TEXT: u16 = 19u16

Source

pub const POSTSCRIPT_CID_FINDFONT_NAME: u16 = 20u16

Source

pub const WWS_FAMILY_NAME: u16 = 21u16

Source

pub const WWS_SUBFAMILY_NAME: u16 = 22u16

Source

pub const LIGHT_BACKGROUND_PALETTE: u16 = 23u16

Source

pub const DARK_BACKGROUND_PALETTE: u16 = 24u16

Source

pub const VARIATIONS_POSTSCRIPT_NAME_PREFIX: u16 = 25u16

Source

pub fn string_for_id(&self, name_id: u16) -> Option<String>

Return a string for the supplied name_id.

Returns the first match in this order:

  1. Unicode platform
  2. Windows platform, English language ids
  3. Apple platform, Roman language id

Trait Implementations§

Source§

impl<'b> ReadBinary for NameTable<'b>

Source§

type HostType<'a> = NameTable<'a>

Source§

fn read<'a>(ctxt: &mut ReadCtxt<'a>) -> Result<Self::HostType<'a>, ParseError>

Source§

impl<'a> TryFrom<&NameTable<'a>> for NameTable<'a>

Source§

type Error = ParseError

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

fn try_from(name: &NameTable<'a>) -> Result<NameTable<'a>, ParseError>

Performs the conversion.
Source§

impl<'a> WriteBinary<&NameTable<'a>> for NameTable<'a>

Source§

type Output = ()

The type of the value returned by write.
Source§

fn write<C: WriteContext>( ctxt: &mut C, name: &NameTable<'a>, ) -> Result<(), WriteError>

Write the binary representation of Self to ctxt.

Auto Trait Implementations§

§

impl<'a> Freeze for NameTable<'a>

§

impl<'a> RefUnwindSafe for NameTable<'a>

§

impl<'a> Send for NameTable<'a>

§

impl<'a> Sync for NameTable<'a>

§

impl<'a> Unpin for NameTable<'a>

§

impl<'a> UnwindSafe for NameTable<'a>

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ReadBinaryDep for T
where T: ReadBinary,

Source§

type Args<'a> = ()

Source§

type HostType<'a> = <T as ReadBinary>::HostType<'a>

Source§

fn read_dep<'a>( ctxt: &mut ReadCtxt<'a>, _: <T as ReadBinaryDep>::Args<'_>, ) -> Result<<T as ReadBinaryDep>::HostType<'a>, ParseError>

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

impl<T, HostType> WriteBinaryDep<HostType> for T
where T: WriteBinary<HostType>,

Source§

type Args = ()

The type of the arguments supplied to write_dep.
Source§

type Output = <T as WriteBinary<HostType>>::Output

The type of the value returned by write_dep.
Source§

fn write_dep<C>( ctxt: &mut C, val: HostType, _: <T as WriteBinaryDep<HostType>>::Args, ) -> Result<<T as WriteBinaryDep<HostType>>::Output, WriteError>
where C: WriteContext,

Write the binary representation of Self to ctxt.