Skip to main content

CidTrueTypePdfFont

Struct CidTrueTypePdfFont 

Source
pub struct CidTrueTypePdfFont {
Show 16 fields pub data: Vec<u8>, pub default_width: f64, pub cid_widths: HashMap<u16, f64>, pub cmap: HashMap<u32, u16>, pub units_per_em: f64, pub identity_cid_to_gid: bool, pub substituted: bool, pub cid_to_gid_map: Option<Vec<u16>>, pub to_unicode: HashMap<u16, u32>, pub ordering: Vec<u8>, pub ucs2_encoding: bool, pub code_lengths: [u8; 256], pub code_to_cid: HashMap<u32, u32>, pub wmode: u8, pub dw2: [f64; 2], pub w2: HashMap<u16, [f64; 3]>,
}
Expand description

CIDFontType2: TrueType outlines accessed by CID (2-byte char codes).

Fields§

§data: Vec<u8>§default_width: f64

Default glyph width (from /DW, in text space ÷1000).

§cid_widths: HashMap<u16, f64>

CID → width mapping (from /W array, in text space ÷1000).

§cmap: HashMap<u32, u16>§units_per_em: f64§identity_cid_to_gid: bool

If true, CID maps directly to GID (Identity CIDToGIDMap).

§substituted: bool

If true, font data was loaded from the system (not embedded in PDF). For substituted fonts, CIDs are treated as Unicode and mapped via cmap.

§cid_to_gid_map: Option<Vec<u16>>

Explicit CID-to-GID mapping from a CIDToGIDMap stream. Index = CID, value = GID. Takes priority over identity mapping.

§to_unicode: HashMap<u16, u32>

CID → Unicode mapping from the Type 0 font’s /ToUnicode CMap. Used for substituted fonts to convert CID → Unicode → GID via cmap.

§ordering: Vec<u8>

CIDSystemInfo /Ordering (e.g. b“Japan1“, b“GB1“) for CID→Unicode fallback.

§ucs2_encoding: bool

If true, the encoding is UCS2-based (e.g. UniJIS-UCS2-H) and character codes are Unicode values that need mapping to CIDs for width lookup.

§code_lengths: [u8; 256]

First-byte → code length table from the encoding CMap’s codespace ranges. Supports mixed-width encodings (e.g. 1-byte space + 2-byte CIDs).

§code_to_cid: HashMap<u32, u32>

Code → CID mapping from the encoding CMap (empty = identity).

§wmode: u8

Writing mode: 0 = horizontal, 1 = vertical.

§dw2: [f64; 2]

Default vertical metrics [v_y, w1] from /DW2 (default: [880, -1000]). v_y = vertical origin offset, w1 = vertical advance width.

§w2: HashMap<u16, [f64; 3]>

Per-CID vertical metrics from /W2: CID → (w1, v_x, v_y). w1 = vertical advance, v_x/v_y = position vector components (in 1/1000 em).

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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, <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.