gi-pangocairo-1.0.23: PangoCairo bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.PangoCairo.Functions

Description

 
Synopsis

Methods

contextGetFontOptions

contextGetFontOptions Source #

Arguments

:: (HasCallStack, MonadIO m, IsContext a) 
=> a

context: a Context, from a pangocairo font map

-> m (Maybe FontOptions)

Returns: the font options previously set on the context, or Nothing if no options have been set. This value is owned by the context and must not be modified or freed.

Retrieves any font rendering options previously set with contextSetFontOptions. This function does not report options that are derived from the target surface by updateContext

Since: 1.10

contextGetResolution

contextGetResolution Source #

Arguments

:: (HasCallStack, MonadIO m, IsContext a) 
=> a

context: a Context, from a pangocairo font map

-> m Double

Returns: the resolution in "dots per inch". A negative value will be returned if no resolution has previously been set.

Gets the resolution for the context. See contextSetResolution

Since: 1.10

contextSetFontOptions

contextSetFontOptions Source #

Arguments

:: (HasCallStack, MonadIO m, IsContext a) 
=> a

context: a Context, from a pangocairo font map

-> Maybe FontOptions

options: a FontOptions, or Nothing to unset any previously set options. A copy is made.

-> m () 

Sets the font options used when rendering text with this context. These options override any options that updateContext derives from the target surface.

Since: 1.10

contextSetResolution

contextSetResolution Source #

Arguments

:: (HasCallStack, MonadIO m, IsContext a) 
=> a

context: a Context, from a pangocairo font map

-> Double

dpi: the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.) A 0 or negative value means to use the resolution from the font map.

-> m () 

Sets the resolution for the context. This is a scale factor between points specified in a FontDescription and Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).

Since: 1.10

contextSetShapeRenderer

contextSetShapeRenderer Source #

Arguments

:: (HasCallStack, MonadIO m, IsContext a) 
=> a

context: a Context, from a pangocairo font map

-> Maybe ShapeRendererFunc

func: Callback function for rendering attributes of type AttrTypeShape, or Nothing to disable shape rendering.

-> m () 

Sets callback function for context to use for rendering attributes of type AttrTypeShape. See ShapeRendererFunc for details.

Since: 1.18

createContext

createContext Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

cr: a Cairo context

-> m Context

Returns: the newly created Context. Free with objectUnref.

Creates a context object set up to match the current transformation and target surface of the Cairo context. This context can then be used to create a layout using layoutNew.

This function is a convenience function that creates a context using the default font map, then updates it to cr. If you just need to create a layout for use with cr and do not need to access Context directly, you can use createLayout instead.

Since: 1.22

createLayout

createLayout Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

cr: a Cairo context

-> m Layout

Returns: the newly created Layout. Free with objectUnref.

Creates a layout object set up to match the current transformation and target surface of the Cairo context. This layout can then be used for text measurement with functions like layoutGetSize or drawing with functions like showLayout. If you change the transformation or target surface for cr, you need to call updateLayout

This function is the most convenient way to use Cairo with Pango, however it is slightly inefficient since it creates a separate Context object for each layout. This might matter in an application that was laying out large amounts of text.

Since: 1.10

errorUnderlinePath

errorUnderlinePath Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

cr: a Cairo context

-> Double

x: The X coordinate of one corner of the rectangle

-> Double

y: The Y coordinate of one corner of the rectangle

-> Double

width: Non-negative width of the rectangle

-> Double

height: Non-negative height of the rectangle

-> m () 

Add a squiggly line to the current path in the specified cairo context that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. (The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle)

Since: 1.14

glyphStringPath

glyphStringPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsFont a) 
=> Context

cr: a Cairo context

-> a

font: a Font from a FontMap

-> GlyphString

glyphs: a GlyphString

-> m () 

Adds the glyphs in glyphs to the current path in the specified cairo context. The origin of the glyphs (the left edge of the baseline) will be at the current point of the cairo context.

Since: 1.10

layoutLinePath

layoutLinePath Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

cr: a Cairo context

-> LayoutLine

line: a LayoutLine

-> m () 

Adds the text in LayoutLine to the current path in the specified cairo context. The origin of the glyphs (the left edge of the line) will be at the current point of the cairo context.

Since: 1.10

layoutPath

layoutPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayout a) 
=> Context

cr: a Cairo context

-> a

layout: a Pango layout

-> m () 

Adds the text in a Layout to the current path in the specified cairo context. The top-left corner of the Layout will be at the current point of the cairo context.

Since: 1.10

showErrorUnderline

showErrorUnderline Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

cr: a Cairo context

-> Double

x: The X coordinate of one corner of the rectangle

-> Double

y: The Y coordinate of one corner of the rectangle

-> Double

width: Non-negative width of the rectangle

-> Double

height: Non-negative height of the rectangle

-> m () 

Draw a squiggly line in the specified cairo context that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. (The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle)

Since: 1.14

showGlyphItem

showGlyphItem Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

cr: a Cairo context

-> Text

text: the UTF-8 text that glyphItem refers to

-> GlyphItem

glyphItem: a GlyphItem

-> m () 

Draws the glyphs in glyphItem in the specified cairo context, embedding the text associated with the glyphs in the output if the output format supports it (PDF for example), otherwise it acts similar to showGlyphString.

The origin of the glyphs (the left edge of the baseline) will be drawn at the current point of the cairo context.

Note that text is the start of the text for layout, which is then indexed by <literal>glyphItem->item->offset</literal>.

Since: 1.22

showGlyphString

showGlyphString Source #

Arguments

:: (HasCallStack, MonadIO m, IsFont a) 
=> Context

cr: a Cairo context

-> a

font: a Font from a FontMap

-> GlyphString

glyphs: a GlyphString

-> m () 

Draws the glyphs in glyphs in the specified cairo context. The origin of the glyphs (the left edge of the baseline) will be drawn at the current point of the cairo context.

Since: 1.10

showLayout

showLayout Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayout a) 
=> Context

cr: a Cairo context

-> a

layout: a Pango layout

-> m () 

Draws a Layout in the specified cairo context. The top-left corner of the Layout will be drawn at the current point of the cairo context.

Since: 1.10

showLayoutLine

showLayoutLine Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

cr: a Cairo context

-> LayoutLine

line: a LayoutLine

-> m () 

Draws a LayoutLine in the specified cairo context. The origin of the glyphs (the left edge of the line) will be drawn at the current point of the cairo context.

Since: 1.10

updateContext

updateContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsContext a) 
=> Context

cr: a Cairo context

-> a

context: a Context, from a pangocairo font map

-> m () 

Updates a Context previously created for use with Cairo to match the current transformation and target surface of a Cairo context. If any layouts have been created for the context, it's necessary to call layoutContextChanged on those layouts.

Since: 1.10

updateLayout

updateLayout Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayout a) 
=> Context

cr: a Cairo context

-> a

layout: a Layout, from createLayout

-> m () 

Updates the private Context of a Layout created with createLayout to match the current transformation and target surface of a Cairo context.

Since: 1.10