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

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

Graphics.Rendering.Pango

Description

Pango is a library for laying out and rendering of text, with an emphasis on internationalization. Pango can be used anywhere that text layout is needed, though most of the work on Pango so far has been done in the context of the GTK+ widget toolkit. Pango forms the core of text and font handling for GTK+-2.x.

Pango is designed to be modular; the core Pango layout engine can be used with different font backends. There are three basic backends:

- Client side fonts using the FreeType and fontconfig libraries.
- Native fonts on Microsoft Windows using Uniscribe for complex-text handling.
- Native fonts on MacOS X using ATSUI for complex-text handling.

The integration of Pango with Cairo <https: high quality text handling and graphics rendering.

Dynamically loaded modules then handle text layout for particular combinations of script and font backend. Pango ships with a wide selection of modules, including modules for Hebrew, Arabic, Hangul, Thai, and a number of Indic scripts. Virtually all of the world's major scripts are supported.

As well as the low level layout rendering routines, Pango includes `PangoLayout`, a high level driver for laying out entire blocks of text, and routines to assist in editing internationalized text.

Pango depends on 2.x series of the GLib library.

This module only re-exports the parts of the Pango library that are relevant for text rendering (as opposed to integration with other libraries).

Synopsis

- module Graphics.Rendering.Pango.Context
- data LayoutLine
- data LayoutIter
- data PangoLayout
- data CursorPos
  - = CursorPosPrevPara
  - | CursorPos Int Int
  - | CursorPosNextPara
- type TabPosition = (Double, TabAlign)
- data TabAlign
- data LayoutAlignment
  - = AlignLeft
  - | AlignCenter
  - | AlignRight
- data LayoutWrapMode
  - = WrapWholeWords
  - | WrapAnywhere
  - | WrapPartialWords
- layoutEmpty :: PangoContext -> IO PangoLayout
- layoutText :: GlibString string => PangoContext -> string -> IO PangoLayout
- layoutCopy :: PangoLayout -> IO PangoLayout
- layoutGetContext :: PangoLayout -> IO PangoContext
- layoutContextChanged :: PangoLayout -> IO ()
- layoutSetText :: GlibString string => PangoLayout -> string -> IO ()
- layoutGetText :: GlibString string => PangoLayout -> IO string
- layoutSetMarkup :: (GlibString markup, GlibString string) => PangoLayout -> markup -> IO string
- escapeMarkup :: GlibString string => string -> string
- layoutSetMarkupWithAccel :: (GlibString markup, GlibString string) => PangoLayout -> markup -> IO (Char, string)
- layoutSetAttributes :: PangoLayout -> [PangoAttribute] -> IO ()
- layoutGetAttributes :: PangoLayout -> IO [[PangoAttribute]]
- layoutSetFontDescription :: PangoLayout -> Maybe FontDescription -> IO ()
- layoutGetFontDescription :: PangoLayout -> IO (Maybe FontDescription)
- layoutSetWidth :: PangoLayout -> Maybe Double -> IO ()
- layoutGetWidth :: PangoLayout -> IO (Maybe Double)
- layoutSetWrap :: PangoLayout -> LayoutWrapMode -> IO ()
- layoutGetWrap :: PangoLayout -> IO LayoutWrapMode
- layoutSetEllipsize :: PangoLayout -> EllipsizeMode -> IO ()
- layoutGetEllipsize :: PangoLayout -> IO EllipsizeMode
- layoutSetIndent :: PangoLayout -> Double -> IO ()
- layoutGetIndent :: PangoLayout -> IO Double
- layoutSetSpacing :: PangoLayout -> Double -> IO ()
- layoutGetSpacing :: PangoLayout -> IO Double
- layoutSetJustify :: PangoLayout -> Bool -> IO ()
- layoutGetJustify :: PangoLayout -> IO Bool
- layoutSetAutoDir :: PangoLayout -> Bool -> IO ()
- layoutGetAutoDir :: PangoLayout -> IO Bool
- layoutSetAlignment :: PangoLayout -> LayoutAlignment -> IO ()
- layoutGetAlignment :: PangoLayout -> IO LayoutAlignment
- layoutSetTabs :: PangoLayout -> [TabPosition] -> IO ()
- layoutResetTabs :: PangoLayout -> IO ()
- layoutGetTabs :: PangoLayout -> IO (Maybe [TabPosition])
- layoutSetSingleParagraphMode :: PangoLayout -> Bool -> IO ()
- layoutGetSingleParagraphMode :: PangoLayout -> IO Bool
- layoutXYToIndex :: PangoLayout -> Double -> Double -> IO (Bool, Int, Int)
- layoutIndexToPos :: PangoLayout -> Int -> IO PangoRectangle
- layoutGetCursorPos :: PangoLayout -> Int -> IO (PangoRectangle, PangoRectangle)
- layoutMoveCursorVisually :: PangoLayout -> Bool -> Int -> Bool -> IO CursorPos
- layoutGetExtents :: PangoLayout -> IO (PangoRectangle, PangoRectangle)
- layoutGetPixelExtents :: PangoLayout -> IO (Rectangle, Rectangle)
- layoutGetLineCount :: PangoLayout -> IO Int
- layoutGetLine :: PangoLayout -> Int -> IO LayoutLine
- layoutGetLines :: PangoLayout -> IO [LayoutLine]
- layoutGetIter :: PangoLayout -> IO LayoutIter
- layoutIterNextItem :: LayoutIter -> IO Bool
- layoutIterNextChar :: LayoutIter -> IO Bool
- layoutIterNextCluster :: LayoutIter -> IO Bool
- layoutIterNextLine :: LayoutIter -> IO Bool
- layoutIterAtLastLine :: LayoutIter -> IO Bool
- layoutIterGetIndex :: LayoutIter -> IO Int
- layoutIterGetBaseline :: LayoutIter -> IO Double
- layoutIterGetItem :: LayoutIter -> IO (Maybe GlyphItem)
- layoutIterGetLine :: LayoutIter -> IO (Maybe LayoutLine)
- layoutIterGetCharExtents :: LayoutIter -> IO PangoRectangle
- layoutIterGetClusterExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle)
- layoutIterGetRunExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle)
- layoutIterGetLineYRange :: LayoutIter -> IO (Double, Double)
- layoutIterGetLineExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle)
- layoutLineGetExtents :: LayoutLine -> IO (PangoRectangle, PangoRectangle)
- layoutLineGetPixelExtents :: LayoutLine -> IO (Rectangle, Rectangle)
- layoutLineIndexToX :: LayoutLine -> Int -> Bool -> IO Double
- layoutLineXToIndex :: LayoutLine -> Double -> IO (Bool, Int, Int)
- layoutLineGetXRanges :: LayoutLine -> Int -> Int -> IO [(Double, Double)]
- module Graphics.Rendering.Pango.Rendering
- module Graphics.Rendering.Pango.Markup
- module Graphics.Rendering.Pango.Font
- data PangoGravityHint
  - = PangoGravityHintNatural
  - | PangoGravityHintStrong
  - | PangoGravityHintLine
- data PangoGravity
  - = PangoGravitySouth
  - | PangoGravityEast
  - | PangoGravityNorth
  - | PangoGravityWest
  - | PangoGravityAuto
- data Underline
  - = UnderlineNone
  - | UnderlineSingle
  - | UnderlineDouble
  - | UnderlineLow
  - | UnderlineError
- data Stretch
  - = StretchUltraCondensed
  - | StretchExtraCondensed
  - | StretchCondensed
  - | StretchSemiCondensed
  - | StretchNormal
  - | StretchSemiExpanded
  - | StretchExpanded
  - | StretchExtraExpanded
  - | StretchUltraExpanded
- data Variant
  - = VariantNormal
  - | VariantSmallCaps
- data Weight
  - = WeightThin
  - | WeightUltralight
  - | WeightLight
  - | WeightSemilight
  - | WeightBook
  - | WeightNormal
  - | WeightMedium
  - | WeightSemibold
  - | WeightBold
  - | WeightUltrabold
  - | WeightHeavy
  - | WeightUltraheavy
- data FontStyle
  - = StyleNormal
  - | StyleOblique
  - | StyleItalic
- data PangoAttribute
  - = AttrLanguage {
    - paStart :: Int
    - paEnd :: Int
    - paLang :: Language
    }
  - | AttrFamily {
    - paStart :: Int
    - paEnd :: Int
    - paFamily :: DefaultGlibString
    }
  - | AttrStyle {
    - paStart :: Int
    - paEnd :: Int
    - paStyle :: FontStyle
    }
  - | AttrWeight {
    - paStart :: Int
    - paEnd :: Int
    - paWeight :: Weight
    }
  - | AttrVariant {
    - paStart :: Int
    - paEnd :: Int
    - paVariant :: Variant
    }
  - | AttrStretch {
    - paStart :: Int
    - paEnd :: Int
    - paStretch :: Stretch
    }
  - | AttrSize {
    - paStart :: Int
    - paEnd :: Int
    - paSize :: Double
    }
  - | AttrAbsSize {
    - paStart :: Int
    - paEnd :: Int
    - paSize :: Double
    }
  - | AttrFontDescription {
    - paStart :: Int
    - paEnd :: Int
    - paFontDescription :: FontDescription
    }
  - | AttrForeground {
    - paStart :: Int
    - paEnd :: Int
    - paColor :: Color
    }
  - | AttrBackground {
    - paStart :: Int
    - paEnd :: Int
    - paColor :: Color
    }
  - | AttrUnderline {
    - paStart :: Int
    - paEnd :: Int
    - paUnderline :: Underline
    }
  - | AttrUnderlineColor {
    - paStart :: Int
    - paEnd :: Int
    - paColor :: Color
    }
  - | AttrStrikethrough {
    - paStart :: Int
    - paEnd :: Int
    - paStrikethrough :: Bool
    }
  - | AttrStrikethroughColor {
    - paStart :: Int
    - paEnd :: Int
    - paColor :: Color
    }
  - | AttrRise {
    - paStart :: Int
    - paEnd :: Int
    - paRise :: Double
    }
  - | AttrShape {
    - paStart :: Int
    - paEnd :: Int
    - paInk :: PangoRectangle
    - paLogical :: PangoRectangle
    }
  - | AttrScale {
    - paStart :: Int
    - paEnd :: Int
    - paScale :: Double
    }
  - | AttrFallback {
    - paStart :: Int
    - paEnd :: Int
    - paFallback :: Bool
    }
  - | AttrLetterSpacing {
    - paStart :: Int
    - paEnd :: Int
    - paLetterSpacing :: Double
    }
  - | AttrGravity {
    - paStart :: Int
    - paEnd :: Int
    - paGravity :: PangoGravity
    }
  - | AttrGravityHint {
    - paStart :: Int
    - paEnd :: Int
    - paGravityHint :: PangoGravityHint
    }
- data PangoDirection
  - = PangoDirectionLtr
  - | PangoDirectionRtl
  - | PangoDirectionWeakLtr
  - | PangoDirectionWeakRtl
  - | PangoDirectionNeutral
- data PangoRectangle = PangoRectangle Double Double Double Double
- data Rectangle = Rectangle Int Int Int Int
- data Color = Color Word16 Word16 Word16
- type PangoUnit = Double
- pangoScale :: Double
- data FontMetrics = FontMetrics {
  - ascent :: Double
  - descent :: Double
  - approximateCharWidth :: Double
  - approximateDigitWidth :: Double
  - underlineThickness :: Double
  - underlinePosition :: Double
  - strikethroughThickness :: Double
  - strikethroughPosition :: Double
  }
- data EllipsizeMode
  - = EllipsizeNone
  - | EllipsizeStart
  - | EllipsizeMiddle
  - | EllipsizeEnd
- data Size
  - = SizePoint Double
  - | SizeUnreadable
  - | SizeTiny
  - | SizeSmall
  - | SizeMedium
  - | SizeLarge
  - | SizeHuge
  - | SizeGiant
  - | SizeSmaller
  - | SizeLarger
- module Graphics.Rendering.Pango.Cairo

# Documentation

module Graphics.Rendering.Pango.Context

data LayoutLine Source #

A single line in a `PangoLayout`.

data LayoutIter Source #

An iterator to examine a layout.

data PangoLayout Source #

A rendered paragraph.

data CursorPos Source #

A new cursor position.

See `layoutMoveCursorVisually`.

Constructors

CursorPosPrevPara | The cursor should move to the previous paragraph.
CursorPos Int Int | The sum of the indices is the new cursor position.
CursorPosNextPara | The cursor should advance to the next paragraph.

type TabPosition = (Double, TabAlign) Source #

A Tab position.

data TabAlign Source #

Specify where the Tab stop appears relative to the text.

- Only Tab stops that align text to the left are supported right now.

Instances

Enum TabAlign Source # |

Instance details

Defined in Graphics.Rendering.Pango.Layout

Methods

succ :: TabAlign -> TabAlign Source #

pred :: TabAlign -> TabAlign Source #

toEnum :: Int -> TabAlign Source #

fromEnum :: TabAlign -> Int Source #

enumFrom :: TabAlign -> [TabAlign] Source #

enumFromThen :: TabAlign -> TabAlign -> [TabAlign] Source #

enumFromTo :: TabAlign -> TabAlign -> [TabAlign] Source #

enumFromThenTo :: TabAlign -> TabAlign -> TabAlign -> [TabAlign] Source #

data LayoutAlignment Source #

Enumerate to which side incomplete lines are flushed.

Constructors

AlignLeft |
AlignCenter |
AlignRight |

Instances

Enum LayoutAlignment Source # |

Instance details

Defined in Graphics.Rendering.Pango.Layout

Methods

succ :: LayoutAlignment -> LayoutAlignment Source #

pred :: LayoutAlignment -> LayoutAlignment Source #

toEnum :: Int -> LayoutAlignment Source #

fromEnum :: LayoutAlignment -> Int Source #

enumFrom :: LayoutAlignment -> [LayoutAlignment] Source #

enumFromThen :: LayoutAlignment -> LayoutAlignment -> [LayoutAlignment] Source #

enumFromTo :: LayoutAlignment -> LayoutAlignment -> [LayoutAlignment] Source #

enumFromThenTo :: LayoutAlignment -> LayoutAlignment -> LayoutAlignment -> [LayoutAlignment] Source #

data LayoutWrapMode Source #

Enumerates how a line can be wrapped.

`WrapWholeWords`
  Breaks lines only between words.

- This variant does not guarantee that the requested width is not exceeded. A word that is longer than the paragraph width is not split.

`WrapAnywhere`
  Break lines anywhere.
`WrapPartialWords`
  Wrap within a word if it is the only one on this line.

- This option acts like `WrapWholeWords` but will split a word if it is the only one on this line and it exceeds the specified width.

Constructors

WrapWholeWords |
WrapAnywhere |
WrapPartialWords |

Instances

Enum LayoutWrapMode Source # |

Instance details

Defined in Graphics.Rendering.Pango.Layout

Methods

succ :: LayoutWrapMode -> LayoutWrapMode Source #

pred :: LayoutWrapMode -> LayoutWrapMode Source #

toEnum :: Int -> LayoutWrapMode Source #

fromEnum :: LayoutWrapMode -> Int Source #

enumFrom :: LayoutWrapMode -> [LayoutWrapMode] Source #

enumFromThen :: LayoutWrapMode -> LayoutWrapMode -> [LayoutWrapMode] Source #

enumFromTo :: LayoutWrapMode -> LayoutWrapMode -> [LayoutWrapMode] Source #

enumFromThenTo :: LayoutWrapMode -> LayoutWrapMode -> LayoutWrapMode -> [LayoutWrapMode] Source #

layoutEmpty :: PangoContext -> IO PangoLayout Source #

Create an empty `Layout`.

layoutText :: GlibString string => PangoContext -> string -> IO PangoLayout Source #

Create a new layout.

layoutCopy :: PangoLayout -> IO PangoLayout Source #

Create a copy of the `Layout`.

layoutGetContext :: PangoLayout -> IO PangoContext Source #

Retrieves the `PangoContext` from this layout.

layoutContextChanged :: PangoLayout -> IO () Source #

Signal a `PangoContext` change.

- Forces recomputation of any state in the `PangoLayout` that might depend on the layout's context. This function should be called if you make changes to the context subsequent to creating the layout.

layoutSetText :: GlibString string => PangoLayout -> string -> IO () Source #

Set the string in the layout.

layoutGetText :: GlibString string => PangoLayout -> IO string Source #

Retrieve the string in the layout.

layoutSetMarkup :: (GlibString markup, GlibString string) => PangoLayout -> markup -> IO string Source #

Set the text of the layout, including attributes.

The string may include `Markup`. To print markup characters like `'<'`, or `'-'`, apply `escapeMarkup` to the string first.

The function returns the text that is actually shown.

escapeMarkup :: GlibString string => string -> string Source #

Escape markup characters.

- Used to display characters that normally denote markup. Note that this function is strict in that it forces all characters in the input string as soon as a single output character is requested.

layoutSetMarkupWithAccel :: (GlibString markup, GlibString string) => PangoLayout -> markup -> IO (Char, string) Source #

Set the string in the layout.

- The string may include `Markup`. Furthermore, any underscore character indicates that the next character will be marked as accelerator (i.e. underlined). A literal underscore character can be produced by placing it twice in the string.
- The character which follows the underscore is returned so it can be used to add the actual keyboard shortcut. The second element is the string after parsing.

layoutSetAttributes :: PangoLayout -> [PangoAttribute] -> IO () Source #

Set text attributes of the text in the layout.

- This function replaces any text attributes that this layout contained, even those that were set by using `layoutSetMarkup`.

layoutGetAttributes :: PangoLayout -> IO [[PangoAttribute]] Source #

Gets the list of attributes of the layout, if any.

- The attribute list is a list of lists of attribute. Each list describes the attributes for the same span.

layoutSetFontDescription :: PangoLayout -> Maybe FontDescription -> IO () Source #

Set a specific font description for this layout.

- Specifying `Nothing` will unset the current font description, that is, the `PangoLayout` will use the font description in the current `PangoContext`.

layoutGetFontDescription :: PangoLayout -> IO (Maybe FontDescription) Source #

Ask for the specifically set font description of this layout.

- Returns `Nothing` if this layout uses the font description in the `PangoContext` it was created in.
- Only available in Pango 1.8.0 or higher.

layoutSetWidth :: PangoLayout -> Maybe Double -> IO () Source #

Set the width of this paragraph.

- Sets the width to which the lines of the `PangoLayout` should be wrapped.
- Pass in `Nothing` to indicate that no wrapping is to be performed.

layoutGetWidth :: PangoLayout -> IO (Maybe Double) Source #

Gets the width of this paragraph.

- Gets the width to which the lines of the `PangoLayout` should be wrapped.
- Returns is the current width, or `Nothing` to indicate that no wrapping is performed.

layoutSetWrap :: PangoLayout -> LayoutWrapMode -> IO () Source #

