org.gnu.pango
Class Context

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by org.gnu.pango.Context

public class Context
extends GObject

The PangoContext structure stores global information used to control the itemization process. It contains the following fields:


Constructor Summary
Context(org.gnu.glib.Handle handle)
          Create a new Context passing a handle that was created in the native layer.
 
Method Summary
 Direction getBaseDir()
          Retrieves the base direction for the context.
static Context getContextFromHandle(org.gnu.glib.Handle handle)
          Static factory method that should only be used interally by Java-Gnome.
 FontDescription getFontDescription()
          Retrieve the default font description for the context.
 Language getLanguage()
          Retrieves the global language tag for the context.
 FontMetrics getMetrics(FontDescription desc, Language language)
          Get overall metric information for a font particular font description.
 FontFamily[] listFamilies()
          List all families for a Context.
 FontDescription loadFont(FontDescription desc)
          Loads the font in one of the fontmaps in the context that is the closest match for desc.
 void setBaseDir(Direction dir)
          Sets the base direction for the context.
 void setFontDescription(FontDescription desc)
          Sets the font description
 void setLanguage(Language lang)
          Sets the language
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Context

public Context(org.gnu.glib.Handle handle)
Create a new Context passing a handle that was created in the native layer. This is an internal method that should only be used by Java-Gnome.

Parameters:
handle - The handle to a native resource.
Method Detail

getContextFromHandle

public static Context getContextFromHandle(org.gnu.glib.Handle handle)
Static factory method that should only be used interally by Java-Gnome.


getFontDescription

public FontDescription getFontDescription()
Retrieve the default font description for the context.

Returns:
default font description.

setFontDescription

public void setFontDescription(FontDescription desc)
Sets the font description


getLanguage

public Language getLanguage()
Retrieves the global language tag for the context.


setLanguage

public void setLanguage(Language lang)
Sets the language


getBaseDir

public Direction getBaseDir()
Retrieves the base direction for the context.


setBaseDir

public void setBaseDir(Direction dir)
Sets the base direction for the context.


loadFont

public FontDescription loadFont(FontDescription desc)
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.

getMetrics

public FontMetrics getMetrics(FontDescription desc,
                              Language language)
Get overall metric information for a font particular font description. 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 PangoFontDescription is interpreted in the same way as by pango_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.


listFamilies

public FontFamily[] listFamilies()
List all families for a Context.