Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions | Static Public Member Functions
Xfc::Pango::Context Class Reference

A PangoLogAttr C++ wrapper class. More...

#include <xfc/pango/context.hh>

Inheritance diagram for Xfc::Pango::Context:
Xfc::G::Object Xfc::G::TypeInstance Xfc::Trackable

List of all members.

Public Member Functions

Static Public Member Functions

Constructors


Detailed Description

A PangoLogAttr C++ wrapper class.

The Context object stores global information used to control the itemization process.


Constructor & Destructor Documentation

Xfc::Pango::Context::Context ( PangoContext *  context,
bool  owns_reference = true 
) [explicit, protected]

Construct a new Context from an existing PangoContext.

Parameters:
contextA pointer to a PangoContext.
owns_referenceSet false if the initial reference count is floating, set true if it's not.

The context can be a newly created PangoContext or an existing PangoContext. (see G::Object::Object).


Member Function Documentation

static Pointer<Pango::Context> Xfc::Pango::Context::get ( const Gdk::Screen screen = 0) [static]

Creates a PangoContext for the specified screen.

Parameters:
screenThe Screen to get the context for, or null for the default screen.
Returns:
A new PangoContext for screen

When using a Gtk::Widget, normally you should use Gtk::Widget::get_pango_context() instead of this function, to get the appropriate context for the widget you intend to render text onto.

Retrieves the base direction for the context.

Returns:
The base direction for the context.

Retrieve the default font description for the context.

Returns:
A smart pointer to the context's default font description.

Gets the Fontmap used to look up fonts for this context.

Returns:
The font map for the Context.
PangoLanguage* Xfc::Pango::Context::get_language ( ) const

Retrieves the global language tag for the context.

Returns:
The global language tag.

Gets the transformation matrix that will be applied when rendering with the context (see set_matrix()).

Returns:
The matrix, or null if no matrix has been set (which is the same as the identity matrix).
Pointer<FontMetrics> Xfc::Pango::Context::get_metrics ( const FontDescription desc,
PangoLanguage *  language 
) const

Get the overall metric information for a particular font description.

Parameters:
descA FontDescription.
languageA language tag used to determine which script to get the metrics for, or null to indicate to get the metrics for the entire font.
Returns:
A smart pointer to a FontMetrics object.

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.

The FontDescription is interpreted in the same way as by itemize(), and the family name may be a comma separated list of figures. If characters from multiple of these families would be used to render the string, then the returned fonts would be a composite of the metrics for the fonts loaded for the individual families.

std::vector<Pointer<Item> > Xfc::Pango::Context::itemize ( const String text,
const AttrList attrs,
AttrIterator cached_iter = 0 
) const

Breaks a piece of text into segments with consistent directional level and shaping engine.

Parameters:
textThe text to itemize.
attrsThe set of attributes that apply to text.
cached_iterA cached attribute iterator, or null.
Returns:
A vector of Pointer<Item>.

Each byte of text will be contained in exactly one of the items in the returned vector. The generated vector 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).

std::vector<Pointer<Item> > Xfc::Pango::Context::itemize ( const char *  text,
int  start_index,
int  length,
const AttrList attrs,
AttrIterator cached_iter = 0 
) const

Breaks a piece of text into segments with consistent directional level and shaping engine.

Parameters:
textThe text to itemize, starting at start_index
start_indexThe first byte in text to process.
lengthThe number of bytes (not characters) to process after start_index. This must be >= 0.
attrsThe set of attributes that apply to text.
cached_iterA cached attribute iterator, or null.
Returns:
A vector of Pointer<Item>.

Each byte of text will be contained in exactly one of the items in the returned vector. The generated vector 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).

std::vector<Pointer<Item> > Xfc::Pango::Context::itemize ( Direction  direction,
const String text,
const AttrList attrs,
AttrIterator cached_iter = 0 
) const

Breaks a piece of text into segments using the specified base direction.

Parameters:
directionThe base direction to use for bidirectional processing.
textThe text to itemize.
attrsThe set of attributes that apply to text.
cached_iterA cached attribute iterator, or null.
Returns:
A vector of Pointer<Item>.

See itemize(const String&, const AttrList&, AttrIterator*).

std::vector<Pointer<Item> > Xfc::Pango::Context::itemize ( Direction  direction,
const char *  text,
int  start_index,
int  length,
const AttrList attrs,
AttrIterator cached_iter = 0 
) const

Breaks a piece of text into segments using the specified base direction.

Parameters:
directionThe base direction to use for bidirectional processing.
textThe text to itemize, starting at start_index
start_indexThe first byte in text to process.
lengthThe number of bytes (not characters) to process after start_index. This must be >= 0.
attrsThe set of attributes that apply to text.
cached_iterA cached attribute iterator, or null.
Returns:
A vector of Pointer<Item>.

See itemize(const char*, int, int, const AttrList&, AttrIterator*).

bool Xfc::Pango::Context::list_families ( std::vector< FontFamily * > &  families) const

List all the families for the context's fontmap.

Parameters:
familiesA reference to a vector of FontFamily* to hold the font families.
Returns:
true if the vector is not empty.

Loads the font in one of the fontmaps in the context that is the closest match for desc.

Parameters:
descA FontDescription describing the font to load.
Returns:
The font loaded, or null if no font matched.
Fontset* Xfc::Pango::Context::load_fontset ( const FontDescription desc,
PangoLanguage *  language 
) const

Load a set of fonts in the context that can be used to render a font matching desc.

Parameters:
descA FontDescription describing the fonts to load.
languageA PangoLanguage the fonts will be used for.
Returns:
The fontset, or null if no font matched.

Sets the base direction for the context.

Parameters:
directionThe new base direction.

Sets the colormap to be used for drawing with the context.

Parameters:
colormapA Gdk::colormap.

If you obtained your context from Gtk::Widget::get_pango_context() or Gtk::Widget::create_pango_context(), the colormap will already be set to the colormap for the widget, so you shouldn't need this method.

Set the default font description for the context.

Parameters:
descThe new pango font description.
void Xfc::Pango::Context::set_language ( PangoLanguage *  language)

Sets the global language tag for the context.

Parameters:
languageThe new language tag.
void Xfc::Pango::Context::set_matrix ( const Matrix matrix)

Sets the transformation matrix that will be applied when rendering with the context.

Parameters:
matrixA Pango::Matrix, or null to unset any existing matrix.

No matrix set is the same as setting the identity matrix. The reported metrics are in the user space coordinates before the application of the matrix, not device-space coordiantes after the application of the matrix. So, they don't scale with the matrix, though they may change slightly for different matrices, depending on how the text is fit to the pixel grid.


The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC