Struct pdfium_render::font::PdfFont
source · [−]pub struct PdfFont<'a> { /* private fields */ }Expand description
A single font used to render text in a PdfDocument.
The PDF specification defines 14 built-in fonts that can be used in any PDF file without font embedding. Additionally, custom fonts can be directly embedded into any PDF file as a data stream.
Implementations
sourceimpl<'a> PdfFont<'a>
impl<'a> PdfFont<'a>
sourcepub fn new_built_in(document: PdfDocument<'a>, font: PdfFontBuiltin) -> Self
pub fn new_built_in(document: PdfDocument<'a>, font: PdfFontBuiltin) -> Self
Loads the given built-in PDF font.
sourcepub fn new_type1_from_bytes(
document: PdfDocument<'a>,
font_data: &[u8],
is_cid_font: bool
) -> Result<Self, PdfiumError>
pub fn new_type1_from_bytes(
document: PdfDocument<'a>,
font_data: &[u8],
is_cid_font: bool
) -> Result<Self, PdfiumError>
Attempts to load the given byte data as a Type 1 font file.
Set the is_cid_font parameter to true if the given font is keyed by
16-bit character ID (CID), indicating that it supports an extended glyphset of
65,535 glyphs. This is typically the case with fonts that support Asian character sets
or right-to-left languages.
sourcepub fn new_true_type_from_bytes(
document: PdfDocument<'a>,
font_data: &[u8],
is_cid_font: bool
) -> Result<Self, PdfiumError>
pub fn new_true_type_from_bytes(
document: PdfDocument<'a>,
font_data: &[u8],
is_cid_font: bool
) -> Result<Self, PdfiumError>
Attempts to load the given byte data as a TrueType font file.
Set the is_cid_font parameter to true if the given font is keyed by
16-bit character ID (CID), indicating that it supports an extended glyphset of
65,535 glyphs. This is typically the case with fonts that support Asian character sets
or right-to-left languages.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for PdfFont<'a>
impl<'a> !Send for PdfFont<'a>
impl<'a> !Sync for PdfFont<'a>
impl<'a> Unpin for PdfFont<'a>
impl<'a> !UnwindSafe for PdfFont<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more