pub struct FontDescriptor {Show 18 fields
pub font_name: Vec<u8>,
pub font_family: Option<Vec<u8>>,
pub flags: u32,
pub font_b_box: Option<[f64; 4]>,
pub italic_angle: f64,
pub ascent: f64,
pub descent: f64,
pub cap_height: Option<f64>,
pub x_height: Option<f64>,
pub stem_v: f64,
pub stem_h: Option<f64>,
pub avg_width: Option<f64>,
pub max_width: Option<f64>,
pub missing_width: Option<f64>,
pub leading: Option<f64>,
pub font_file_ref: Option<IndirectRef>,
pub font_file2_ref: Option<IndirectRef>,
pub font_file3_ref: Option<IndirectRef>,
}Expand description
Font descriptor containing font metrics and flags (PDF spec section 7.6).
Fields§
§font_name: Vec<u8>/FontName — the PostScript name of the font.
font_family: Option<Vec<u8>>/FontFamily — the font family name.
flags: u32/Flags — a collection of boolean attributes (see flag constants).
font_b_box: Option<[f64; 4]>/FontBBox — bounding box for all glyphs [llx lly urx ury].
italic_angle: f64/ItalicAngle — angle in degrees counter-clockwise from vertical.
ascent: f64/Ascent — maximum height above the baseline.
descent: f64/Descent — maximum depth below the baseline (typically negative).
cap_height: Option<f64>/CapHeight — top of flat capital letters.
x_height: Option<f64>/XHeight — top of flat non-ascending lowercase letters.
stem_v: f64/StemV — dominant vertical stem width.
stem_h: Option<f64>/StemH — dominant horizontal stem width.
avg_width: Option<f64>/AvgWidth — average glyph width.
max_width: Option<f64>/MaxWidth — maximum glyph width.
missing_width: Option<f64>/MissingWidth — width to use for undefined character codes.
leading: Option<f64>/Leading — desired spacing between lines of text.
font_file_ref: Option<IndirectRef>/FontFile — reference to embedded Type1 font program.
font_file2_ref: Option<IndirectRef>/FontFile2 — reference to embedded TrueType font program.
font_file3_ref: Option<IndirectRef>/FontFile3 — reference to embedded CFF / OpenType font program.
Implementations§
Source§impl FontDescriptor
impl FontDescriptor
Sourcepub const FIXED_PITCH: u32 = 1
pub const FIXED_PITCH: u32 = 1
All glyphs have the same width.
Sourcepub const NONSYMBOLIC: u32
pub const NONSYMBOLIC: u32
Font uses a standard (non-symbol) character set.
Sourcepub const FORCE_BOLD: u32
pub const FORCE_BOLD: u32
Bold glyphs shall be painted with extra thickness at small sizes.
Sourcepub fn is_fixed_pitch(&self) -> bool
pub fn is_fixed_pitch(&self) -> bool
Returns true if the font is fixed-pitch.
Sourcepub fn is_symbolic(&self) -> bool
pub fn is_symbolic(&self) -> bool
Returns true if the font is symbolic.
Trait Implementations§
Source§impl Clone for FontDescriptor
impl Clone for FontDescriptor
Source§fn clone(&self) -> FontDescriptor
fn clone(&self) -> FontDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FontDescriptor
impl RefUnwindSafe for FontDescriptor
impl Send for FontDescriptor
impl Sync for FontDescriptor
impl Unpin for FontDescriptor
impl UnsafeUnpin for FontDescriptor
impl UnwindSafe for FontDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more