pango-0.13.10.0: Binding to the Pango text rendering engine.

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | Safe-Inferred
Language | Haskell98

Graphics.Rendering.Pango.Context

Contents

- Types and Methods for `PangoContext`s

Description

This module defines `PangoContext`s, 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

- data PangoContext
- class GObjectClass o => PangoContextClass o
- contextListFamilies :: PangoContext -> IO [FontFamily]
- contextGetMetrics :: PangoContext -> FontDescription -> Language -> IO FontMetrics
- contextSetFontDescription :: PangoContext -> FontDescription -> IO ()
- contextGetFontDescription :: PangoContext -> IO FontDescription
- data Language
- emptyLanguage :: Language
- languageFromString :: GlibString string => string -> IO Language
- contextSetLanguage :: PangoContext -> Language -> IO ()
- contextGetLanguage :: PangoContext -> IO Language
- contextSetTextDir :: PangoContext -> PangoDirection -> IO ()
- contextGetTextDir :: PangoContext -> IO PangoDirection
- contextSetTextGravity :: PangoContext -> PangoGravity -> IO ()
- contextGetTextGravity :: PangoContext -> IO PangoGravity
- contextSetTextGravityHint :: PangoContext -> PangoGravityHint -> IO ()
- contextGetTextGravityHint :: PangoContext -> IO PangoGravityHint
- contextGetMatrix :: PangoContext -> IO Matrix
- contextSetMatrix :: PangoContext -> Matrix -> IO ()

# Types and Methods for `PangoContext`s

data PangoContext Source #

#### Instances

Instances details

Eq PangoContext Source # |
Instance details Defined in Graphics.Rendering.Pango.Types Methods (==) :: PangoContext -> PangoContext -> Bool Source # (/=) :: PangoContext -> PangoContext -> Bool Source #
Ord PangoContext Source # |

Instance details

Defined in Graphics.Rendering.Pango.Types

Methods

compare :: PangoContext -> PangoContext -> Ordering Source #

(<) :: PangoContext -> PangoContext -> Bool Source #

(<=) :: PangoContext -> PangoContext -> Bool Source #

(>) :: PangoContext -> PangoContext -> Bool Source #

(>=) :: PangoContext -> PangoContext -> Bool Source #

max :: PangoContext -> PangoContext -> PangoContext Source #

min :: PangoContext -> PangoContext -> PangoContext Source #

GObjectClass PangoContext Source # |
Instance details Defined in Graphics.Rendering.Pango.Types Methods toGObject :: PangoContext -> GObject Source # unsafeCastGObject :: GObject -> PangoContext Source #
PangoContextClass PangoContext Source # |
Instance details Defined in Graphics.Rendering.Pango.Types

class GObjectClass o => PangoContextClass o Source #

#### Instances

Instances details

PangoContextClass PangoContext Source # |
Instance details Defined in Graphics.Rendering.Pango.Types

contextListFamilies :: PangoContext -> IO [FontFamily] Source #

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 Source #

Query the metrics of the given font implied by the font description.

contextSetFontDescription :: PangoContext -> FontDescription -> IO () Source #

Set the default `FontDescription` of this context.

contextGetFontDescription :: PangoContext -> IO FontDescription Source #

Get the current `FontDescription` of this context.

data Language Source #

An RFC-3066 language designator to choose scripts.

#### Instances

Instances details

Show Language Source # |
Instance details Defined in Graphics.Rendering.Pango.BasicTypes Methods showsPrec :: Int -> Language -> ShowS Source # show :: Language -> String Source # showList :: [Language] -> ShowS Source #
Eq Language Source # |
Instance details Defined in Graphics.Rendering.Pango.BasicTypes Methods (==) :: Language -> Language -> Bool Source # (/=) :: Language -> Language -> Bool Source #

emptyLanguage :: Language Source #

Specifying no particular language.

languageFromString :: GlibString string => string -> IO Language Source #

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 () Source #

Set the default `Language` of this context.

contextGetLanguage :: PangoContext -> IO Language Source #

Get the current `Language` of this context.

contextSetTextDir :: PangoContext -> PangoDirection -> IO () Source #

Set the default text direction of this context.

contextGetTextDir :: PangoContext -> IO PangoDirection Source #

Get the current text direction of this context.

contextSetTextGravity :: PangoContext -> PangoGravity -> IO () Source #

Set the text gravity of this context. If the given value is `PangoGravityAuto` then the gravity is derived from the current rotation matrix.

contextGetTextGravity :: PangoContext -> IO PangoGravity Source #

Get the current text gravity of this context.

contextSetTextGravityHint :: PangoContext -> PangoGravityHint -> IO () Source #

Set the text gravity hint of this context.

contextGetTextGravityHint :: PangoContext -> IO PangoGravityHint Source #

Get the current text gravity of this context.

contextGetMatrix :: PangoContext -> IO Matrix Source #

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

- Since Pango 1.6

contextSetMatrix :: PangoContext -> Matrix -> IO () Source #

Sets the transformation matrix that will be applied when rendering with this context. Note that any metrics reported by other functions are in user space coordinates before the application of the matrix, not device-space coordinates 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.

- Since Pango 1.6