pangomm: Pango::CairoFontMap Class Reference

pangomm 2.50.1

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Pango::CairoFontMap Class Reference

Pango::CairoFontMap is an interface implemented by font maps for use with Cairo. More...

`#include <pangomm/cairofontmap.h>`

Inheritance diagram for Pango::CairoFontMap:
[legend]

## Public Member Functions
| CairoFontMap (CairoFontMap && src) noexcept
CairoFontMap & | operator= (CairoFontMap && src) noexcept
| ~CairoFontMap () noexcept override
PangoCairoFontMap * | gobj ()
| Provides access to the underlying C GObject. More...
const PangoCairoFontMap * | gobj () const
| Provides access to the underlying C GObject. More...
void | set_default ()
| Sets a default `Pango::CairoFontMap` to use with Cairo. More...
Cairo::FontType | get_font_type () const
| Gets the type of Cairo font backend that fontmap uses. More...
void | set_resolution (double dpi)
| Sets the resolution for the fontmap. More...
double | get_resolution () const
| Gets the resolution for the fontmap. More...
Public Member Functions inherited from Glib::Interface
| Interface ()
| Interface (Interface &&src) noexcept
Interface & | operator= (Interface &&src) noexcept
| Interface (const Glib::Interface_Class &interface_class)
| Interface (GObject *castitem)
| ~Interface () noexcept override
| Interface (const Interface &)=delete
Interface & | operator= (const Interface &)=delete
GObject * | gobj ()
const GObject * | gobj () const
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase &)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
PropertyType | get_property (const Glib::ustring &property_name) const
sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot)
sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot)
void | freeze_notify ()
void | thaw_notify ()
virtual void | reference () const
virtual void | unreference () const
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Public Member Functions inherited from sigc::trackable
| trackable () noexcept
| trackable (const trackable &src) noexcept
| trackable (trackable &&src) noexcept
| ~trackable ()
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src) noexcept
void | remove_destroy_notify_callback (notifiable *data) const

## Static Public Member Functions
static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Glib::RefPtr< FontMap > | get_default ()
| Gets a default Pango::CairoFontMap to use with Cairo. More...

## Protected Member Functions
| CairoFontMap ()
| You should derive from this class to use it. More...
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
| ObjectBase (ObjectBase &&src) noexcept
ObjectBase & | operator= (ObjectBase &&src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject *castitem)
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Pango::CairoFontMap > | wrap (PangoCairoFontMap * object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify
Public Types inherited from sigc::notifiable
typedef internal::func_destroy_notify | func_destroy_notify

## Detailed Description

Pango::CairoFontMap is an interface implemented by font maps for use with Cairo.

The actual type of the font map will depend on the particular font technology Cairo was compiled to use.

## Constructor & Destructor Documentation

## ◆ CairoFontMap() [1/2]

Pango::CairoFontMap::CairoFontMap | ( |  | ) |
| protected

You should derive from this class to use it.

## ◆ CairoFontMap() [2/2]

Pango::CairoFontMap::CairoFontMap | ( | CairoFontMap && | src | ) |
| noexcept

## ◆ ~CairoFontMap()

Pango::CairoFontMap::~CairoFontMap | ( |  | ) |
| overridenoexcept

## Member Function Documentation

## ◆ add_interface()

static void Pango::CairoFontMap::add_interface | ( | GType | gtype_implementer | ) |
| static

## ◆ get_default()

static Glib::RefPtr<FontMap> Pango::CairoFontMap::get_default | ( |  | ) |
| static

Gets a default Pango::CairoFontMap to use with Cairo.

Note that the type of the returned object will depend on the particular font backend Cairo was compiled to use. You generally should only use the Pango::FontMap and Pango::CairoFontMap API on the returned object.

The default Cairo fontmap can be changed by using set_default(). This can be used to change the Cairo font backend that the default fontmap uses for example.

Note that since Pango 1.32.6, the default fontmap is per-thread. Each thread gets its own default fontmap. In this way, PangoCairo can be used safely from multiple threads.

To use Pango::CairoFontMap API, do something like

auto font_map = Pango::CairoFontMap::get_default();
auto cairo_font_map = std::dynamic_pointer_cast<Pango::CairoFontMap>(font_map);
if (cairo_font_map)
cairo_font_map->do_something();
Pango::CairoFontMap::get_default
static Glib::RefPtr< FontMap > get_default()
Gets a default Pango::CairoFontMap to use with Cairo.

Since pangomm 1.10:

Returns
  The default PangoCairo fontmap for the current thread.

## ◆ get_font_type()

Cairo::FontType Pango::CairoFontMap::get_font_type | ( |  | ) | const

Gets the type of Cairo font backend that fontmap uses.

Since pangomm 1.18:

Returns
  The `cairo_font_type_t` cairo font backend type.

## ◆ get_resolution()

double Pango::CairoFontMap::get_resolution | ( |  | ) | const

Gets the resolution for the fontmap.

See set_resolution().

Since pangomm 1.10:

Returns
  The resolution in "dots per inch".

## ◆ get_type()

static GType Pango::CairoFontMap::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ gobj() [1/2]

PangoCairoFontMap* Pango::CairoFontMap::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const PangoCairoFontMap* Pango::CairoFontMap::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ operator=()

CairoFontMap& Pango::CairoFontMap::operator= | ( | CairoFontMap && | src | ) |
| noexcept

## ◆ set_default()

void Pango::CairoFontMap::set_default | ( |  | ) |

Sets a default `Pango::CairoFontMap` to use with Cairo.

This can be used to change the Cairo font backend that the default fontmap uses for example. The old default font map is unreffed and the new font map referenced.

Note that since Pango 1.32.6, the default fontmap is per-thread. This function only changes the default fontmap for the current thread. Default fontmaps of existing threads are not changed. Default fontmaps of any new threads will still be created using new().

A value of `nullptr` for fontmap will cause the current default font map to be released and a new default font map to be created on demand, using new().

Since pangomm 1.22:

## ◆ set_resolution()

void Pango::CairoFontMap::set_resolution | ( | double | dpi | ) |

Sets the resolution for the fontmap.

This is a scale factor between points specified in a `Pango::FontDescription` and Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).

Since pangomm 1.10:

Parameters

  dpi | The resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.).

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Pango::CairoFontMap > wrap | ( | PangoCairoFontMap * | 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.