Trait pango::prelude::FontExt [−][src]
pub trait FontExt: 'static { fn describe(&self) -> Option<FontDescription>; fn describe_with_absolute_size(&self) -> Option<FontDescription>; fn coverage(&self, language: &Language) -> Option<Coverage>; fn face(&self) -> Option<FontFace>; fn font_map(&self) -> Option<FontMap>; fn glyph_extents(&self, glyph: Glyph) -> (Rectangle, Rectangle); fn metrics(&self, language: Option<&Language>) -> Option<FontMetrics>; fn has_char(&self, wc: char) -> bool; }
Expand description
Required methods
fn describe(&self) -> Option<FontDescription>
fn describe(&self) -> Option<FontDescription>
Returns a description of the font, with font size set in points.
Use describe_with_absolute_size()
if you want the font
size in device units.
Returns
a newly-allocated FontDescription
object.
fn describe_with_absolute_size(&self) -> Option<FontDescription>
fn describe_with_absolute_size(&self) -> Option<FontDescription>
Returns a description of the font, with absolute font size set
(in device units). Use describe()
if you want the font
size in points.
Returns
a newly-allocated FontDescription
object.
v1_46
only.Gets the font map for which the font was created.
Note that the font maintains a <firstterm>
weak</firstterm>
reference
to the font map, so if all references to font map are dropped, the font
map will be finalized even if there are fonts created with the font
map that are still alive. In that case this function will return None
.
It is the responsibility of the user to ensure that the font map is kept
alive. In most uses this is not an issue as a Context
holds
a reference to the font map.
Returns
Gets the logical and ink extents of a glyph within a font. The coordinate system for each rectangle has its origin at the base line and horizontal origin of the character with increasing coordinates extending to the right and down. The macros PANGO_ASCENT(), PANGO_DESCENT(), PANGO_LBEARING(), and PANGO_RBEARING() can be used to convert from the extents rectangle to more traditional font metrics. The units of the rectangles are in 1/PANGO_SCALE of a device unit.
If self
is None
, this function gracefully sets some sane values in the
output variables and returns.
glyph
the glyph index
Returns
ink_rect
rectangle used to store the extents of the glyph
as drawn or None
to indicate that the result is not needed.
logical_rect
rectangle used to store the logical extents of
the glyph or None
to indicate that the result is not needed.
Gets overall metric information for a font. Since the metrics may be substantially different for different scripts, a language tag can be provided to indicate that the metrics should be retrieved that correspond to the script(s) used by that language.
If self
is None
, this function gracefully sets some sane values in the
output variables and returns.
language
language tag used to determine which script to get the metrics
for, or None
to indicate to get the metrics for the entire font.
Returns
a FontMetrics
object. The caller must call pango_font_metrics_unref()
when finished using the object.