|
Graphics.UI.Gtk.Pango.Context | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
Description |
This module defines PangoContexts,
an environment that provides information on available fonts,
internationalization and output capabilities of the medium. Given
such a context, text can be rendered into strings of glyphs (see
Rendering) or, at a more abstract level, using
layouts (see Layout).
- A PangoContext is a prerequisite for all text rendering functions.
A context can be created from scratch or, more conveniently, by using
default settings that are already used in the application. When text
is rendered through Gdk, use
widgetCreatePangoContext, if you use
the Cairo rendering engine, a new context can be acquired using
cairoCreateContext.
- The properties of a PangoContext can be changed which, in turn, has
an effect on how text is rendered. To reflect such a change in the
rendered text, call layoutContextChanged.
|
|
Synopsis |
|
|
|
|
Types and Methods for PangoContexts
|
|
data PangoContext |
Instances | |
|
|
data PangoDirection |
The PangoDirection type represents a direction in the Unicode
bidirectional algorithm.
- The "weak" values denote a left-to-right or right-to-left direction
only if there is no character with a strong direction in a paragraph.
An example is a sequence of special, graphical characters which are
neutral with respect to their rendering direction. A fresh
PangoContext is by default weakly
left-to-right.
- Not every value in this enumeration makes sense for every usage
of PangoDirection; for example, the return value of
unicharDirection and findBaseDir cannot be PangoDirectionWeakLtr
or PangoDirectionWeakRtl, since every character is either neutral or
has a strong direction; on the other hand PangoDirectionNeutral
doesn't make sense to pass to log2visGetEmbeddingLevels.
| Constructors | PangoDirectionLtr | | PangoDirectionRtl | | PangoDirectionWeakLtr | | PangoDirectionWeakRtl | | PangoDirectionNeutral | |
| Instances | |
|
|
contextListFamilies :: PangoContext -> IO [FontFamily] |
Retrieve a list of all available font families.
- A font family is the name of the font without further attributes
like slant, variant or size.
|
|
contextGetMetrics :: PangoContext -> FontDescription -> Language -> IO FontMetrics |
Query the metrics of the given font implied by the font description.
|
|
contextSetFontDescription :: PangoContext -> FontDescription -> IO () |
Set the default FontDescription of this context.
|
|
contextGetFontDescription :: PangoContext -> IO FontDescription |
Get the current FontDescription of this context.
|
|
data Language |
An RFC-3066 language designator to choose scripts.
| Instances | |
|
|
languageFromString :: String -> IO Language |
Take a RFC-3066 format language tag as a string and convert it to a
Language type that can be efficiently passed around and compared with
other language tags.
- This function first canonicalizes the string by converting it to
lowercase, mapping '_' to '-', and stripping all characters
other than letters and '-'.
|
|
contextSetLanguage :: PangoContext -> Language -> IO () |
Set the default Language of this context.
|
|
contextGetLanguage :: PangoContext -> IO Language |
Get the current Language of this context.
|
|
contextSetTextDir :: PangoContext -> PangoDirection -> IO () |
Set the default text direction of this context.
|
|
contextGetTextDir :: PangoContext -> IO PangoDirection |
Get the current text direction of this context.
|
|
Produced by Haddock version 0.7 |