Struct pdf_writer::writers::Type1Font
source · [−]pub struct Type1Font<'a> { /* private fields */ }
Expand description
Writer for a Type-1 font dictionary.
This struct is created by PdfWriter::type1_font
.
Implementations
sourceimpl<'a> Type1Font<'a>
impl<'a> Type1Font<'a>
sourcepub fn name(&mut self, name: Name<'_>) -> &mut Self
pub fn name(&mut self, name: Name<'_>) -> &mut Self
Write the /Name
attribute, which is the name of the font in the
current resource dictionary. Required in PDF 1.0, discouraged in PDF
1.1+.
sourcepub fn base_font(&mut self, name: Name<'_>) -> &mut Self
pub fn base_font(&mut self, name: Name<'_>) -> &mut Self
Write the /BaseFont
attribute. This is the PostScript name of the
font. Required.
sourcepub fn first_char(&mut self, first: u8) -> &mut Self
pub fn first_char(&mut self, first: u8) -> &mut Self
Write the FirstChar
attribute, defining the first character code in
the font’s widths array. Required (except for standard 14 fonts
before PDF 1.5).
sourcepub fn last_char(&mut self, last: u8) -> &mut Self
pub fn last_char(&mut self, last: u8) -> &mut Self
Write the LastChar
attribute, defining the last character code in the
font’s widths array. Required (except for standard 14 fonts before
PDF 1.5).
sourcepub fn widths(&mut self, widths: impl IntoIterator<Item = f32>) -> &mut Self
pub fn widths(&mut self, widths: impl IntoIterator<Item = f32>) -> &mut Self
Write the /Widths
array. Should be of length last - first + 1
.
Required (except for standard 14 fonts before PDF 1.5).
sourcepub fn font_descriptor(&mut self, id: Ref) -> &mut Self
pub fn font_descriptor(&mut self, id: Ref) -> &mut Self
Write the /FontDescriptor
attribute. Required (except for standard 14
fonts before PDF 1.5).
sourcepub fn encoding_predefined(&mut self, encoding: Name<'_>) -> &mut Self
pub fn encoding_predefined(&mut self, encoding: Name<'_>) -> &mut Self
Write the /Encoding
attribute as a predefined encoding. Either this or
encoding_custom
is required.
sourcepub fn encoding_custom(&mut self) -> Encoding<'_>
pub fn encoding_custom(&mut self) -> Encoding<'_>
Start writing an /Encoding
dictionary. Either this or
encoding_predefined
is required.
sourcepub fn to_unicode(&mut self, id: Ref) -> &mut Self
pub fn to_unicode(&mut self, id: Ref) -> &mut Self
Write the /ToUnicode
attribute. PDF 1.2+.
A suitable character map can be built with UnicodeCmap
.
Methods from Deref<Target = Dict<'a>>
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Type1Font<'a>
impl<'a> Send for Type1Font<'a>
impl<'a> Sync for Type1Font<'a>
impl<'a> Unpin for Type1Font<'a>
impl<'a> !UnwindSafe for Type1Font<'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