Struct ttf_parser::Name[][src]

pub struct Name<'a> { /* fields omitted */ }

Implementations

impl<'a> Name<'a>[src]

pub fn platform_id(&self) -> PlatformId[src]

Returns the platform ID.

pub fn encoding_id(&self) -> u16[src]

Returns the platform-specific encoding ID.

pub fn language_id(&self) -> u16[src]

Returns the language ID.

pub fn name_id(&self) -> u16[src]

Returns the Name ID.

A predefined list of ID's can be found in the name_id module.

pub fn name(&self) -> &'a [u8][src]

Returns the Name's data as bytes.

Can be empty.

pub fn to_string(&self) -> Option<String>[src]

Returns the Name's data as a UTF-8 string.

Only Unicode names are supported. And since they are stored as UTF-16BE, we can't return &str and have to allocate a String.

Supports:

  • Unicode Platform ID
  • Windows Platform ID + Symbol
  • Windows Platform ID + Unicode BMP

pub fn is_unicode(&self) -> bool[src]

Checks that the current Name data has a Unicode encoding.

Trait Implementations

impl<'a> Clone for Name<'a>[src]

impl<'a> Copy for Name<'a>[src]

impl<'a> Debug for Name<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Name<'a>[src]

impl<'a> Send for Name<'a>[src]

impl<'a> Sync for Name<'a>[src]

impl<'a> Unpin for Name<'a>[src]

impl<'a> UnwindSafe for Name<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.