Set how this paragraph is wrapped.

- Sets the wrap style; the wrap style only has an effect if a width is set on the layout with `layoutSetWidth`. To turn off wrapping, call `layoutSetWidth` with `Nothing`.

layoutGetWrap :: PangoLayout -> IO LayoutWrapMode Source #

Get the wrap mode for the layout.

layoutSetEllipsize :: PangoLayout -> EllipsizeMode -> IO () Source #

Set how long lines should be abbreviated.

layoutGetEllipsize :: PangoLayout -> IO EllipsizeMode Source #

Get the ellipsize mode for this layout.

layoutSetIndent :: PangoLayout -> Double -> IO () Source #

Set the indentation of this paragraph.

- Sets the amount by which the first line should be indented. A negative value will produce a hanging indent, that is, all subsequent lines will be indented while the first line has full width.

layoutGetIndent :: PangoLayout -> IO Double Source #

Gets the indentation of this paragraph.

- Gets the amount by which the first line or the rest of the paragraph is indented.

layoutSetSpacing :: PangoLayout -> Double -> IO () Source #

Set the spacing between lines of this paragraph.

layoutGetSpacing :: PangoLayout -> IO Double Source #

Gets the spacing between the lines.

layoutSetJustify :: PangoLayout -> Bool -> IO () Source #

Set if text should be streched to fit width.

- Sets whether or not each complete line should be stretched to fill the entire width of the layout. This stretching is typically done by adding whitespace, but for some scripts (such as Arabic), the justification is done by extending the characters.
- Note that as of Pango 1.4, this functionality is not yet implemented.

layoutGetJustify :: PangoLayout -> IO Bool Source #

Retrieve the justification flag.

- See `layoutSetJustify`.

layoutSetAutoDir :: PangoLayout -> Bool -> IO () Source #

Set if the base text direction should be overridden.

- Sets whether to calculate the bidirectional base direction for the layout according to the contents of the layout; when this flag is on (the default), then paragraphs in layout that begin with strong right-to-left characters (Arabic and Hebrew principally), will have right-to-left layout, paragraphs with letters from other scripts will have left-to-right layout. Paragraphs with only neutral characters get their direction from the surrounding paragraphs.
- When `False`, the choice between left-to-right and right-to-left layout is done by according to the base direction of the layout's `PangoContext`. (See `contextSetTextDir`).
- When the auto-computed direction or a paragraph differs from the base direction of the context, then the interpretation of `AlignLeft` and `AlignRight` are swapped.

layoutGetAutoDir :: PangoLayout -> IO Bool Source #

Retrieve the auto direction flag.

- See `layoutSetAutoDir`.

layoutSetAlignment :: PangoLayout -> LayoutAlignment -> IO () Source #

Set how this paragraph is aligned.

- Sets the alignment for the layout (how partial lines are positioned within the horizontal space available.)

layoutGetAlignment :: PangoLayout -> IO LayoutAlignment Source #

Get the alignment for the layout.

layoutSetTabs :: PangoLayout -> [TabPosition] -> IO () Source #

Set a list of Tab positoins.

layoutResetTabs :: PangoLayout -> IO () Source #

Reset the original set of Tab positions.

- Restore the default which is a Tab stop every eight characters.

layoutGetTabs :: PangoLayout -> IO (Maybe [TabPosition]) Source #

Retrieve the list of current Tab positions.

- If no Tab position where set, `Nothing` is returned. In this case, Tab positions are implicit at every eight characters.

layoutSetSingleParagraphMode :: PangoLayout -> Bool -> IO () Source #

Honor newlines or not.

- If `honor` is `True`, do not treat newlines and similar characters as paragraph separators; instead, keep all text in a single paragraph, and display a glyph for paragraph separator characters. Used when you want to allow editing of newlines on a single text line.

layoutGetSingleParagraphMode :: PangoLayout -> IO Bool Source #

Retrieve if newlines are honored.

- See `layoutSetSingleParagraphMode`.

layoutXYToIndex Source #

Arguments

:: PangoLayout |
-> Double | the `x` position
-> Double | the `y` position
-> IO (Bool, Int, Int) |

Converts a device unit to a character index.

- Converts from `x` and `y` position within a layout to the index of the closest character. If the `y` position is not inside the layout, the closest position is chosen (the position will be clamped inside the layout). If the `x` position is not within the layout, then the start or the end of the line is chosen. If either the `x` or `y` positions were not inside the layout, then the function returns `False`; on an exact hit, it returns `True`.
- The function returns the flag for the exact hit and the index into the string. The third value is zero if the character corresponds to one grapheme. If the grapheme is the result of a cluster, this value may be greater than one, indicating where in the grapheme the position lies. Zero represents the trailing edge on the grapheme.

layoutIndexToPos :: PangoLayout -> Int -> IO PangoRectangle Source #

Return the rectangle of the glyph at the given index.

- Converts from an index within a `PangoLayout` to the onscreen position corresponding to the grapheme at that index, which is represented as rectangle. Note that, given a `PangoRectangle x y width height`, `x` is always the leading edge of the grapheme and `x + width` the trailing edge of the grapheme. If the directionality of the grapheme is right-to-left, then `width` will be negative.

layoutGetCursorPos Source #

Arguments

:: PangoLayout |
-> Int |

-> IO (PangoRectangle, PangoRectangle)

    (strong, weak)

Return a cursor position.

- Given an index within a layout, determines the positions that of the strong and weak cursors if the insertion point is at that index. The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the location where characters of the directionality equal to the base direction of the layout are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction of the layout are inserted. The first element of the typle is the strong position, the second the weak.

layoutMoveCursorVisually Source #

Arguments

:: PangoLayout |
-> Bool | `True` to create a strong cursor.
-> Int | The previous position.
-> Bool | `True` if the cursor should move right.
-> IO CursorPos |

Move a cursor visually.

