Skip to main content

CffFont

Struct CffFont 

Source
pub struct CffFont {
Show 15 fields pub name: String, pub font_matrix: [f64; 6], pub font_bbox: [f64; 4], pub char_strings: Vec<Vec<u8>>, pub charset: Vec<String>, pub encoding: Vec<u16>, pub default_width_x: f64, pub nominal_width_x: f64, pub local_subrs: Vec<Vec<u8>>, pub global_subrs: Vec<Vec<u8>>, pub is_cid: bool, pub fd_array: Vec<FdEntry>, pub fd_select: Vec<u8>, pub ros: Option<(String, String, i32)>, pub cid_to_gid: Vec<u16>,
}
Expand description

A parsed CFF font.

Fields§

§name: String

Font name from Name INDEX.

§font_matrix: [f64; 6]

Font transformation matrix (default [0.001, 0, 0, 0.001, 0, 0]).

§font_bbox: [f64; 4]

Font bounding box.

§char_strings: Vec<Vec<u8>>

GID-indexed raw Type 2 charstring bytes.

§charset: Vec<String>

GID → glyph name.

§encoding: Vec<u16>

char_code (0–255) → GID.

§default_width_x: f64

Default advance width from Private DICT.

§nominal_width_x: f64

Nominal advance width from Private DICT.

§local_subrs: Vec<Vec<u8>>

Local subroutines from Private DICT.

§global_subrs: Vec<Vec<u8>>

Global subroutines (shared across all fonts in FontSet).

§is_cid: bool

Whether this is a CID-keyed font (ROS operator present).

§fd_array: Vec<FdEntry>

Per-FD Private dicts + subrs (CID only).

§fd_select: Vec<u8>

GID → FD index (CID only).

§ros: Option<(String, String, i32)>

Registry-Ordering-Supplement (CID only).

§cid_to_gid: Vec<u16>

CID → GID mapping for CID-keyed fonts. In CID fonts, the charset encodes GID → CID; this is the reverse map.

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