pub struct Type1Font {Show 15 fields
name: Option<String>,
full_name: Option<String>,
family_name: Option<String>,
weight: Option<String>,
bbox: BoundingBox<Fixed>,
italic_angle: i32,
is_fixed_pitch: bool,
underline_position: i32,
underline_thickness: i32,
matrix: ScaledFontMatrix,
charstrings: Charstrings,
subrs: Subrs,
encoding: Option<RawEncoding>,
weight_vector: Vec<Fixed>,
unicode_charmap: Charmap,
}Expand description
A Type1 font.
Fields§
§name: Option<String>§full_name: Option<String>§family_name: Option<String>§weight: Option<String>§bbox: BoundingBox<Fixed>§italic_angle: i32§is_fixed_pitch: bool§underline_position: i32§underline_thickness: i32§matrix: ScaledFontMatrix§charstrings: Charstrings§subrs: Subrs§encoding: Option<RawEncoding>§weight_vector: Vec<Fixed>§unicode_charmap: CharmapImplementations§
Source§impl Type1Font
impl Type1Font
fn new_impl(data: &[u8]) -> Option<Self>
fn empty() -> Self
fn from_dicts(base: &[u8], private: &[u8]) -> Option<Self>
Sourcepub fn family_name(&self) -> Option<&str>
pub fn family_name(&self) -> Option<&str>
Returns the font family name.
Sourcepub fn italic_angle(&self) -> i32
pub fn italic_angle(&self) -> i32
Returns the italic angle.
Sourcepub fn is_fixed_pitch(&self) -> bool
pub fn is_fixed_pitch(&self) -> bool
Returns true if the glyphs in this font have the same width.
Sourcepub fn underline_position(&self) -> i32
pub fn underline_position(&self) -> i32
Returns the position of the top of an underline decoration.
Sourcepub fn underline_thickness(&self) -> i32
pub fn underline_thickness(&self) -> i32
Returns the suggested size for an underline decoration.
Sourcepub fn bbox(&self) -> BoundingBox<Fixed>
pub fn bbox(&self) -> BoundingBox<Fixed>
Returns the font bounding box.
Sourcepub fn num_glyphs(&self) -> u32
pub fn num_glyphs(&self) -> u32
Returns the number of glyphs in the Type1 font.
Sourcepub fn matrix(&self) -> FontMatrix
pub fn matrix(&self) -> FontMatrix
Returns the top level font matrix.
Sourcepub fn transform(&self, ppem: Option<f32>) -> Transform
pub fn transform(&self, ppem: Option<f32>) -> Transform
Returns the appropriate transform for adjusting points and metrics.
Sourcepub fn unicode_charmap(&self) -> &Charmap
pub fn unicode_charmap(&self) -> &Charmap
Returns the Unicode charmap for this font.
Note that this is an empty mapping if the agl feature is not enabled.
Sourcepub fn glyph_name(&self, gid: GlyphId) -> Option<&str>
pub fn glyph_name(&self, gid: GlyphId) -> Option<&str>
Returns the glyph name for the given id.
Sourcepub fn glyph_names(&self) -> impl Iterator<Item = (GlyphId, &str)>
pub fn glyph_names(&self) -> impl Iterator<Item = (GlyphId, &str)>
Returns an iterator over the pairs of glyph ids and associated names in the Type1 font.
Sourcepub fn remapped_gid(&self, original_gid: GlyphId) -> GlyphId
pub fn remapped_gid(&self, original_gid: GlyphId) -> GlyphId
Given a glyph identifier in the original glyph order, returns the possibly remapped identifier.
This occurs if we remap or synthesize a .notdef glyph.
Sourcepub fn evaluate_charstring(
&self,
gid: GlyphId,
sink: &mut impl CommandSink,
) -> Result<Option<Fixed>, Error>
pub fn evaluate_charstring( &self, gid: GlyphId, sink: &mut impl CommandSink, ) -> Result<Option<Fixed>, Error>
Evaluates the charstring for the requested glyph and sends the results to the given sink.
Returns the advance with of the glyph in font units if the charstring provides one.
Trait Implementations§
Source§impl CharstringContext for Type1Font
impl CharstringContext for Type1Font
Source§fn kind(&self) -> CharstringKind
fn kind(&self) -> CharstringKind
Source§fn seac_components(
&self,
base_code: i32,
accent_code: i32,
) -> Result<[&[u8]; 2], Error>
fn seac_components( &self, base_code: i32, accent_code: i32, ) -> Result<[&[u8]; 2], Error>
seac (standard
encoded accented character) operator.