[][src]Trait pango::FontExt

pub trait FontExt: 'static {
    fn describe(&self) -> Option<FontDescription>;
fn describe_with_absolute_size(&self) -> Option<FontDescription>;
fn find_shaper(&self, language: &Language, ch: u32) -> Option<EngineShape>;
fn get_coverage(&self, language: &Language) -> Option<Coverage>;
fn get_font_map(&self) -> Option<FontMap>;
fn get_glyph_extents(&self, glyph: Glyph) -> (Rectangle, Rectangle);
fn get_metrics(&self, language: Option<&Language>) -> Option<FontMetrics>;
fn has_char(&self, wc: char) -> bool; }

Trait containing all Font methods.

Implementors

Font

Required methods

fn describe(&self) -> Option<FontDescription>

Returns a description of the font, with font size set in points. Use FontExt::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>

Returns a description of the font, with absolute font size set (in device units). Use FontExt::describe if you want the font size in points.

Returns

a newly-allocated FontDescription object.

fn find_shaper(&self, language: &Language, ch: u32) -> Option<EngineShape>

Finds the best matching shaper for a font for a particular language tag and character point.

Deprecated

Shape engines are no longer used

language

the language tag

ch

a Unicode character.

Returns

the best matching shaper.

fn get_coverage(&self, language: &Language) -> Option<Coverage>

Computes the coverage map for a given font and language tag.

language

the language tag

Returns

a newly-allocated Coverage object.

fn get_font_map(&self) -> Option<FontMap>

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

the FontMap for the font, or None if self is None.

fn get_glyph_extents(&self, glyph: Glyph) -> (Rectangle, Rectangle)

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

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.

fn get_metrics(&self, language: Option<&Language>) -> Option<FontMetrics>

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 FontMetrics::unref when finished using the object.

fn has_char(&self, wc: char) -> bool

Returns whether the font provides a glyph for this character.

Returns true if self can render wc

Feature: v1_44

wc

a Unicode character

Loading content...

Implementors

impl<O: IsA<Font>> FontExt for O[src]

Loading content...