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. Always required in PDF 1.0, required if
FontName
is set in child font descriptor.
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
.
This attribute is required in some profiles of PDF/A-2, PDF/A-3, and
PDF/A-4 for some fonts. When present, these standards require that no
character may be mapped to 0
, U+FEFF
, or U+FFFE
.
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.
sourcepub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
pub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
Write a pair with a primitive value.
This is a shorthand for dict.insert(key).primitive(value)
.
sourcepub fn pairs<'n, T: Primitive>(
&mut self,
pairs: impl IntoIterator<Item = (Name<'n>, T)>,
) -> &mut Self
pub fn pairs<'n, T: Primitive>( &mut self, pairs: impl IntoIterator<Item = (Name<'n>, T)>, ) -> &mut Self
Write a sequence of pairs with primitive values.