Struct pdf_writer::writers::FontDescriptor
source · pub struct FontDescriptor<'a> { /* private fields */ }
Expand description
Writer for a font descriptor dictionary.
This struct is created by Chunk::font_descriptor
.
Implementations§
source§impl<'a> FontDescriptor<'a>
impl<'a> FontDescriptor<'a>
sourcepub fn family(&mut self, family: Str<'_>) -> &mut Self
pub fn family(&mut self, family: Str<'_>) -> &mut Self
Write the /FontFamily
attribute. Recommended for Type 3 fonts in
Tagged PDFs. PDF 1.5+.
sourcepub fn stretch(&mut self, stretch: FontStretch) -> &mut Self
pub fn stretch(&mut self, stretch: FontStretch) -> &mut Self
Write the /FontStretch
attribute. Recommended for Type 3 fonts in
Tagged PDFs. PDF 1.5+.
sourcepub fn weight(&mut self, weight: u16) -> &mut Self
pub fn weight(&mut self, weight: u16) -> &mut Self
Write the /FontWeight
attribute. Should be between 100 (lightest) and
900 (heaviest), 400 is normal weight, 700 is bold. Recommended
for Type 3 fonts in Tagged PDFs. PDF 1.5+.
sourcepub fn bbox(&mut self, bbox: Rect) -> &mut Self
pub fn bbox(&mut self, bbox: Rect) -> &mut Self
Write the /FontBBox
attribute. Required, except for Type 3 fonts.
sourcepub fn italic_angle(&mut self, angle: f32) -> &mut Self
pub fn italic_angle(&mut self, angle: f32) -> &mut Self
Write the /ItalicAngle
attribute. Required.
sourcepub fn cap_height(&mut self, cap_height: f32) -> &mut Self
pub fn cap_height(&mut self, cap_height: f32) -> &mut Self
Write the /CapHeight
attribute. Required for fonts with Latin
characters, except for Type 3 fonts.
sourcepub fn stem_v(&mut self, stem_v: f32) -> &mut Self
pub fn stem_v(&mut self, stem_v: f32) -> &mut Self
Write the /StemV
attribute. Required, except for Type 3 fonts.
sourcepub fn missing_width(&mut self, missing_width: f32) -> &mut Self
pub fn missing_width(&mut self, missing_width: f32) -> &mut Self
Write the /MissingWidth
attribute.
sourcepub fn font_file(&mut self, id: Ref) -> &mut Self
pub fn font_file(&mut self, id: Ref) -> &mut Self
Write the /FontFile
attribute, referecing Type 1 font data.
sourcepub fn font_file2(&mut self, id: Ref) -> &mut Self
pub fn font_file2(&mut self, id: Ref) -> &mut Self
Write the /FontFile2
attribute, referencing TrueType font data. PDF
1.1+.
sourcepub fn font_file3(&mut self, id: Ref) -> &mut Self
pub fn font_file3(&mut self, id: Ref) -> &mut Self
Write the /FontFile3
attribute, referencing CFF font data. PDF 1.2+ or
PDF 1.3+ for CID-keyed fonts.
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.