gi-gsk-4.0.9: Gsk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gsk.Objects.TextNode

Contents

- Exported types
- Methods
  - getColor
  - getFont
  - getGlyphs
  - getNumGlyphs
  - getOffset
  - hasColorGlyphs
  - new

Description

A render node drawing a set of glyphs.

Synopsis

- newtype TextNode = TextNode (ManagedPtr TextNode)
- class (BoxedPtr o, TypedObject o, IsDescendantOf TextNode o) => IsTextNode o
- toTextNode :: (MonadIO m, IsTextNode o) => o -> m TextNode
- textNodeGetColor :: (HasCallStack, MonadIO m, IsTextNode a) => a -> m RGBA
- textNodeGetFont :: (HasCallStack, MonadIO m, IsTextNode a) => a -> m Font
- textNodeGetGlyphs :: (HasCallStack, MonadIO m, IsTextNode a) => a -> m [GlyphInfo]
- textNodeGetNumGlyphs :: (HasCallStack, MonadIO m, IsTextNode a) => a -> m Word32
- textNodeGetOffset :: (HasCallStack, MonadIO m, IsTextNode a) => a -> m Point
- textNodeHasColorGlyphs :: (HasCallStack, MonadIO m, IsTextNode a) => a -> m Bool
- textNodeNew :: (HasCallStack, MonadIO m, IsFont a) => a -> GlyphString -> RGBA -> Point -> m (Maybe TextNode)

# Exported types

newtype TextNode Source #

Memory-managed wrapper type.

Constructors

TextNode (ManagedPtr TextNode) |

#### Instances

Instances details

Eq TextNode Source # |
Instance details Defined in GI.Gsk.Objects.TextNode Methods (==) :: TextNode -> TextNode -> Bool Source # (/=) :: TextNode -> TextNode -> Bool Source #
BoxedPtr TextNode Source # |
Instance details Defined in GI.Gsk.Objects.TextNode Methods boxedPtrCopy :: TextNode -> IO TextNode Source # boxedPtrFree :: TextNode -> IO () Source #
ManagedPtrNewtype TextNode Source # |
Instance details Defined in GI.Gsk.Objects.TextNode Methods toManagedPtr :: TextNode -> ManagedPtr TextNode Source #
TypedObject TextNode Source # |
Instance details Defined in GI.Gsk.Objects.TextNode Methods glibType :: IO GType Source #
HasParentTypes TextNode Source # |
Instance details Defined in GI.Gsk.Objects.TextNode
type ParentTypes TextNode Source # |
Instance details Defined in GI.Gsk.Objects.TextNode type ParentTypes TextNode = '[RenderNode]

class (BoxedPtr o, TypedObject o, IsDescendantOf TextNode o) => IsTextNode o Source #

Type class for types which can be safely cast to `TextNode`, for instance with `toTextNode`.

#### Instances

Instances details

(BoxedPtr o, TypedObject o, IsDescendantOf TextNode o) => IsTextNode o Source # |
Instance details Defined in GI.Gsk.Objects.TextNode

toTextNode :: (MonadIO m, IsTextNode o) => o -> m TextNode Source #

Cast to `TextNode`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

draw, hasColorGlyphs, ref, serialize, unref, writeToFile.

#### Getters

getBounds, getChildren, getColor, getFont, getGlyphs, getNodeType, getNumGlyphs, getOffset, getOpaqueRect.

#### Setters

None.

## getColor

textNodeGetColor Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextNode a) |
=> a | `node`: a text `GskRenderNode`
-> m RGBA | Returns: the text color

Retrieves the color used by the text `node`.

The value returned by this function will not be correct if the render node was created for a non-sRGB color.

## getFont

textNodeGetFont Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextNode a) |
=> a | `node`: The `GskRenderNode`
-> m Font | Returns: the font

Returns the font used by the text `node`.

## getGlyphs

textNodeGetGlyphs Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextNode a) |
=> a | `node`: a text `GskRenderNode`
-> m [GlyphInfo] | Returns: the glyph information

Retrieves the glyph information in the `node`.

## getNumGlyphs

textNodeGetNumGlyphs Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextNode a) |
=> a | `node`: a text `GskRenderNode`
-> m Word32 | Returns: the number of glyphs

Retrieves the number of glyphs in the text node.

## getOffset

textNodeGetOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextNode a) |
=> a | `node`: a text `GskRenderNode`
-> m Point | Returns: a point with the horizontal and vertical offsets

Retrieves the offset applied to the text.

## hasColorGlyphs

textNodeHasColorGlyphs Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextNode a) |
=> a | `node`: a text `GskRenderNode`
-> m Bool | Returns: `True` if the text node has color glyphs

Checks whether the text `node` has color glyphs.

Since: 4.2

## new

textNodeNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsFont a) |
=> a | `font`: the `PangoFont` containing the glyphs
-> GlyphString | `glyphs`: the `PangoGlyphString` to render
-> RGBA | `color`: the foreground color to render with
-> Point | `offset`: offset of the baseline
-> m (Maybe TextNode) | Returns: a new `GskRenderNode`

Creates a render node that renders the given glyphs.

Note that `color` may not be used if the font contains color glyphs.