- Compute a new cursor position from a previous cursor position. A value of `True` for the direction will move it to the right, independant of the underlying direction. Hence the cursor position might jump if left-to-right text is mixed with right-to-left text.
- The first flag should be `True` if this cursor is the strong cursor. The strong cursor is the cursor of the base direction of the current layout (see `layoutSetAutoDir`). The weak cursor is that of the opposite direction.
- The previous cursor position is given by `idx`. If this text at this position is a cluster, the cursor will only move to the end or beginning of the cluster as opposed to past the next character. The return value is either `CursorPosNextPara` if the cursor moved beyond this paragraph, it is `CursorPosPrevPara` if the cursor moved in front of this paragraph and it is `CursorPos` `idx` `trail` to denote the new cursor position `idx`. Note that `idx` will always denote an insertion point, that is, `idx` will never point into the middle of a cluster. The `trail` value can contain a positive value if the current cursor position is at the end of the current line. In this case, `idx` points past the last character of this line while `trail` contains the number of characters that are reponsible for the line break such as newlines. The actual cursor position is always `idx+trail` where the visual cursor should be shown.

layoutGetExtents Source #

Arguments

:: PangoLayout |

-> IO (PangoRectangle, PangoRectangle)

    (ink, logical)

Computes the logical and ink extents of the `PangoLayout`.

Logical extents are usually what you want for positioning things. Note that both extents may have non-zero x and y. You may want to use those to offset where you render the layout. Not doing that is a very typical bug that shows up as right-to-left layouts not being correctly positioned in a layout with a set width.

Layout coordinates begin at the top left corner of the layout.

layoutGetPixelExtents Source #

Arguments

:: PangoLayout |

-> IO (Rectangle, Rectangle)

    (ink, logical)

Compute the physical size of the layout.

- Computes the ink and the logical size of the `Layout` in device units, that is, pixels for a screen. Identical to `layoutGetExtents` and converting the `Double`s in the `PangoRectangle` to integers.

layoutGetLineCount :: PangoLayout -> IO Int Source #

Ask for the number of lines in this layout.

layoutGetLine :: PangoLayout -> Int -> IO LayoutLine Source #

Extract a single lines of the layout.

- The given index starts from 0. The function throws an `ArrayException` if the index is out of bounds.
- The lines of each layout are regenerated if any attribute changes. Thus the returned list does not reflect the current state of lines after a change has been made.

layoutGetLines :: PangoLayout -> IO [LayoutLine] Source #

Extract the lines of the layout.

- The lines of each layout are regenerated if any attribute changes. Thus the returned list does not reflect the current state of lines after a change has been made.

layoutGetIter :: PangoLayout -> IO LayoutIter Source #

Create an iterator to examine a layout.

layoutIterNextItem :: LayoutIter -> IO Bool Source #

Move to the next `GlyphItem`.

- Returns `False` if this was the last item in the layout.

layoutIterNextChar :: LayoutIter -> IO Bool Source #

Move to the next char.

- Returns `False` if this was the last char in the layout.

layoutIterNextCluster :: LayoutIter -> IO Bool Source #

Move to the next cluster.

- Returns `False` if this was the last cluster in the layout.

layoutIterNextLine :: LayoutIter -> IO Bool Source #

Move to the next line.

- Returns `False` if this was the last line in the layout.

layoutIterAtLastLine :: LayoutIter -> IO Bool Source #

Check if the iterator is on the last line.

- Returns `True` if the iterator is on the last line of this paragraph.

layoutIterGetIndex :: LayoutIter -> IO Int Source #

Get the character index.

- Note that iterating forward by char moves in visual order, not logical order, so indexes may not be sequential. Also, the index may be equal to the length of the text in the layout.

layoutIterGetBaseline :: LayoutIter -> IO Double Source #

Query the vertical position within the layout.

- Gets the y position of the current line's baseline (origin at top left of the entire layout).

layoutIterGetItem :: LayoutIter -> IO (Maybe GlyphItem) Source #

Retrieve the current `GlyphItem` under the iterator.

- Each `LayoutLine` contains a list of `GlyphItem`s. This function returns the `GlyphItem` under the current iterator. If the iterator is positioned past the last charactor of the paragraph, the function returns `Nothing`.

layoutIterGetLine :: LayoutIter -> IO (Maybe LayoutLine) Source #

Extract the line under the iterator.

layoutIterGetCharExtents :: LayoutIter -> IO PangoRectangle Source #

Retrieve a rectangle surrounding a character.

- Get the extents of the current character (origin is the top left of the entire layout). Only logical extents can sensibly be obtained for characters; ink extents make sense only down to the level of clusters.

layoutIterGetClusterExtents Source #

Arguments

:: LayoutIter |

-> IO (PangoRectangle, PangoRectangle)

    (ink, logical)

Compute the physical size of the cluster.

- Computes the ink and the logical size of the cluster pointed to by `LayoutIter`.

layoutIterGetRunExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle) Source #

Compute the physical size of the run.

- Computes the ink and the logical size of the run pointed to by `LayoutIter`.

layoutIterGetLineYRange :: LayoutIter -> IO (Double, Double) Source #

Retrieve vertical extent of this line.

- Divides the vertical space in the `PangoLayout` being iterated over between the lines in the layout, and returns the space belonging to the current line. A line's range includes the line's logical extents, plus half of the spacing above and below the line, if `layoutSetSpacing` has been called to set layout spacing. The y positions are in layout coordinates (origin at top left of the entire layout).
- The first element in the returned tuple is the start, the second is the end of this line.

layoutIterGetLineExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle) Source #

Compute the physical size of the line.

- Computes the ink and the logical size of the line pointed to by `LayoutIter`. See `layoutGetExtents`.
- Extents are in layout coordinates (origin is the top-left corner of the entire `PangoLayout`). Thus the extents returned by this function will be the same width/height but not at the same x/y as the extents returned from `layoutLineGetExtents`.

layoutLineGetExtents :: LayoutLine -> IO (PangoRectangle, PangoRectangle) Source #

Compute the physical size of the line.

- Computes the ink and the logical size of the `LayoutLine`. See `layoutGetExtents`.

layoutLineGetPixelExtents Source #

Arguments

:: LayoutLine |
-> IO (Rectangle, Rectangle) | (ink, logical)

Compute the physical size of the line.

- Computes the ink and the logical size of the `LayoutLine`. See `layoutGetExtents`. The returned values are in device units, that is, pixels for the screen and points for printers.

layoutLineIndexToX Source #

Arguments

:: LayoutLine |
-> Int | the index into the string
-> Bool | return the beginning (`False`) or the end of the character
-> IO Double |

Request the horizontal position of a character.

layoutLineXToIndex Source #

Arguments

:: LayoutLine |
-> Double | The `x` position.
-> IO (Bool, Int, Int) |

Request the character index of a given horizontal position.

