GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Pango::Context Class Reference

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

#include <gfc/pango/context.hh>

Inheritance diagram for GFC::Pango::Context:

GFC::G::Object GFC::G::TypeInstance GFC::Trackable List of all members.

Public Member Functions

Constructors
Accessors
Methods
GDK Pango Methods

Static Public Member Functions

Protected 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

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

Construct a new Context from an existing PangoContext.

Parameters:
context A pointer to a PangoContext.
owns_reference Set 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

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

Creates a PangoContext for the specified screen.

Parameters:
screen The 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.

Direction GFC::Pango::Context::get_base_dir (   )  const
 

Retrieves the base direction for the context.

Returns:
The base direction for the context.

Pointer<FontDescription> GFC::Pango::Context::get_font_description (   )  const
 

Retrieve the default font description for the context.

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

PangoLanguage* GFC::Pango::Context::get_language (   )  const
 

Retrieves the global language tag for the context.

Returns:
The global language tag.

Pointer<FontMetrics> GFC::Pango::Context::get_metrics (  const FontDescription &  desc,
PangoLanguage *  language
)  const
 

Get the overall metric information for a particular font description.

Parameters:
desc A FontDescription.
language A 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> > GFC::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:
direction The base direction to use for bidirectional processing.
text The text to itemize, starting at start_index
start_index The first byte in text to process.
length The number of bytes (not characters) to process after start_index. This must be >= 0.
attrs The set of attributes that apply to text.
cached_iter A cached attribute iterator, or null.
Returns:
A vector of Pointer<Item>.

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

std::vector<Pointer<Item> > GFC::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:
direction The base direction to use for bidirectional processing.
text The text to itemize.
attrs The set of attributes that apply to text.
cached_iter A cached attribute iterator, or null.
Returns:
A vector of Pointer<Item>.

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

std::vector<Pointer<Item> > GFC::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:
text The text to itemize, starting at start_index
start_index The first byte in text to process.
length The number of bytes (not characters) to process after start_index. This must be >= 0.
attrs The set of attributes that apply to text.
cached_iter A 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> > GFC::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:
text The text to itemize.
attrs The set of attributes that apply to text.
cached_iter A 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).

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

List all the families for the context's fontmap.

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

Font* GFC::Pango::Context::load_font (  const FontDescription &  desc  )  const
 

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

Parameters:
desc A FontDescription describing the font to load.
Returns:
The font loaded, or null if no font matched.

Fontset* GFC::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:
desc A FontDescription describing the fonts to load.
language A PangoLanguage the fonts will be used for.
Returns:
The fontset, or null if no font matched.

void GFC::Pango::Context::set_base_dir (  Direction  direction  ) 
 

Sets the base direction for the context.

Parameters:
direction The new base direction.

void GFC::Pango::Context::set_colormap (  const Gdk::Colormap &  colormap  ) 
 

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

Parameters:
colormap A 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.

void GFC::Pango::Context::set_font_description (  const FontDescription &  desc  ) 
 

Set the default font description for the context.

Parameters:
desc The new pango font description.

void GFC::Pango::Context::set_language (  PangoLanguage *  language  ) 
 

Sets the global language tag for the context.

Parameters:
language The new language tag.


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:45 2004 for GFC-UI by doxygen 1.3.8