Skip to main content

CharmapId

Struct CharmapId 

Source
pub struct CharmapId {
    pub platform: u16,
    pub encoding: u16,
}
Expand description

A charmap’s (platform, encoding) identity, as the cmap table declares it.

PDFium compares these pairs literally — (3,1) for Windows Unicode, (3,0) for Windows Symbol, (1,0) for Mac Roman — and the order it prefers them in flips with the symbolic flag, so the pairs have to survive as data rather than being collapsed into a “best charmap”.

Fields§

§platform: u16

The cmap platform ID.

§encoding: u16

The cmap encoding ID, whose meaning depends on the platform.

Implementations§

Source§

impl CharmapId

Source

pub const WINDOWS_UNICODE: Self

Windows Unicode BMP — the charmap UseTTCharmapUnicode accepts outright.

Source

pub const WINDOWS_SYMBOL: Self

Windows Symbol, the 0xF0xx private-use charmap.

Source

pub const MAC_ROMAN: Self

Mac Roman.

Source

pub const UNICODE_SYNTHETIC: Self

The synthesized Unicode charmap a Type 1 face exposes first.

Source

pub const ADOBE_CUSTOM: Self

A Type 1 face’s own encoding vector, which FreeType reports as ADOBE_CUSTOM.

Source

pub fn is_unicode(self) -> bool

Does this charmap map Unicode?

Platform 0 is Unicode by definition and (3,1)/(3,10) are Windows’ Unicode encodings. This is FreeType’s FT_ENCODING_UNICODE test, which UseTTCharmapUnicode reads for any charmap that is not (3,0).

Trait Implementations§

Source§

impl Clone for CharmapId

Source§

fn clone(&self) -> CharmapId

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for CharmapId

Source§

impl Debug for CharmapId

Source§

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

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

impl Eq for CharmapId

Source§

impl Hash for CharmapId

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CharmapId

Source§

fn eq(&self, other: &CharmapId) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CharmapId

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.