- Converts from an x offset to the index of the corresponding character within the text of the layout. If the `x` parameter is outside the line, a triple `(False, index, trailing)` is returned where `index` and `trailing` will point to the very first or very last position in the line. This notion of first and last position is based on the direction of the paragraph; for example, if the direction is right-to-left, then an `x` position to the right of the line results in 0 being returned for `index` and `trailing`. An `x` position to the left of the line results in `index` pointing to the (logical) last grapheme in the line and trailing pointing to the number of characters in that grapheme. The reverse is true for a left-to-right line. If the boolean flag in the result is `True` then `x` was within the layout line and `trailing` indicates where in a cluster the `x` position lay. It is 0 for the trailing edge of the cluster.

layoutLineGetXRanges Source #

Arguments

:: LayoutLine | The line of interest.
-> Int | The index of the start character (counting from 0). If this value is less than the start index for the line, then the first range will extend all the way to the leading edge of the layout. Otherwise it will start at the leading edge of the first character.
-> Int | The index after the last character. If this value is greater than the end index for the line, then the last range will extend all the way to the trailing edge of the layout. Otherwise, it will end at the trailing edge of the last character.
-> IO [(Double, Double)] |

Retrieve bounding boxes for a given piece of text contained in this `LayoutLine`.

- The result is a list to accommodate for mixed left-to-right and right-to-left text. Even if the text is not mixed, several ranges might be returned that are adjacent. The ranges are always sorted from left to right. The values are with respect to the left edge of the entire layout, not with respect to the line (which might be indented or not left aligned).

module Graphics.Rendering.Pango.Rendering

module Graphics.Rendering.Pango.Markup

module Graphics.Rendering.Pango.Font

data PangoGravityHint Source #

The `PangoGravityHint` defines how horizontal scripts should behave in a vertical context.

- `PangoGravityHintNatural`: scripts will take their natural gravity based on the base gravity and the script. This is the default.
- `PangoGravityHintStrong`: always use the base gravity set, regardless of the script.
- `PangoGravityHintLine`: for scripts not in their natural direction (eg. Latin in East gravity), choose per-script gravity such that every script respects the line progression. This means, Latin and Arabic will take opposite gravities and both flow top-to-bottom for example.

Constructors

PangoGravityHintNatural |
PangoGravityHintStrong |
PangoGravityHintLine |

Instances

Enum PangoGravityHint Source # |

Instance details

Defined in Graphics.Rendering.Pango.BasicTypes

Methods

succ :: PangoGravityHint -> PangoGravityHint Source #

pred :: PangoGravityHint -> PangoGravityHint Source #

toEnum :: Int -> PangoGravityHint Source #

fromEnum :: PangoGravityHint -> Int Source #

enumFrom :: PangoGravityHint -> [PangoGravityHint] Source #

enumFromThen :: PangoGravityHint -> PangoGravityHint -> [PangoGravityHint] Source #

enumFromTo :: PangoGravityHint -> PangoGravityHint -> [PangoGravityHint] Source #

enumFromThenTo :: PangoGravityHint -> PangoGravityHint -> PangoGravityHint -> [PangoGravityHint] Source #

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

data PangoGravity Source #

The `PangoGravity` type represents the orientation of glyphs in a segment of text. The value `GravitySouth`, for instance, indicates that the text stands upright, i.e. that the base of the letter is directed downwards.

This is useful when rendering vertical text layouts. In those situations, the layout is rotated using a non-identity `PangoMatrix`, and then glyph orientation is controlled using `PangoGravity`. Not every value in this enumeration makes sense for every usage of `Gravity`; for example, `PangoGravityAuto` only can be passed to `pangoContextSetBaseGravity` and can only be returned by `pangoContextGetBaseGravity`.

- See also: `PangoGravityHint`
- Gravity is resolved from the context matrix.
- Since Pango 1.16

Constructors

PangoGravitySouth |
PangoGravityEast |
PangoGravityNorth |
PangoGravityWest |
PangoGravityAuto |

Instances

Enum PangoGravity Source # |

Instance details

Defined in Graphics.Rendering.Pango.BasicTypes

Methods

succ :: PangoGravity -> PangoGravity Source #

pred :: PangoGravity -> PangoGravity Source #

toEnum :: Int -> PangoGravity Source #

fromEnum :: PangoGravity -> Int Source #

enumFrom :: PangoGravity -> [PangoGravity] Source #

enumFromThen :: PangoGravity -> PangoGravity -> [PangoGravity] Source #

enumFromTo :: PangoGravity -> PangoGravity -> [PangoGravity] Source #

enumFromThenTo :: PangoGravity -> PangoGravity -> PangoGravity -> [PangoGravity] Source #

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

data Underline Source #

Define attributes for `Underline`.

- The squiggly underline for errors is only available in Gtk 2.4 and higher.

Constructors

UnderlineNone |
UnderlineSingle |
UnderlineDouble |
UnderlineLow |
UnderlineError |

Instances

Enum Underline Source # |

Instance details

Defined in Graphics.Rendering.Pango.BasicTypes

Methods

succ :: Underline -> Underline Source #

pred :: Underline -> Underline Source #

toEnum :: Int -> Underline Source #

fromEnum :: Underline -> Int Source #

enumFrom :: Underline -> [Underline] Source #

enumFromThen :: Underline -> Underline -> [Underline] Source #

enumFromTo :: Underline -> Underline -> [Underline] Source #

enumFromThenTo :: Underline -> Underline -> Underline -> [Underline] Source #

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

data Stretch Source #

Define how wide characters are.

Constructors

StretchUltraCondensed |
StretchExtraCondensed |
StretchCondensed |
StretchSemiCondensed |
StretchNormal |
StretchSemiExpanded |
StretchExpanded |
StretchExtraExpanded |
StretchUltraExpanded |

Instances

Enum Stretch Source # |

Instance details

Defined in Graphics.Rendering.Pango.BasicTypes

Methods

succ :: Stretch -> Stretch Source #

pred :: Stretch -> Stretch Source #

toEnum :: Int -> Stretch Source #

fromEnum :: Stretch -> Int Source #

enumFrom :: Stretch -> [Stretch] Source #

enumFromThen :: Stretch -> Stretch -> [Stretch] Source #

enumFromTo :: Stretch -> Stretch -> [Stretch] Source #

enumFromThenTo :: Stretch -> Stretch -> Stretch -> [Stretch] Source #

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

data Variant Source #

The variant of a font.

- The `VariantSmallCaps` is a version of a font where lower case letters are shown as physically smaller upper case letters.

