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: f64Default 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: boolIf true, CID maps directly to GID (Identity CIDToGIDMap).
substituted: boolIf 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: boolIf 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: u8Writing 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§
impl Freeze for CidTrueTypePdfFont
impl RefUnwindSafe for CidTrueTypePdfFont
impl Send for CidTrueTypePdfFont
impl Sync for CidTrueTypePdfFont
impl Unpin for CidTrueTypePdfFont
impl UnsafeUnpin for CidTrueTypePdfFont
impl UnwindSafe for CidTrueTypePdfFont
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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