pub struct CidFontMetrics { /* private fields */ }Expand description
Font metrics for a CID font, handling the /W array and /DW default width.
CID fonts use a different width specification than simple fonts:
- /DW: default width for all CIDs (default 1000)
- /W: array of width overrides in the format:
[CID [w1 w2 ...] CIDstart CIDend w ...]
Implementations§
Source§impl CidFontMetrics
impl CidFontMetrics
Sourcepub fn new(
widths: HashMap<u32, f64>,
default_width: f64,
ascent: f64,
descent: f64,
font_bbox: Option<[f64; 4]>,
font_type: CidFontType,
cid_to_gid: CidToGidMap,
system_info: Option<CidSystemInfo>,
) -> Self
pub fn new( widths: HashMap<u32, f64>, default_width: f64, ascent: f64, descent: f64, font_bbox: Option<[f64; 4]>, font_type: CidFontType, cid_to_gid: CidToGidMap, system_info: Option<CidSystemInfo>, ) -> Self
Create CidFontMetrics from parsed values.
Sourcepub fn default_metrics() -> Self
pub fn default_metrics() -> Self
Create default CidFontMetrics.
Sourcepub fn get_width(&self, cid: u32) -> f64
pub fn get_width(&self, cid: u32) -> f64
Get the width for a CID in glyph space (1/1000 of text space).
Sourcepub fn default_width(&self) -> f64
pub fn default_width(&self) -> f64
Default width for CIDs not in the width overrides.
Sourcepub fn font_type(&self) -> CidFontType
pub fn font_type(&self) -> CidFontType
CID font subtype.
Sourcepub fn cid_to_gid(&self) -> &CidToGidMap
pub fn cid_to_gid(&self) -> &CidToGidMap
CID-to-GID mapping.
Sourcepub fn map_cid_to_gid(&self, cid: u32) -> u32
pub fn map_cid_to_gid(&self, cid: u32) -> u32
Map a CID to a GID.
Sourcepub fn system_info(&self) -> Option<&CidSystemInfo>
pub fn system_info(&self) -> Option<&CidSystemInfo>
CID system information.
Trait Implementations§
Source§impl Clone for CidFontMetrics
impl Clone for CidFontMetrics
Source§fn clone(&self) -> CidFontMetrics
fn clone(&self) -> CidFontMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CidFontMetrics
impl RefUnwindSafe for CidFontMetrics
impl Send for CidFontMetrics
impl Sync for CidFontMetrics
impl Unpin for CidFontMetrics
impl UnsafeUnpin for CidFontMetrics
impl UnwindSafe for CidFontMetrics
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
Mutably borrows from an owned value. Read more