pub struct FontManager { /* private fields */ }Expand description
Manages embedded fonts in a PDF document
Implementations§
Source§impl FontManager
impl FontManager
Sourcepub fn embed_font(&mut self, font_data: Vec<u8>) -> Result<usize>
pub fn embed_font(&mut self, font_data: Vec<u8>) -> Result<usize>
Embed a font and return its index
Sourcepub fn record_text(&mut self, font_index: usize, text: &str)
pub fn record_text(&mut self, font_index: usize, text: &str)
Record text usage for a specific font
Sourcepub fn font_count(&self) -> usize
pub fn font_count(&self) -> usize
Number of embedded fonts
Sourcepub fn find_by_name(&self, family: &str) -> Option<usize>
pub fn find_by_name(&self, family: &str) -> Option<usize>
Look up an embedded font index by its family name (case-insensitive).
The comparison is done against PdfFont::font_name (the PostScript name)
as well as any alias registered via embed_font_with_alias.
Returns None if no font with that name is embedded.
Sourcepub fn get_subsetter(&self, index: usize) -> Option<&FontSubsetter>
pub fn get_subsetter(&self, index: usize) -> Option<&FontSubsetter>
Get subsetter for a font by index
Sourcepub fn generate_font_objects(
&self,
start_obj_id: usize,
) -> Result<Vec<FontObjectTuple>>
pub fn generate_font_objects( &self, start_obj_id: usize, ) -> Result<Vec<FontObjectTuple>>
Generate PDF font objects with subsetting
Returns the font descriptor object ID, font stream object ID, CIDFont dictionary object ID, Type 0 font dictionary object ID, ToUnicode CMap object ID, CIDToGIDMap object ID, and the subset font for each embedded font.
Trait Implementations§
Source§impl Debug for FontManager
impl Debug for FontManager
Source§impl Default for FontManager
impl Default for FontManager
Source§fn default() -> FontManager
fn default() -> FontManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FontManager
impl RefUnwindSafe for FontManager
impl Send for FontManager
impl Sync for FontManager
impl Unpin for FontManager
impl UnsafeUnpin for FontManager
impl UnwindSafe for FontManager
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
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>
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 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().