Constructors

VariantNormal |
VariantSmallCaps |

Instances

Enum Variant Source # |

Instance details

Defined in Graphics.Rendering.Pango.BasicTypes

Methods

succ :: Variant -> Variant Source #

pred :: Variant -> Variant Source #

toEnum :: Int -> Variant Source #

fromEnum :: Variant -> Int Source #

enumFrom :: Variant -> [Variant] Source #

enumFromThen :: Variant -> Variant -> [Variant] Source #

enumFromTo :: Variant -> Variant -> [Variant] Source #

enumFromThenTo :: Variant -> Variant -> Variant -> [Variant] Source #

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

data Weight Source #

Define attributes for `Weight`.

Constructors

WeightThin |
WeightUltralight |
WeightLight |
WeightSemilight |
WeightBook |
WeightNormal |
WeightMedium |
WeightSemibold |
WeightBold |
WeightUltrabold |
WeightHeavy |
WeightUltraheavy |

Instances

Enum Weight Source # |

Instance details

Defined in Graphics.Rendering.Pango.BasicTypes

Methods

succ :: Weight -> Weight Source #

pred :: Weight -> Weight Source #

toEnum :: Int -> Weight Source #

fromEnum :: Weight -> Int Source #

enumFrom :: Weight -> [Weight] Source #

enumFromThen :: Weight -> Weight -> [Weight] Source #

enumFromTo :: Weight -> Weight -> [Weight] Source #

enumFromThenTo :: Weight -> Weight -> Weight -> [Weight] Source #

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

data FontStyle Source #

The style of a font.

- `StyleOblique` is a slanted font like `StyleItalic`, but in a roman style.

Constructors

StyleNormal |
StyleOblique |
StyleItalic |

Instances

Enum FontStyle Source # |

Instance details

Defined in Graphics.Rendering.Pango.BasicTypes

Methods

succ :: FontStyle -> FontStyle Source #

pred :: FontStyle -> FontStyle Source #

toEnum :: Int -> FontStyle Source #

fromEnum :: FontStyle -> Int Source #

enumFrom :: FontStyle -> [FontStyle] Source #

enumFromThen :: FontStyle -> FontStyle -> [FontStyle] Source #

enumFromTo :: FontStyle -> FontStyle -> [FontStyle] Source #

enumFromThenTo :: FontStyle -> FontStyle -> FontStyle -> [FontStyle] Source #

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

data PangoAttribute Source #

Attributes for `PangoItem`s.

- A given attribute is applied from its start position `paStart` up, but not including the end position, `paEnd`.

Constructors

AttrLanguage | A hint as to what language this piece of text is written in.

Fields

- paStart :: Int
- paEnd :: Int
- paLang :: Language

AttrFamily | The font family, e.g. `sans serif`.

Fields

- paStart :: Int
- paEnd :: Int
- paFamily :: DefaultGlibString

AttrStyle | The slant of the current font.

Fields

- paStart :: Int
- paEnd :: Int
- paStyle :: FontStyle

AttrWeight | Weight of font, e.g. `WeightBold`.

Fields

- paStart :: Int
- paEnd :: Int
- paWeight :: Weight

AttrVariant | `VariantSmallCaps` will display lower case letters as small upper case letters (if the font supports this).

Fields

- paStart :: Int
- paEnd :: Int
- paVariant :: Variant

AttrStretch | Stretch or condense the width of the letters.

Fields

- paStart :: Int
- paEnd :: Int
- paStretch :: Stretch

AttrSize | Specify the size of the font in points.

Fields

- paStart :: Int
- paEnd :: Int
- paSize :: Double

AttrAbsSize

Specify the size of the font in device units (pixels).

- Available in Pango 1.8.0 and higher.

Fields

- paStart :: Int
- paEnd :: Int
- paSize :: Double

AttrFontDescription | Specify several attributes of a font at once. Note that no deep copy of the description is made when this attributes is passed to or received from functions.

Fields

- paStart :: Int
- paEnd :: Int
- paFontDescription :: FontDescription

AttrForeground | Specify the foreground color.

Fields

- paStart :: Int
- paEnd :: Int
- paColor :: Color

AttrBackground | Specify the background color.

Fields

- paStart :: Int
- paEnd :: Int
- paColor :: Color

AttrUnderline | Specify the kind of underline, e.g. `UnderlineSingle`.

Fields

- paStart :: Int
- paEnd :: Int
- paUnderline :: Underline

AttrUnderlineColor

Specify the color of an underline.

- Available in Pango 1.8.0 and higher.

Fields

- paStart :: Int
- paEnd :: Int
- paColor :: Color

AttrStrikethrough | Specify if this piece of text should have a line through it.

Fields

- paStart :: Int
- paEnd :: Int
- paStrikethrough :: Bool

AttrStrikethroughColor

Specify the color of the strike through line.

- Available in Pango 1.8.0 and higher.

Fields

- paStart :: Int
- paEnd :: Int
- paColor :: Color

AttrRise | Displace the text vertically. Positive values move the text upwards.

Fields

- paStart :: Int
- paEnd :: Int
- paRise :: Double

AttrShape

Restrict the amount of what is drawn of the marked shapes.

- Available in Pango 1.8.0 and higher.

Fields

- paStart :: Int
- paEnd :: Int
- paInk :: PangoRectangle
- paLogical :: PangoRectangle

AttrScale | Scale the font up (values greater than one) or shrink the font.

Fields

- paStart :: Int
- paEnd :: Int
- paScale :: Double

AttrFallback | Determine if a fall back font should be substituted if no matching font is available.

Fields

- paStart :: Int
- paEnd :: Int
- paFallback :: Bool

AttrLetterSpacing

Add extra space between graphemes of the text.

- Available in Pango 1.6.0 and higher.

Fields

- paStart :: Int
- paEnd :: Int
- paLetterSpacing :: Double

AttrGravity

Sets the gravity field of a font description. The gravity field specifies how the glyphs should be rotated. If gravity is `GravityAuto`, this actually unsets the gravity mask on the font description.

- This function is seldom useful to the user. Gravity should normally be set on a `PangoContext`.
- Available in Pango 1.16.0 and higher.

Fields

- paStart :: Int
- paEnd :: Int
- paGravity :: PangoGravity

AttrGravityHint

Set the way horizontal scripts behave in a vertical context.

- Available in Pango 1.16.0 and higher.

Fields

