![]() |
![]() |
Inheritance diagram for Pango::Context:
Public Member Functions | |
virtual | ~Context () |
PangoContext* | gobj () |
Provides access to the underlying C GObject. | |
const PangoContext* | gobj () const |
Provides access to the underlying C GObject. | |
PangoContext* | gobj_copy () |
Glib::ArrayHandle< Glib::RefPtr< FontFamily > > | list_families () const |
List all available font families for a context. | |
Glib::RefPtr<Font> | load_font (const FontDescription& desc) const |
Glib::RefPtr<Fontset> | load_fontset (const FontDescription& desc, const Language& language) const |
FontMetrics | get_metrics (const FontDescription& desc) const |
Get overall metric information for a particular font description. | |
FontMetrics | get_metrics (const FontDescription& desc, const Language& language) const |
void | set_font_description (const FontDescription& desc) |
FontDescription | get_font_description () const |
Language | get_language () const |
void | set_language (const Language& language) |
void | set_base_dir (Direction direction) |
Direction | get_base_dir () const |
ListHandle_Item | itemize (const Glib::ustring& text, const AttrList& attrs) const |
Breaks a piece of text into segments with consistent directional level and shaping engine. | |
ListHandle_Item | itemize (const Glib::ustring& text, int start_index, int length, const AttrList& attrs, AttrIter& cached_iter) const |
Breaks a piece of text into segments with consistent directional level and shaping engine. | |
Protected Member Functions | |
Context () | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Pango::Context> | wrap (PangoContext* object, bool take_copy=false) |
You can retrieve a Pango::Context object with Gtk::Widget::create_pango_context() or Gtk::Widget::get_pango_context(). If you don't use gtkmm call some c function of the pango backend you intend to use and create a wrapper for the returned context, e.g. Glib::wrap(pango_x_get_context()).
Creating a Pango::Context object is the starting point of every rendering process. You can either use it to create a high level Pango::Layout object which does all the hard work for you by passing it into Pango::Layout::create() or to generate glyph strings from character strings with the help of itemize() and Pango::Item::shape() subsequently.
Which fonts are used for rendering can be influenced by setting the default font description, language and base direction of the context.
If you want to calculate the space some text will need to be displayed you might find the functions of Pango::FontMetrics useful. Use get_metrics() to obtain the Pango::FontMetrics object for a specific Pango::FontDescription. For more detailed calculations in a rendering-system-independant manner and to determine whether specific characters can be represented by the font that would be used for a specific Pango::FontDescription load a Pango::Fontset with load_fontset() (load_font() returns the Pango::Font that is the closest match for a Pango::FontDescription; however that's not necessarily the font that will be used for rendering).
|
|
|
|
|
|
|
|
|
|
|
|
|
Get overall metric information for a particular font description. The metrics may be substantially different for different scripts. However this function overload returns the metrics of the entire font.
|
|
Provides access to the underlying C GObject.
|
|
Provides access to the underlying C GObject.
|
|
|
|
Breaks a piece of text into segments with consistent directional level and shaping engine. Each byte of text will be contained in exactly one of the items in the returned list. The generated list of items will be in logical order (the start offsets of the items are ascending). cached_iter should be an iterator over attrs currently positioned at a range before or containing start_index. cached_iter will be advanced to the range covering the position just after start_index + length. (i.e. if itemizing in a loop, just keep passing in the same cached_iter).
|
|
Breaks a piece of text into segments with consistent directional level and shaping engine. Each byte of text will be contained in exactly one of the items in the returned list. The generated list of items will be in logical order (the start offsets of the items are ascending).
|
|
List all available font families for a context. You can specify one of these as your desired font family in the Pango::FontDesciption objects you use, e.g. in the default font description of the context.
|
|
|
|
|
|
|
|
|
|
|
|
|