pangomm 2.56.2
|
A Pango::Font is used to represent a font in a rendering-system-independent matter. More...
#include <pangomm/font.h>
Public Member Functions | |
Font (Font &&src) noexcept | |
Font & | operator= (Font &&src) noexcept |
~Font () noexcept override | |
PangoFont * | gobj () |
Provides access to the underlying C GObject. | |
const PangoFont * | gobj () const |
Provides access to the underlying C GObject. | |
PangoFont * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
FontDescription | describe () const |
Returns a description of the font, with font size set in points. | |
FontDescription | describe_with_absolute_size () const |
Returns a description of the font, with absolute font size set in device units. | |
Glib::RefPtr< Coverage > | get_coverage (const Language &language) const |
Computes the coverage map for a given font and language tag. | |
FontMetrics | get_metrics () const |
Gets overall metric information for a font. | |
FontMetrics | get_metrics (const Language &language) const |
Gets overall metric information for a font. | |
void | get_glyph_extents (Glyph glyph, Rectangle &ink_rect, Rectangle &logical_rect) const |
Gets the logical and ink extents of a glyph within a font. | |
Glib::RefPtr< FontMap > | get_font_map () |
Gets the font map for which the font was created. | |
Glib::RefPtr< const FontMap > | get_font_map () const |
Gets the font map for which the font was created. | |
Glib::RefPtr< FontFace > | get_face () |
Gets the Pango::FontFace to which font belongs. | |
Glib::RefPtr< const FontFace > | get_face () const |
Gets the Pango::FontFace to which font belongs. | |
bool | has_char (gunichar wc) const |
Returns whether the font provides a glyph for this character. | |
Rectangle | get_glyph_ink_extents (Glyph glyph) const |
Get the ink extents of a glyph within the font. | |
Rectangle | get_glyph_logical_extents (Glyph glyph) const |
Gets the logical extents of a glyph within the font. | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Pango::Font > | wrap (PangoFont *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
A Pango::Font is used to represent a font in a rendering-system-independent matter.
|
noexcept |
|
overridenoexcept |
FontDescription Pango::Font::describe | ( | ) | const |
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.
Pango::FontDescription
object. FontDescription Pango::Font::describe_with_absolute_size | ( | ) | const |
Returns a description of the font, with absolute font size set in device units.
Use describe() if you want the font size in points.
Pango::FontDescription
object. Computes the coverage map for a given font and language tag.
language | The language tag. |
Pango::Coverage
object. Glib::RefPtr< FontFace > Pango::Font::get_face | ( | ) |
Glib::RefPtr< FontMap > Pango::Font::get_font_map | ( | ) |
Gets the font map for which the font was created.
Note that the font maintains a weak 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 nullptr
.
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.
Pango::FontMap
for the font. Gets the font map for which the font was created.
Note that the font maintains a weak 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 nullptr
.
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.
Pango::FontMap
for the font. void Pango::Font::get_glyph_extents | ( | Glyph | glyph, |
Rectangle & | ink_rect, | ||
Rectangle & | logical_rect | ||
) | const |
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.
Get the ink extents of a glyph within the font.
glyph | The glyph index. |
Gets the logical extents of a glyph within the font.
glyph | The glyph index. |
FontMetrics Pango::Font::get_metrics | ( | ) | const |
Gets overall metric information for a font.
The metrics may be substantially different for different scripts. However, this function overload returns the metrics for the entire font.
FontMetrics Pango::Font::get_metrics | ( | const Language & | language | ) | const |
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.
language | Language tag used to determine which script to get the metrics for. |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
PangoFont * Pango::Font::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Returns whether the font provides a glyph for this character.
wc | A Unicode character. |
true
if font can render wc.
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |