| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte | 
|---|---|
| License | LGPL-2.1 | 
| Maintainer | Iñaki García Etxebarria | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
GI.Pango.Objects.Context
Contents
- Exported types
 - Methods
- Overloaded methods
 - changed
 - getBaseDir
 - getBaseGravity
 - getFontDescription
 - getFontMap
 - getGravity
 - getGravityHint
 - getLanguage
 - getMatrix
 - getMetrics
 - getRoundGlyphPositions
 - getSerial
 - listFamilies
 - loadFont
 - loadFontset
 - new
 - setBaseDir
 - setBaseGravity
 - setFontDescription
 - setFontMap
 - setGravityHint
 - setLanguage
 - setMatrix
 - setRoundGlyphPositions
 
 
Description
The Context structure stores global information
 used to control the itemization process.
Synopsis
- newtype Context = Context (ManagedPtr Context)
 - class (GObject o, IsDescendantOf Context o) => IsContext o
 - toContext :: (MonadIO m, IsContext o) => o -> m Context
 - contextChanged :: (HasCallStack, MonadIO m, IsContext a) => a -> m ()
 - contextGetBaseDir :: (HasCallStack, MonadIO m, IsContext a) => a -> m Direction
 - contextGetBaseGravity :: (HasCallStack, MonadIO m, IsContext a) => a -> m Gravity
 - contextGetFontDescription :: (HasCallStack, MonadIO m, IsContext a) => a -> m FontDescription
 - contextGetFontMap :: (HasCallStack, MonadIO m, IsContext a) => a -> m FontMap
 - contextGetGravity :: (HasCallStack, MonadIO m, IsContext a) => a -> m Gravity
 - contextGetGravityHint :: (HasCallStack, MonadIO m, IsContext a) => a -> m GravityHint
 - contextGetLanguage :: (HasCallStack, MonadIO m, IsContext a) => a -> m Language
 - contextGetMatrix :: (HasCallStack, MonadIO m, IsContext a) => a -> m (Maybe Matrix)
 - contextGetMetrics :: (HasCallStack, MonadIO m, IsContext a) => a -> Maybe FontDescription -> Maybe Language -> m FontMetrics
 - contextGetRoundGlyphPositions :: (HasCallStack, MonadIO m, IsContext a) => a -> m Bool
 - contextGetSerial :: (HasCallStack, MonadIO m, IsContext a) => a -> m Word32
 - contextListFamilies :: (HasCallStack, MonadIO m, IsContext a) => a -> m [FontFamily]
 - contextLoadFont :: (HasCallStack, MonadIO m, IsContext a) => a -> FontDescription -> m (Maybe Font)
 - contextLoadFontset :: (HasCallStack, MonadIO m, IsContext a) => a -> FontDescription -> Language -> m (Maybe Fontset)
 - contextNew :: (HasCallStack, MonadIO m) => m Context
 - contextSetBaseDir :: (HasCallStack, MonadIO m, IsContext a) => a -> Direction -> m ()
 - contextSetBaseGravity :: (HasCallStack, MonadIO m, IsContext a) => a -> Gravity -> m ()
 - contextSetFontDescription :: (HasCallStack, MonadIO m, IsContext a) => a -> FontDescription -> m ()
 - contextSetFontMap :: (HasCallStack, MonadIO m, IsContext a, IsFontMap b) => a -> b -> m ()
 - contextSetGravityHint :: (HasCallStack, MonadIO m, IsContext a) => a -> GravityHint -> m ()
 - contextSetLanguage :: (HasCallStack, MonadIO m, IsContext a) => a -> Language -> m ()
 - contextSetMatrix :: (HasCallStack, MonadIO m, IsContext a) => a -> Maybe Matrix -> m ()
 - contextSetRoundGlyphPositions :: (HasCallStack, MonadIO m, IsContext a) => a -> Bool -> m ()
 
Exported types
Memory-managed wrapper type.
Constructors
| Context (ManagedPtr Context) | 
Instances
| Eq Context Source # | |
| IsGValue Context Source # | Convert   | 
| ManagedPtrNewtype Context Source # | |
Defined in GI.Pango.Objects.Context Methods toManagedPtr :: Context -> ManagedPtr Context #  | |
| TypedObject Context Source # | |
Defined in GI.Pango.Objects.Context  | |
| GObject Context Source # | |
Defined in GI.Pango.Objects.Context  | |
| HasParentTypes Context Source # | |
Defined in GI.Pango.Objects.Context  | |
| type ParentTypes Context Source # | |
Defined in GI.Pango.Objects.Context  | |
class (GObject o, IsDescendantOf Context o) => IsContext o Source #
Instances
| (GObject o, IsDescendantOf Context o) => IsContext o Source # | |
Defined in GI.Pango.Objects.Context  | |
Methods
Overloaded methods
changed
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m () | 
Forces a change in the context, which will cause any Layout
 using this context to re-layout.
This function is only useful when implementing a new backend for Pango, something applications won't do. Backends should call this function if they have attached extra data to the context and such data is changed.
Since: 1.32.4
getBaseDir
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m Direction | Returns: the base direction for the context.  | 
Retrieves the base direction for the context. See
 contextSetBaseDir.
