-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Binding to the Pango text rendering engine. -- -- This package provides a wrapper around the Pango C library that allows -- high-quality rendering of Unicode text. It can be used either with -- Cairo to output text in PDF, PS or other documents or with Gtk+ to -- display text on-screen. @package pango @version 0.12.4 -- | This file reflects the Gtk+ object hierarchy in terms of Haskell -- classes. -- -- Note: the mk... functions were originally meant to simply be an alias -- for the constructor. However, in order to communicate the destructor -- of an object to objectNew, the mk... functions are now a tuple -- containing Haskell constructor and the destructor function pointer. -- This hack avoids changing all modules that simply pass mk... to -- objectNew. module Graphics.Rendering.Pango.Types newtype PangoContext PangoContext :: (ForeignPtr (PangoContext)) -> PangoContext class GObjectClass o => PangoContextClass o toPangoContext :: PangoContextClass o => o -> PangoContext mkPangoContext :: (ForeignPtr PangoContext -> PangoContext, FinalizerPtr a) unPangoContext :: PangoContext -> ForeignPtr PangoContext castToPangoContext :: GObjectClass obj => obj -> PangoContext gTypePangoContext :: GType newtype PangoLayoutRaw PangoLayoutRaw :: (ForeignPtr (PangoLayoutRaw)) -> PangoLayoutRaw class GObjectClass o => PangoLayoutRawClass o toPangoLayoutRaw :: PangoLayoutRawClass o => o -> PangoLayoutRaw mkPangoLayoutRaw :: (ForeignPtr PangoLayoutRaw -> PangoLayoutRaw, FinalizerPtr a) unPangoLayoutRaw :: PangoLayoutRaw -> ForeignPtr PangoLayoutRaw castToPangoLayoutRaw :: GObjectClass obj => obj -> PangoLayoutRaw gTypePangoLayoutRaw :: GType newtype Font Font :: (ForeignPtr (Font)) -> Font class GObjectClass o => FontClass o toFont :: FontClass o => o -> Font mkFont :: (ForeignPtr Font -> Font, FinalizerPtr a) unFont :: Font -> ForeignPtr Font castToFont :: GObjectClass obj => obj -> Font gTypeFont :: GType newtype FontFamily FontFamily :: (ForeignPtr (FontFamily)) -> FontFamily class GObjectClass o => FontFamilyClass o toFontFamily :: FontFamilyClass o => o -> FontFamily mkFontFamily :: (ForeignPtr FontFamily -> FontFamily, FinalizerPtr a) unFontFamily :: FontFamily -> ForeignPtr FontFamily castToFontFamily :: GObjectClass obj => obj -> FontFamily gTypeFontFamily :: GType newtype FontFace FontFace :: (ForeignPtr (FontFace)) -> FontFace class GObjectClass o => FontFaceClass o toFontFace :: FontFaceClass o => o -> FontFace mkFontFace :: (ForeignPtr FontFace -> FontFace, FinalizerPtr a) unFontFace :: FontFace -> ForeignPtr FontFace castToFontFace :: GObjectClass obj => obj -> FontFace gTypeFontFace :: GType newtype FontMap FontMap :: (ForeignPtr (FontMap)) -> FontMap class GObjectClass o => FontMapClass o toFontMap :: FontMapClass o => o -> FontMap mkFontMap :: (ForeignPtr FontMap -> FontMap, FinalizerPtr a) unFontMap :: FontMap -> ForeignPtr FontMap castToFontMap :: GObjectClass obj => obj -> FontMap gTypeFontMap :: GType newtype FontSet FontSet :: (ForeignPtr (FontSet)) -> FontSet class GObjectClass o => FontSetClass o toFontSet :: FontSetClass o => o -> FontSet mkFontSet :: (ForeignPtr FontSet -> FontSet, FinalizerPtr a) unFontSet :: FontSet -> ForeignPtr FontSet castToFontSet :: GObjectClass obj => obj -> FontSet gTypeFontSet :: GType instance Eq PangoContext instance Ord PangoContext instance Eq PangoLayoutRaw instance Ord PangoLayoutRaw instance Eq Font instance Ord Font instance Eq FontFamily instance Ord FontFamily instance Eq FontFace instance Ord FontFace instance Eq FontMap instance Ord FontMap instance Eq FontSet instance Ord FontSet instance GObjectClass FontSet instance FontSetClass FontSet instance GObjectClass FontMap instance FontMapClass FontMap instance GObjectClass FontFace instance FontFaceClass FontFace instance GObjectClass FontFamily instance FontFamilyClass FontFamily instance GObjectClass Font instance FontClass Font instance GObjectClass PangoLayoutRaw instance PangoLayoutRawClass PangoLayoutRaw instance GObjectClass PangoContext instance PangoContextClass PangoContext -- | Enumerations for describing font characteristics. module Graphics.Rendering.Pango.Enums type PangoUnit = Double pangoScale :: Double -- | Color -- -- data Color Color :: (Word16) -> (Word16) -> (Word16) -> Color -- | Rectangle -- -- data Rectangle Rectangle :: Int -> Int -> Int -> Int -> Rectangle -- | Rectangles describing an area in Doubles. -- -- data PangoRectangle PangoRectangle :: Double -> Double -> Double -> Double -> PangoRectangle -- | The characteristic measurements of a font. -- -- data FontMetrics FontMetrics :: Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> FontMetrics -- | 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.) ascent :: FontMetrics -> 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.) descent :: FontMetrics -> 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. approximateCharWidth :: FontMetrics -> 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. approximateDigitWidth :: FontMetrics -> Double -- | The suggested thickness to draw an underline. underlineThickness :: FontMetrics -> 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. underlinePosition :: FontMetrics -> Double -- | The suggested thickness to draw for the strikethrough. strikethroughThickness :: FontMetrics -> Double -- | The suggested position to draw the strikethrough. The value returned -- is the distance above the baseline of the top of the strikethrough. strikethroughPosition :: FontMetrics -> Double -- | Define attributes for FontSize. data Size SizePoint :: Double -> Size SizeUnreadable :: Size SizeTiny :: Size SizeSmall :: Size SizeMedium :: Size SizeLarge :: Size SizeHuge :: Size SizeGiant :: Size SizeSmaller :: Size SizeLarger :: Size -- | The style of a font. -- -- data FontStyle StyleNormal :: FontStyle StyleOblique :: FontStyle StyleItalic :: FontStyle -- | Define attributes for Weight. data Weight WeightThin :: Weight WeightUltralight :: Weight WeightLight :: Weight WeightBook :: Weight WeightNormal :: Weight WeightMedium :: Weight WeightSemibold :: Weight WeightBold :: Weight WeightUltrabold :: Weight WeightHeavy :: Weight WeightUltraheavy :: Weight -- | The variant of a font. -- -- data Variant VariantNormal :: Variant VariantSmallCaps :: Variant -- | Define how wide characters are. data Stretch StretchUltraCondensed :: Stretch StretchExtraCondensed :: Stretch StretchCondensed :: Stretch StretchSemiCondensed :: Stretch StretchNormal :: Stretch StretchSemiExpanded :: Stretch StretchExpanded :: Stretch StretchExtraExpanded :: Stretch StretchUltraExpanded :: Stretch -- | Define attributes for Underline. -- -- data Underline UnderlineNone :: Underline UnderlineSingle :: Underline UnderlineDouble :: Underline UnderlineLow :: Underline UnderlineError :: Underline -- | The PangoDirection type represents a direction in the Unicode -- bidirectional algorithm. -- -- data PangoDirection PangoDirectionLtr :: PangoDirection PangoDirectionRtl :: PangoDirection PangoDirectionWeakLtr :: PangoDirection PangoDirectionWeakRtl :: PangoDirection PangoDirectionNeutral :: PangoDirection -- | Attributes for PangoItems. -- -- data PangoAttribute -- | A hint as to what language this piece of text is written in. AttrLanguage :: Int -> Int -> Language -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paLang :: PangoAttribute -> Language -- | The font family, e.g. sans serif. AttrFamily :: Int -> Int -> String -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paFamily :: PangoAttribute -> String -- | The slant of the current font. AttrStyle :: Int -> Int -> FontStyle -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paStyle :: PangoAttribute -> FontStyle -- | Weight of font, e.g. WeightBold. AttrWeight :: Int -> Int -> Weight -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paWeight :: PangoAttribute -> Weight -- | VariantSmallCaps will display lower case letters as small upper -- case letters (if the font supports this). AttrVariant :: Int -> Int -> Variant -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paVariant :: PangoAttribute -> Variant -- | Stretch or condense the width of the letters. AttrStretch :: Int -> Int -> Stretch -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paStretch :: PangoAttribute -> Stretch -- | Specify the size of the font in points. AttrSize :: Int -> Int -> Double -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paSize :: PangoAttribute -> Double -- | Specify the size of the font in device units (pixels). -- -- AttrAbsSize :: Int -> Int -> Double -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paSize :: PangoAttribute -> Double -- | 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. AttrFontDescription :: Int -> Int -> FontDescription -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paFontDescription :: PangoAttribute -> FontDescription -- | Specify the foreground color. AttrForeground :: Int -> Int -> Color -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paColor :: PangoAttribute -> Color -- | Specify the background color. AttrBackground :: Int -> Int -> Color -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paColor :: PangoAttribute -> Color -- | Specify the kind of underline, e.g. UnderlineSingle. AttrUnderline :: Int -> Int -> Underline -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paUnderline :: PangoAttribute -> Underline -- | Specify the color of an underline. -- -- AttrUnderlineColor :: Int -> Int -> Color -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paColor :: PangoAttribute -> Color -- | Specify if this piece of text should have a line through it. AttrStrikethrough :: Int -> Int -> Bool -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paStrikethrough :: PangoAttribute -> Bool -- | Specify the color of the strike through line. -- -- AttrStrikethroughColor :: Int -> Int -> Color -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paColor :: PangoAttribute -> Color -- | Displace the text vertically. Positive values move the text upwards. AttrRise :: Int -> Int -> Double -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paRise :: PangoAttribute -> Double -- | Restrict the amount of what is drawn of the marked shapes. -- -- AttrShape :: Int -> Int -> PangoRectangle -> PangoRectangle -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paInk :: PangoAttribute -> PangoRectangle paLogical :: PangoAttribute -> PangoRectangle -- | Scale the font up (values greater than one) or shrink the font. AttrScale :: Int -> Int -> Double -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paScale :: PangoAttribute -> Double -- | Determine if a fall back font should be substituted if no matching -- font is available. AttrFallback :: Int -> Int -> Bool -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paFallback :: PangoAttribute -> Bool -- | Add extra space between graphemes of the text. -- -- AttrLetterSpacing :: Int -> Int -> Double -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paLetterSpacing :: PangoAttribute -> Double -- | 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. -- -- AttrGravity :: Int -> Int -> PangoGravity -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paGravity :: PangoAttribute -> PangoGravity -- | Set the way horizontal scripts behave in a vertical context. -- -- AttrGravityHint :: Int -> Int -> PangoGravityHint -> PangoAttribute paStart :: PangoAttribute -> Int paEnd :: PangoAttribute -> Int paGravityHint :: PangoAttribute -> PangoGravityHint -- | 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. data EllipsizeMode EllipsizeNone :: EllipsizeMode EllipsizeStart :: EllipsizeMode EllipsizeMiddle :: EllipsizeMode EllipsizeEnd :: EllipsizeMode -- | 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. -- -- data PangoGravity PangoGravitySouth :: PangoGravity PangoGravityEast :: PangoGravity PangoGravityNorth :: PangoGravity PangoGravityWest :: PangoGravity PangoGravityAuto :: PangoGravity -- | The PangoGravityHint defines how horizontal scripts should -- behave in a vertical context. -- -- data PangoGravityHint PangoGravityHintNatural :: PangoGravityHint PangoGravityHintStrong :: PangoGravityHint PangoGravityHintLine :: PangoGravityHint -- | Define a synonym for text with embedded markup commands. -- -- type Markup = String -- | An RFC-3066 language designator to choose scripts. data Language -- | Specifying no particular language. emptyLanguage :: Language -- | 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. -- -- languageFromString :: String -> IO Language instance Enum EllipsizeMode instance Eq EllipsizeMode instance Show FontMetrics instance Show Size -- | Fonts. The selection of an appropriate font to render text becomes a -- substantial task in the presence of Unicode where a single font does -- not cover the whole range of possible characters. Pango provides -- several concepts to find appropriate fonts and to query information -- about them: -- -- module Graphics.Rendering.Pango.Font -- | A possibly partial description of font(s). data FontDescription -- | Create a new font description. -- -- fontDescriptionNew :: IO FontDescription -- | Make a deep copy of a font description. fontDescriptionCopy :: FontDescription -> IO FontDescription -- | Set the font famliy. -- -- fontDescriptionSetFamily :: FontDescription -> String -> IO () -- | Get the font family. -- -- fontDescriptionGetFamily :: FontDescription -> IO (Maybe String) fontDescriptionSetStyle :: FontDescription -> FontStyle -> IO () -- | Get the style field. fontDescriptionGetStyle :: FontDescription -> IO (Maybe FontStyle) -- | Set the variant field. fontDescriptionSetVariant :: FontDescription -> Variant -> IO () -- | Get the variant field. fontDescriptionGetVariant :: FontDescription -> IO (Maybe Variant) -- | Set the weight field. fontDescriptionSetWeight :: FontDescription -> Weight -> IO () -- | Get the weight field. fontDescriptionGetWeight :: FontDescription -> IO (Maybe Weight) -- | Set the stretch field. fontDescriptionSetStretch :: FontDescription -> Stretch -> IO () -- | Get the stretch field. fontDescriptionGetStretch :: FontDescription -> IO (Maybe Stretch) -- | Set the size field. -- -- fontDescriptionSetSize :: FontDescription -> Double -> IO () -- | Get the size field. fontDescriptionGetSize :: FontDescription -> IO (Maybe Double) -- | Flags denoting which fields in a font description are set. data FontMask PangoFontMaskFamily :: FontMask PangoFontMaskStyle :: FontMask PangoFontMaskVariant :: FontMask PangoFontMaskWeight :: FontMask PangoFontMaskStretch :: FontMask PangoFontMaskSize :: FontMask PangoFontMaskGravity :: FontMask -- | Reset fields in a font description. fontDescriptionUnsetFields :: FontDescription -> [FontMask] -> IO () -- | Merge two font descriptions. -- -- fontDescriptionMerge :: FontDescription -> FontDescription -> Bool -> IO () -- | Determine which of two descriptions matches a given description -- better. -- -- fontDescriptionBetterMatch :: FontDescription -> FontDescription -> FontDescription -> Bool -- | Create a font description from a string. -- -- fontDescriptionFromString :: String -> IO FontDescription -- | Convert a font description to a string. -- -- fontDescriptionToString :: FontDescription -> IO String data FontMap class GObjectClass o => FontMapClass o -- | Ask for the different font families that a particular back-end -- supports. -- -- pangoFontMapListFamilies :: FontMap -> IO [FontFamily] data FontFamily class GObjectClass o => FontFamilyClass o -- | Ask if the given family contains monospace fonts. -- -- pangoFontFamilyIsMonospace :: FontFamily -> Bool -- | Ask for the faces contained in a particular family. -- -- pangoFontFamilyListFaces :: FontFamily -> IO [FontFace] data FontFace class GObjectClass o => FontFaceClass o -- | Ask for available sizes of this font face. -- -- pangoFontFaceListSizes :: FontFace -> IO (Maybe [Double]) -- | Ask for a description of this face. -- -- pangoFontFaceDescribe :: FontFace -> IO FontDescription data Font class GObjectClass o => FontClass o instance Show FontFace instance Show FontFamily -- | This module defines some helper functions for generating texts with -- embedded attributes. Note that there is no need to use these -- functions. In particular, if you set markup in labels that are subject -- to internationalization, it can be of advantage to write out the -- markup instead of using the functions in this module. -- -- In order to display a string that may contain markup characters, use -- escapeMarkup. -- -- When you write markup directly, you can make use of the following -- convenience tags: -- -- module Graphics.Rendering.Pango.Markup -- | Define a synonym for text with embedded markup commands. -- -- type Markup = String -- | These are all the attributes the markSpan function can express. data SpanAttribute -- | Choose a font by textual description. -- -- FontDescr :: String -> SpanAttribute -- | Specify the family of font to use. -- -- FontFamily :: String -> SpanAttribute -- | Change the size of the current font. -- -- FontSize :: Size -> SpanAttribute -- | Change the slant of the current font. FontStyle :: FontStyle -> SpanAttribute -- | Change the thickness of the current font. -- -- FontWeight :: Weight -> SpanAttribute -- | Choosing an alternative rendering for lower case letters. -- -- FontVariant :: Variant -> SpanAttribute -- | Choose a different width. -- -- FontStretch :: Stretch -> SpanAttribute -- | Foreground color. -- -- FontForeground :: String -> SpanAttribute -- | Background color. FontBackground :: String -> SpanAttribute -- | Specify underlining of text. FontUnderline :: Underline -> SpanAttribute -- | Specify a vertical displacement. -- -- FontRise :: Double -> SpanAttribute -- | Give a hint about the language to be displayed. -- -- FontLang :: Language -> SpanAttribute -- | Gravity of text, use for ratation. FontGravity :: PangoGravity -> SpanAttribute -- | Intensity of gravity. FontGravityHint :: PangoGravityHint -> SpanAttribute -- | Create the most generic span attribute. markSpan :: [SpanAttribute] -> String -> String -- | Parse the marked-up text (see Markup format) to create a -- plain-text string and an attribute list. -- -- parseMarkup :: Markup -> Char -> IO ([[PangoAttribute]], Char, String) instance Show SpanAttribute -- | Functions to run the rendering pipeline. -- -- module Graphics.Rendering.Pango.Rendering -- | A sequence of characters that are rendered with the same settings. -- -- data PangoItem -- | Turn a string into a sequence of glyphs. -- -- pangoItemize :: PangoContext -> String -> [PangoAttribute] -> IO [PangoItem] -- | Retrieve the metrics of the font that was chosen to break the given -- PangoItem. pangoItemGetFontMetrics :: PangoItem -> IO FontMetrics -- | Extract the font used for this PangoItem. pangoItemGetFont :: PangoItem -> IO Font -- | Extract the Language used for this PangoItem. pangoItemGetLanguage :: PangoItem -> IO Language -- | A sequence of glyphs for a chunk of a string. -- -- data GlyphItem -- | Turn a PangoItem into a GlyphItem. -- -- pangoShape :: PangoItem -> IO GlyphItem -- | Ask for bounding rectangles of this glyph sequence. -- -- glyphItemExtents :: GlyphItem -> IO (PangoRectangle, PangoRectangle) -- | Ask for bounding rectangles for a sub-range of a glyph sequence. -- -- glyphItemExtentsRange :: GlyphItem -> Int -> Int -> IO (PangoRectangle, PangoRectangle) -- | Get the horizontal position of a character. -- -- glyphItemIndexToX :: GlyphItem -> Int -> Bool -> IO Double -- | Get the character at the given horizontal position. -- -- glyphItemXToIndex :: GlyphItem -> Double -> IO (Int, Bool) -- | Retrieve the width of every character in a string. -- -- glyphItemGetLogicalWidths :: GlyphItem -> Maybe Bool -> IO [Double] -- | Split a GlyphItem at the given index. -- -- glyphItemSplit :: GlyphItem -> Int -> IO (GlyphItem, GlyphItem) -- | Functions to run the rendering pipeline. -- -- module Graphics.Rendering.Pango.Layout -- | Rectangles describing an area in Doubles. -- -- data PangoRectangle PangoRectangle :: Double -> Double -> Double -> Double -> PangoRectangle -- | A rendered paragraph. data PangoLayout -- | Create an empty Layout. layoutEmpty :: PangoContext -> IO PangoLayout -- | Create a new layout. layoutText :: PangoContext -> String -> IO PangoLayout -- | Create a copy of the Layout. layoutCopy :: PangoLayout -> IO PangoLayout -- | Retrieves the PangoContext from this layout. layoutGetContext :: PangoLayout -> IO PangoContext -- | Signal a PangoContext change. -- -- layoutContextChanged :: PangoLayout -> IO () -- | Set the string in the layout. layoutSetText :: PangoLayout -> String -> IO () -- | Retrieve the string in the layout. layoutGetText :: PangoLayout -> IO String -- | 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. layoutSetMarkup :: PangoLayout -> Markup -> IO String -- | Escape markup characters. -- -- escapeMarkup :: String -> String -- | Set the string in the layout. -- -- layoutSetMarkupWithAccel :: PangoLayout -> Markup -> IO (Char, String) -- | Set text attributes of the text in the layout. -- -- layoutSetAttributes :: PangoLayout -> [PangoAttribute] -> IO () -- | Gets the list of attributes of the layout, if any. -- -- layoutGetAttributes :: PangoLayout -> IO [[PangoAttribute]] -- | Set a specific font description for this layout. -- -- layoutSetFontDescription :: PangoLayout -> Maybe FontDescription -> IO () -- | Ask for the specifically set font description of this layout. -- -- layoutGetFontDescription :: PangoLayout -> IO (Maybe FontDescription) -- | Set the width of this paragraph. -- -- layoutSetWidth :: PangoLayout -> Maybe Double -> IO () -- | Gets the width of this paragraph. -- -- layoutGetWidth :: PangoLayout -> IO (Maybe Double) -- | Enumerates how a line can be wrapped. -- -- -- -- -- -- -- -- data LayoutWrapMode WrapWholeWords :: LayoutWrapMode WrapAnywhere :: LayoutWrapMode WrapPartialWords :: LayoutWrapMode -- | Set how this paragraph is wrapped. -- -- layoutSetWrap :: PangoLayout -> LayoutWrapMode -> IO () -- | Get the wrap mode for the layout. layoutGetWrap :: PangoLayout -> IO LayoutWrapMode -- | 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. data EllipsizeMode EllipsizeNone :: EllipsizeMode EllipsizeStart :: EllipsizeMode EllipsizeMiddle :: EllipsizeMode EllipsizeEnd :: EllipsizeMode -- | Set how long lines should be abbreviated. layoutSetEllipsize :: PangoLayout -> EllipsizeMode -> IO () -- | Get the ellipsize mode for this layout. layoutGetEllipsize :: PangoLayout -> IO EllipsizeMode -- | Set the indentation of this paragraph. -- -- layoutSetIndent :: PangoLayout -> Double -> IO () -- | Gets the indentation of this paragraph. -- -- layoutGetIndent :: PangoLayout -> IO Double -- | Set the spacing between lines of this paragraph. layoutSetSpacing :: PangoLayout -> Double -> IO () -- | Gets the spacing between the lines. layoutGetSpacing :: PangoLayout -> IO Double -- | Set if text should be streched to fit width. -- -- layoutSetJustify :: PangoLayout -> Bool -> IO () -- | Retrieve the justification flag. -- -- layoutGetJustify :: PangoLayout -> IO Bool -- | Set if the base text direction should be overridden. -- -- layoutSetAutoDir :: PangoLayout -> Bool -> IO () -- | Retrieve the auto direction flag. -- -- layoutGetAutoDir :: PangoLayout -> IO Bool -- | Enumerate to which side incomplete lines are flushed. data LayoutAlignment AlignLeft :: LayoutAlignment AlignCenter :: LayoutAlignment AlignRight :: LayoutAlignment -- | Set how this paragraph is aligned. -- -- layoutSetAlignment :: PangoLayout -> LayoutAlignment -> IO () -- | Get the alignment for the layout. layoutGetAlignment :: PangoLayout -> IO LayoutAlignment -- | Specify where the Tab stop appears relative to the text. -- -- data TabAlign -- | A Tab position. type TabPosition = (Double, TabAlign) -- | Set a list of Tab positoins. layoutSetTabs :: PangoLayout -> [TabPosition] -> IO () -- | Reset the original set of Tab positions. -- -- layoutResetTabs :: PangoLayout -> IO () -- | Retrieve the list of current Tab positions. -- -- layoutGetTabs :: PangoLayout -> IO (Maybe [TabPosition]) -- | Honor newlines or not. -- -- layoutSetSingleParagraphMode :: PangoLayout -> Bool -> IO () -- | Retrieve if newlines are honored. -- -- layoutGetSingleParagraphMode :: PangoLayout -> IO Bool -- | Converts a device unit to a character index. -- -- layoutXYToIndex :: PangoLayout -> Double -> Double -> IO (Bool, Int, Int) -- | Return the rectangle of the glyph at the given index. -- -- layoutIndexToPos :: PangoLayout -> Int -> IO PangoRectangle -- | Return a cursor position. -- -- layoutGetCursorPos :: PangoLayout -> Int -> IO (PangoRectangle, PangoRectangle) -- | A new cursor position. -- -- See layoutMoveCursorVisually. data CursorPos -- | The cursor should move to the previous paragraph. CursorPosPrevPara :: CursorPos -- | The sum of the indices is the new cursor position. CursorPos :: Int -> Int -> CursorPos -- | The cursor should advance to the next paragraph. CursorPosNextPara :: CursorPos -- | Move a cursor visually. -- -- layoutMoveCursorVisually :: PangoLayout -> Bool -> Int -> Bool -> IO CursorPos -- | 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. layoutGetExtents :: PangoLayout -> IO (PangoRectangle, PangoRectangle) -- | Compute the physical size of the layout. -- -- layoutGetPixelExtents :: PangoLayout -> IO (Rectangle, Rectangle) -- | Ask for the number of lines in this layout. layoutGetLineCount :: PangoLayout -> IO Int -- | Extract a single lines of the layout. -- -- layoutGetLine :: PangoLayout -> Int -> IO LayoutLine -- | Extract the lines of the layout. -- -- layoutGetLines :: PangoLayout -> IO [LayoutLine] -- | An iterator to examine a layout. data LayoutIter -- | Create an iterator to examine a layout. layoutGetIter :: PangoLayout -> IO LayoutIter -- | Move to the next GlyphItem. -- -- layoutIterNextItem :: LayoutIter -> IO Bool -- | Move to the next char. -- -- layoutIterNextChar :: LayoutIter -> IO Bool -- | Move to the next cluster. -- -- layoutIterNextCluster :: LayoutIter -> IO Bool -- | Move to the next line. -- -- layoutIterNextLine :: LayoutIter -> IO Bool -- | Check if the iterator is on the last line. -- -- layoutIterAtLastLine :: LayoutIter -> IO Bool -- | Get the character index. -- -- layoutIterGetIndex :: LayoutIter -> IO Int -- | Query the vertical position within the layout. -- -- layoutIterGetBaseline :: LayoutIter -> IO Double -- | Retrieve the current GlyphItem under the iterator. -- -- layoutIterGetItem :: LayoutIter -> IO (Maybe GlyphItem) -- | Extract the line under the iterator. layoutIterGetLine :: LayoutIter -> IO (Maybe LayoutLine) -- | Retrieve a rectangle surrounding a character. -- -- layoutIterGetCharExtents :: LayoutIter -> IO PangoRectangle -- | Compute the physical size of the cluster. -- -- layoutIterGetClusterExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle) -- | Compute the physical size of the run. -- -- layoutIterGetRunExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle) -- | Retrieve vertical extent of this line. -- -- layoutIterGetLineYRange :: LayoutIter -> IO (Double, Double) -- | Compute the physical size of the line. -- -- layoutIterGetLineExtents :: LayoutIter -> IO (PangoRectangle, PangoRectangle) -- | A single line in a PangoLayout. data LayoutLine -- | Compute the physical size of the line. -- -- layoutLineGetExtents :: LayoutLine -> IO (PangoRectangle, PangoRectangle) -- | Compute the physical size of the line. -- -- layoutLineGetPixelExtents :: LayoutLine -> IO (Rectangle, Rectangle) -- | Request the horizontal position of a character. layoutLineIndexToX :: LayoutLine -> Int -> Bool -> IO Double -- | Request the character index of a given horizontal position. -- -- layoutLineXToIndex :: LayoutLine -> Double -> IO (Bool, Int, Int) -- | Retrieve bounding boxes for a given piece of text contained in this -- LayoutLine. -- -- layoutLineGetXRanges :: LayoutLine -> Int -> Int -> IO [(Double, Double)] instance Enum LayoutWrapMode instance Enum LayoutAlignment instance Enum TabAlign -- | Pango specific functions to for redering with Cairo. -- -- Cairo is a graphics library that supports vector graphics and image -- compositing that can be used with Pango. The functions in this module -- provide ways of rendering text in Cairo using Pango. module Graphics.Rendering.Pango.Cairo -- | Retrieve the default FontMap that contains a list of available -- fonts. -- -- cairoFontMapGetDefault :: IO FontMap -- | Set the scaling factor between font size and Cairo units. -- -- cairoFontMapSetResolution :: FontMap -> Double -> IO () -- | Ask for the scaling factor between font size and Cairo units. -- -- cairoFontMapGetResolution :: FontMap -> IO Double -- | Create a PangoContext. -- -- cairoCreateContext :: Maybe FontMap -> IO PangoContext -- | Set the scaling factor of the PangoContext. -- -- cairoContextSetResolution :: PangoContext -> Double -> IO () -- | Ask for the scaling factor of the PangoContext. -- -- cairoContextGetResolution :: PangoContext -> IO Double -- | Set Cairo font options. -- -- cairoContextSetFontOptions :: PangoContext -> FontOptions -> IO () -- | Retrieve Cairo font options. cairoContextGetFontOptions :: PangoContext -> IO FontOptions -- | Sets the specified Color as the source color of the -- Render context. setSourceColor :: Color -> Render () -- | Update a PangoContext with respect to changes in a -- Render environment. -- -- updateContext :: PangoContext -> Render () -- | Create a PangoLayout within a Render context. -- -- createLayout :: String -> Render PangoLayout -- | Propagate changed to the Render context to a -- PangoLayout. -- -- updateLayout :: PangoLayout -> Render () -- | Draw a glyph string. -- -- showGlyphString :: GlyphItem -> Render () -- | Draw a LayoutLine. -- -- showLayoutLine :: LayoutLine -> Render () -- | Draw a PangoLayout. -- -- showLayout :: PangoLayout -> Render () -- | Add the extent of a glyph string to the current path. -- -- glyphStringPath :: GlyphItem -> Render () -- | Add the extent of a layout line to the current path. -- -- layoutLinePath :: LayoutLine -> Render () -- | Add the layout to the current path. -- -- layoutPath :: PangoLayout -> Render () -- | This module defines PangoContexts, 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). -- -- module Graphics.Rendering.Pango.Context data PangoContext class GObjectClass o => PangoContextClass o -- | Retrieve a list of all available font families. -- -- contextListFamilies :: PangoContext -> IO [FontFamily] -- | Query the metrics of the given font implied by the font description. contextGetMetrics :: PangoContext -> FontDescription -> Language -> IO FontMetrics -- | Set the default FontDescription of this context. contextSetFontDescription :: PangoContext -> FontDescription -> IO () -- | Get the current FontDescription of this context. contextGetFontDescription :: PangoContext -> IO FontDescription -- | An RFC-3066 language designator to choose scripts. data Language -- | Specifying no particular language. emptyLanguage :: Language -- | 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. -- -- languageFromString :: String -> IO Language -- | Set the default Language of this context. contextSetLanguage :: PangoContext -> Language -> IO () -- | Get the current Language of this context. contextGetLanguage :: PangoContext -> IO Language -- | Set the default text direction of this context. contextSetTextDir :: PangoContext -> PangoDirection -> IO () -- | Get the current text direction of this context. contextGetTextDir :: PangoContext -> IO PangoDirection -- | Set the text gravity of this context. If the given value is -- PangoGravityAuto then the gravity is derived from the current -- rotation matrix. contextSetTextGravity :: PangoContext -> PangoGravity -> IO () -- | Get the current text gravity of this context. contextGetTextGravity :: PangoContext -> IO PangoGravity -- | Set the text gravity hint of this context. contextSetTextGravityHint :: PangoContext -> PangoGravityHint -> IO () -- | Get the current text gravity of this context. contextGetTextGravityHint :: PangoContext -> IO PangoGravityHint -- | Gets the transformation matrix that will be applied when rendering -- with this context. -- -- contextGetMatrix :: PangoContext -> IO Matrix -- | 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. -- -- contextSetMatrix :: PangoContext -> Matrix -> IO () -- | 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: -- -- -- -- The integration of Pango with Cairo <http: 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). module Graphics.Rendering.Pango