A Pango::Font is used to represent a font in a rendering-system-independent matter.
More...
#include <pangomm/font.h>
|
static GType | get_type () |
| Get the GType for this class, for use with the underlying GObject type system. More...
|
|
|
(Note that these are not member functions.)
|
Glib::RefPtr< Pango::Font > | wrap (PangoFont * object, bool take_copy=false) |
| A Glib::wrap() method for this object. More...
|
|
A Pango::Font is used to represent a font in a rendering-system-independent matter.
◆ Font()
Pango::Font::Font |
( |
Font && |
src | ) |
|
|
noexcept |
◆ ~Font()
◆ describe()
◆ describe_with_absolute_size()
◆ get_coverage()
Glib::RefPtr< Coverage > Pango::Font::get_coverage |
( |
const Language & |
language | ) |
const |
Computes the coverage map for a given font and language tag.
- Parameters
-
language | The language tag. |
- Returns
- A newly-allocated
Pango::Coverage
object.
◆ get_face() [1/2]
Glib::RefPtr< FontFace > Pango::Font::get_face |
( |
| ) |
|
◆ get_face() [2/2]
Glib::RefPtr< const FontFace > Pango::Font::get_face |
( |
| ) |
const |
◆ get_font_map() [1/2]
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.
- Since pangomm 1.10:
- Returns
- The
Pango::FontMap
for the font.
◆ get_font_map() [2/2]
Glib::RefPtr< const FontMap > Pango::Font::get_font_map |
( |
| ) |
const |
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.
- Since pangomm 1.10:
- Returns
- The
Pango::FontMap
for the font.
◆ get_glyph_extents()
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.
- Parameters
-
glyph | The glyph index. |
ink_rect | Rectangle used to store the extents of the glyph as drawn. |
logical_rect | Rectangle used to store the logical extents of the glyph. |
◆ get_glyph_ink_extents()
Get the ink extents of a glyph within the font.
- Parameters
-
- Returns
- The extents of the glyph as drawn.
◆ get_glyph_logical_extents()
Gets the logical extents of a glyph within the font.
- Parameters
-
- Returns
- The logical extents of the glyph.
◆ get_metrics() [1/2]
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.
◆ get_metrics() [2/2]
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.
- Parameters
-
language | Language tag used to determine which script to get the metrics for. |
- Returns
- A Pango::Metrics object.
◆ get_type()
static GType Pango::Font::get_type |
( |
| ) |
|
|
static |
Get the GType for this class, for use with the underlying GObject type system.
◆ gobj() [1/2]
PangoFont * Pango::Font::gobj |
( |
| ) |
|
|
inline |
Provides access to the underlying C GObject.
◆ gobj() [2/2]
const PangoFont * Pango::Font::gobj |
( |
| ) |
const |
|
inline |
Provides access to the underlying C GObject.
◆ gobj_copy()
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.
◆ has_char()
bool Pango::Font::has_char |
( |
gunichar |
wc | ) |
const |
Returns whether the font provides a glyph for this character.
- Since pangomm 1.44:
- Parameters
-
- Returns
true
if font can render wc.
◆ operator=()
Font & Pango::Font::operator= |
( |
Font && |
src | ) |
|
|
noexcept |
◆ wrap()
Glib::RefPtr< Pango::Font > wrap |
( |
PangoFont * |
object, |
|
|
bool |
take_copy = false |
|
) |
| |
|
related |
A Glib::wrap() method for this object.
- Parameters
-
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. |
- Returns
- A C++ instance that wraps this C instance.