Struct printpdf::ExternalFont
source · pub struct ExternalFont { /* private fields */ }
Implementations§
source§impl ExternalFont
impl ExternalFont
sourcepub fn new<R>(font_stream: R, font_index: usize) -> Result<Self, Error>where
R: Read,
pub fn new<R>(font_stream: R, font_index: usize) -> Result<Self, Error>where
R: Read,
Creates a new font. The index
is used for naming / identifying the font
This method uses owned_ttf_parser
to parse the font data. If you want to use a different
font backend, use the with_font_data
method instead.
sourcepub fn with_font_data(
bytes: Vec<u8>,
font_index: usize,
font_data: Box<dyn FontData>
) -> Self
pub fn with_font_data( bytes: Vec<u8>, font_index: usize, font_data: Box<dyn FontData> ) -> Self
Creates a new font. The index
is used for naming / identifying the font
sourcepub fn set_allow_subsetting(&self, allow_subsetting: bool)
pub fn set_allow_subsetting(&self, allow_subsetting: bool)
Set whether or not to allow subsetting for the font. If subsetting is set to true, unused
glyphs will be removed before embedding the font into the PDF file. By default this is set
to true
sourcepub fn with_allow_subsetting(self, allow_subsetting: bool) -> Self
pub fn with_allow_subsetting(self, allow_subsetting: bool) -> Self
Set whether or not to allow subsetting for the font. If subsetting is set to true, unused
glyphs will be removed before embedding the font into the PDF file. By default this is set
to true
Trait Implementations§
source§impl Clone for ExternalFont
impl Clone for ExternalFont
source§fn clone(&self) -> ExternalFont
fn clone(&self) -> ExternalFont
Returns a copy 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 moresource§impl Debug for ExternalFont
impl Debug for ExternalFont
source§impl PartialEq for ExternalFont
impl PartialEq for ExternalFont
source§fn eq(&self, other: &ExternalFont) -> bool
fn eq(&self, other: &ExternalFont) -> bool
Two fonts are equal if their names are equal, the contents aren’t checked
Auto Trait Implementations§
impl !RefUnwindSafe for ExternalFont
impl !Send for ExternalFont
impl !Sync for ExternalFont
impl Unpin for ExternalFont
impl !UnwindSafe for ExternalFont
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