- paStart :: Int
- paEnd :: Int
- paGravityHint :: PangoGravityHint

Instances

Show PangoAttribute Source # |
Instance details Defined in Graphics.Rendering.Pango.Structs Methods showsPrec :: Int -> PangoAttribute -> ShowS Source # show :: PangoAttribute -> String Source # showList :: [PangoAttribute] -> ShowS Source #

data PangoDirection Source #

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

Enum PangoDirection Source # |

Instance details

Defined in Graphics.Rendering.Pango.Structs

Methods

succ :: PangoDirection -> PangoDirection Source #

pred :: PangoDirection -> PangoDirection Source #

toEnum :: Int -> PangoDirection Source #

fromEnum :: PangoDirection -> Int Source #

enumFrom :: PangoDirection -> [PangoDirection] Source #

enumFromThen :: PangoDirection -> PangoDirection -> [PangoDirection] Source #

enumFromTo :: PangoDirection -> PangoDirection -> [PangoDirection] Source #

enumFromThenTo :: PangoDirection -> PangoDirection -> PangoDirection -> [PangoDirection] Source #

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

Instance details

Defined in Graphics.Rendering.Pango.Structs

Methods

compare :: PangoDirection -> PangoDirection -> Ordering Source #

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

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

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

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

max :: PangoDirection -> PangoDirection -> PangoDirection Source #

min :: PangoDirection -> PangoDirection -> PangoDirection Source #

data PangoRectangle Source #

Rectangles describing an area in `Double`s.

- Specifies x, y, width and height

Constructors

PangoRectangle Double Double Double Double |

Instances

Show PangoRectangle Source # |
Instance details Defined in Graphics.Rendering.Pango.Structs Methods showsPrec :: Int -> PangoRectangle -> ShowS Source # show :: PangoRectangle -> String Source # showList :: [PangoRectangle] -> ShowS Source #
Storable PangoRectangle Source # |

Instance details

Defined in Graphics.Rendering.Pango.Structs

Methods

sizeOf :: PangoRectangle -> Int Source #

alignment :: PangoRectangle -> Int Source #

peekElemOff :: Ptr PangoRectangle -> Int -> IO PangoRectangle Source #

pokeElemOff :: Ptr PangoRectangle -> Int -> PangoRectangle -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO PangoRectangle Source #

pokeByteOff :: Ptr b -> Int -> PangoRectangle -> IO () Source #

peek :: Ptr PangoRectangle -> IO PangoRectangle Source #

poke :: Ptr PangoRectangle -> PangoRectangle -> IO () Source #

data Rectangle Source #

Rectangle

- Specifies x, y, width and height

Constructors

Rectangle Int Int Int Int |

Instances

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

data Color Source #

Color

- Specifies a color with three integer values for red, green and blue. All values range from 0 (least intense) to 65535 (highest intensity).

Constructors

Color Word16 Word16 Word16 |

Instances

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

type PangoUnit = Double Source #

pangoScale :: Double Source #

data FontMetrics Source #

The characteristic measurements of a font.

- All values are measured in pixels.
- In Pango versions before 1.6 only `ascent`, `descent`, `approximateCharWidth` and `approximateDigitWidth` are available.

Constructors

FontMetrics |

Fields

- ascent :: Double

  The ascent is the distance from the baseline to the logical top of a line of text. (The logical top may be above or below the top of the actual drawn ink. It is necessary to lay out the text to figure where the ink will be.)

- descent :: Double

  The descent is the distance from the baseline to the logical bottom of a line of text. (The logical bottom may be above or below the bottom of the actual drawn ink. It is necessary to lay out the text to figure where the ink will be.)

- approximateCharWidth :: Double

  The approximate character width. This is merely a representative value useful, for example, for determining the initial size for a window. Actual characters in text will be wider and narrower than this.

- approximateDigitWidth :: Double

  The approximate digit width. This is merely a representative value useful, for example, for determining the initial size for a window. Actual digits in text can be wider and narrower than this, though this value is generally somewhat more accurate than `approximateCharWidth`.

- underlineThickness :: Double

  The suggested thickness to draw an underline.

- underlinePosition :: Double

  The suggested position to draw the underline. The value returned is the distance above the baseline of the top of the underline. Since most fonts have underline positions beneath the baseline, this value is typically negative.

- strikethroughThickness :: Double

  The suggested thickness to draw for the strikethrough.

- strikethroughPosition :: Double

  The suggested position to draw the strikethrough. The value returned is the distance above the baseline of the top of the strikethrough.

Instances

Show FontMetrics Source # |
Instance details Defined in Graphics.Rendering.Pango.Enums Methods showsPrec :: Int -> FontMetrics -> ShowS Source # show :: FontMetrics -> String Source # showList :: [FontMetrics] -> ShowS Source #

data EllipsizeMode Source #

The `EllipsizeMode` type describes what sort of (if any) ellipsization should be applied to a line of text. In the ellipsization process characters are removed from the text in order to make it fit to a given width and replaced with an ellipsis.

Constructors

EllipsizeNone |
EllipsizeStart |
EllipsizeMiddle |
EllipsizeEnd |

Instances

Enum EllipsizeMode Source # |

Instance details

Defined in Graphics.Rendering.Pango.Enums

Methods

succ :: EllipsizeMode -> EllipsizeMode Source #

pred :: EllipsizeMode -> EllipsizeMode Source #

toEnum :: Int -> EllipsizeMode Source #

fromEnum :: EllipsizeMode -> Int Source #

enumFrom :: EllipsizeMode -> [EllipsizeMode] Source #

enumFromThen :: EllipsizeMode -> EllipsizeMode -> [EllipsizeMode] Source #

enumFromTo :: EllipsizeMode -> EllipsizeMode -> [EllipsizeMode] Source #

enumFromThenTo :: EllipsizeMode -> EllipsizeMode -> EllipsizeMode -> [EllipsizeMode] Source #

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

data Size Source #

Define attributes for `FontSize`.

Constructors

SizePoint Double |
SizeUnreadable |
SizeTiny |
SizeSmall |
SizeMedium |
SizeLarge |
SizeHuge |
SizeGiant |
SizeSmaller |
SizeLarger |

Instances

Show Size Source # |
Instance details Defined in Graphics.Rendering.Pango.Enums Methods showsPrec :: Int -> Size -> ShowS Source # show :: Size -> String Source # showList :: [Size] -> ShowS Source #

module Graphics.Rendering.Pango.Cairo