Class: Pango::Font
- Inherits:
-
Object
- Object
- Pango::Font
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#describe ⇒ Pango::FontDescription
Returns a description of the font, with font size set in points.
-
#describe_with_absolute_size ⇒ Pango::FontDescription
Returns a description of the font, with absolute font size set (in device units).
-
#find_shaper(language, ch) ⇒ Pango::EngineShape
Finds the best matching shaper for a font for a particular language tag and character point.
-
#font_map ⇒ Pango::FontMap
Gets the font map for which the font was created.
-
#get_coverage(language) ⇒ Pango::Coverage
Computes the coverage map for a given font and language tag.
-
#get_features(features, len, num_features) ⇒ nil
Obtain the OpenType features that are provided by the font.
-
#get_glyph_extents(glyph, ink_rect, logical_rect) ⇒ nil
Gets the logical and ink extents of a glyph within a font.
-
#get_metrics(language) ⇒ Pango::FontMetrics
Gets overall metric information for a font.
-
#has_char(wc) ⇒ TrueClass
Returns whether the font provides a glyph for this character.
-
#hb_font ⇒ Pango::
Get a hb_font_t object backing this font.
Instance Method Details
#describe ⇒ Pango::FontDescription
Returns a description of the font, with font size set in points. Use pango_font_describe_with_absolute_size() if you want the font size in device units.
#describe_with_absolute_size ⇒ Pango::FontDescription
Returns a description of the font, with absolute font size set (in device units). Use pango_font_describe() if you want the font size in points.
#find_shaper(language, ch) ⇒ Pango::EngineShape
Finds the best matching shaper for a font for a particular language tag and character point.
#font_map ⇒ Pango::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 nil. 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 Pango::Context holds a reference to the font map.
#get_coverage(language) ⇒ Pango::Coverage
Computes the coverage map for a given font and language tag.
#get_features(features, len, num_features) ⇒ nil
Obtain the OpenType features that are provided by the font. These are passed to the rendering system, together with features that have been explicitly set via attributes.
Note that this does not include OpenType features which the rendering system enables by default.
#get_glyph_extents(glyph, ink_rect, logical_rect) ⇒ nil
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 font is nil, this function gracefully sets some sane values in the output variables and returns.
#get_metrics(language) ⇒ Pango::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 font is nil, this function gracefully sets some sane values in the output variables and returns.
#has_char(wc) ⇒ TrueClass
Returns whether the font provides a glyph for this character.
Returns true if font can render wc
#hb_font ⇒ Pango::
Get a hb_font_t object backing this font.
Note that the objects returned by this function are cached and immutable. If you need to make changes to the hb_font_t, use hb_font_create_sub_font().