getBaseGravity
contextGetBaseGravity Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m Gravity | Returns: the base gravity for the context.  | 
Retrieves the base gravity for the context. See
 contextSetBaseGravity.
Since: 1.16
getFontDescription
contextGetFontDescription Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m FontDescription | Returns: a pointer to the context's default font description. This value must not be modified or freed.  | 
Retrieve the default font description for the context.
getFontMap
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m FontMap | Returns: the font map for the   | 
Gets the FontMap used to look up fonts for this context.
Since: 1.6
getGravity
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m Gravity | Returns: the resolved gravity for the context.  | 
Retrieves the gravity for the context. This is similar to
 contextGetBaseGravity, except for when the base gravity
 is GravityAuto for which gravityGetForMatrix is used
 to return the gravity from the current context matrix.
Since: 1.16
getGravityHint
contextGetGravityHint Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m GravityHint | Returns: the gravity hint for the context.  | 
Retrieves the gravity hint for the context. See
 contextSetGravityHint for details.
Since: 1.16
getLanguage
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m Language | Returns: the global language tag.  | 
Retrieves the global language tag for the context.
getMatrix
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m (Maybe Matrix) | Returns: the matrix, or   | 
Gets the transformation matrix that will be applied when
 rendering with this context. See contextSetMatrix.
Since: 1.6
getMetrics
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> Maybe FontDescription | 
  | 
| -> Maybe Language | 
  | 
| -> m FontMetrics | Returns: a   | 
Get overall metric information for a 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 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.
getRoundGlyphPositions
contextGetRoundGlyphPositions Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m Bool | 
Returns whether font rendering with this context should round glyph positions and widths.
Since: 1.44
getSerial
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m Word32 | Returns: The current serial number of   | 
Returns the current serial number of context.  The serial number is
 initialized to an small number larger than zero when a new context
 is created and is increased whenever the context is changed using any
 of the setter functions, or the FontMap it uses to find fonts has
 changed. The serial may wrap, but will never have the value 0. Since it
 can wrap, never compare it with "less than", always use "not equals".
This can be used to automatically detect changes to a Context, and
 is only useful when implementing objects that need update when their
 Context changes, like Layout.
Since: 1.32.4
listFamilies
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> m [FontFamily] | 
List all families for a context.
loadFont
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> FontDescription | 
  | 
| -> m (Maybe Font) | Returns: the newly allocated   | 
Loads the font in one of the fontmaps in the context
 that is the closest match for desc.
loadFontset
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> FontDescription | 
  | 
| -> Language | 
  | 
| -> m (Maybe Fontset) | Returns: the newly allocated
            | 
Load a set of fonts in the context that can be used to render
 a font matching desc.
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Context | Returns: the newly allocated   | 
Creates a new Context initialized to default values.
This function is not particularly useful as it should always
 be followed by a contextSetFontMap call, and the
 function fontMapCreateContext does these two steps
 together and hence users are recommended to use that.
If you are using Pango as part of a higher-level system,
 that system may have it's own way of create a Context.
 For instance, the GTK+ toolkit has, among others,
 gdk_pango_context_get_for_screen(), and
 gtk_widget_get_pango_context().  Use those instead.
setBaseDir
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> Direction | 
  | 
| -> m () | 
Sets the base direction for the context.
The base direction is used in applying the Unicode bidirectional
 algorithm; if the direction is DirectionLtr or
 DirectionRtl, then the value will be used as the paragraph
 direction in the Unicode bidirectional algorithm.  A value of
 DirectionWeakLtr or DirectionWeakRtl is used only
 for paragraphs that do not contain any strong characters themselves.
setBaseGravity
contextSetBaseGravity Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> Gravity | 
  | 
| -> m () | 
Sets the base gravity for the context.
The base gravity is used in laying vertical text out.
Since: 1.16
setFontDescription
contextSetFontDescription Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> FontDescription | 
  | 
| -> m () | 
Set the default font description for the context
setFontMap
Arguments
| :: (HasCallStack, MonadIO m, IsContext a, IsFontMap b) | |
| => a | 
  | 
| -> b | 
  | 
| -> m () | 
Sets the font map to be searched when fonts are looked-up in this context.
 This is only for internal use by Pango backends, a Context obtained
 via one of the recommended methods should already have a suitable font map.
setGravityHint
contextSetGravityHint Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> GravityHint | 
  | 
| -> m () | 
Sets the gravity hint for the context.
The gravity hint is used in laying vertical text out, and is only relevant
 if gravity of the context as returned by contextGetGravity
 is set GravityEast or GravityWest.
Since: 1.16
setLanguage
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> Language | 
  | 
| -> m () | 
Sets the global language tag for the context.  The default language
 for the locale of the running process can be found using
 languageGetDefault.
setMatrix
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> Maybe Matrix | 
  | 
| -> m () | 
Sets the transformation matrix that will be applied when rendering with this context. Note that reported metrics are in the 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: 1.6
setRoundGlyphPositions
contextSetRoundGlyphPositions Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContext a) | |
| => a | 
  | 
| -> Bool | 
  | 
| -> m () | 
Sets whether font rendering with this context should round glyph positions and widths to integral positions, in device units.
This is useful when the renderer can't handle subpixel positioning of glyphs.
The default value is to round glyph positions, to remain compatible with previous Pango behavior.
Since: 1.44