pub struct Type0Font<'a> { /* private fields */ }
Expand description
Writer for a Type-0 (composite) font dictionary. PDF 1.2+.
This struct is created by Chunk::type0_font
.
Implementations§
source§impl<'a> Type0Font<'a>
impl<'a> Type0Font<'a>
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 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_cmap
is required.
sourcepub fn encoding_cmap(&mut self, cmap: Ref) -> &mut Self
pub fn encoding_cmap(&mut self, cmap: Ref) -> &mut Self
Write the /Encoding
attribute as a reference to a character map.
Either this or encoding_predefined
is
required.
sourcepub fn descendant_font(&mut self, cid_font: Ref) -> &mut Self
pub fn descendant_font(&mut self, cid_font: Ref) -> &mut Self
Write the /DescendantFonts
attribute as a one-element array containing
a reference to a CidFont
. Required.
sourcepub fn to_unicode(&mut self, cmap: Ref) -> &mut Self
pub fn to_unicode(&mut self, cmap: Ref) -> &mut Self
Write the /ToUnicode
attribute.
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.
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.