Struct pdf_writer::writers::Type3Font
source · pub struct Type3Font<'a> { /* private fields */ }
Expand description
Writer for a Type-3 font dictionary.
This struct is created by Chunk::type3_font
.
Implementations§
source§impl<'a> Type3Font<'a>
impl<'a> Type3Font<'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 matrix(&mut self, matrix: [f32; 6]) -> &mut Self
pub fn matrix(&mut self, matrix: [f32; 6]) -> &mut Self
Write the /FontMatrix
attribute, which defines the mapping from glyph
space to text space. Required.
sourcepub fn char_procs(&mut self) -> TypedDict<'_, Ref>
pub fn char_procs(&mut self) -> TypedDict<'_, Ref>
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 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.
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.
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.
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 in Tagged PDFs.
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>>§
sourcepub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
pub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
Start writing a pair with an arbitrary value.