pango-0.11.0: Binding to the Pango text rendering engine.ContentsIndex
Graphics.Rendering.Pango.Enums
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Description
Enumerations for describing font characteristics.
Synopsis
type Markup = String
type PangoUnit = Double
pangoScale :: Double
data Color = Color Word16 Word16 Word16
data Rectangle = Rectangle Int Int Int Int
data PangoRectangle = PangoRectangle Double Double Double Double
data Language
emptyLanguage :: Language
languageFromString :: String -> IO Language
data FontMetrics = FontMetrics {
ascent :: Double
descent :: Double
approximateCharWidth :: Double
approximateDigitWidth :: Double
underlineThickness :: Double
underlinePosition :: Double
strikethroughThickenss :: Double
strikethroughPosition :: Double
}
data Size
= SizePoint Double
| SizeUnreadable
| SizeTiny
| SizeSmall
| SizeMedium
| SizeLarge
| SizeHuge
| SizeGiant
| SizeSmaller
| SizeLarger
data FontStyle
= StyleNormal
| StyleOblique
| StyleItalic
data Weight
= WeightThin
| WeightUltralight
| WeightLight
| WeightBook
| WeightNormal
| WeightMedium
| WeightSemibold
| WeightBold
| WeightUltrabold
| WeightHeavy
| WeightUltraheavy
data Variant
= VariantNormal
| VariantSmallCaps
data Stretch
= StretchUltraCondensed
| StretchExtraCondensed
| StretchCondensed
| StretchSemiCondensed
| StretchNormal
| StretchSemiExpanded
| StretchExpanded
| StretchExtraExpanded
| StretchUltraExpanded
data Underline
= UnderlineNone
| UnderlineSingle
| UnderlineDouble
| UnderlineLow
| UnderlineError
data PangoDirection
= PangoDirectionLtr
| PangoDirectionRtl
| PangoDirectionWeakLtr
| PangoDirectionWeakRtl
| PangoDirectionNeutral
data PangoAttribute
= AttrLanguage {
paStart :: Int
paEnd :: Int
paLang :: Language
}
| AttrFamily {
paStart :: Int
paEnd :: Int
paFamily :: String
}
| 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 EllipsizeMode
= EllipsizeNone
| EllipsizeStart
| EllipsizeMiddle
| EllipsizeEnd
data PangoGravity
= PangoGravitySouth
| PangoGravityEast
| PangoGravityNorth
| PangoGravityWest
| PangoGravityAuto
data PangoGravityHint
= PangoGravityHintNatural
| PangoGravityHintStrong
| PangoGravityHintLine
Documentation
type Markup = String

Define a synonym for text with embedded markup commands.

  • Markup strings are just simple strings. But it's easier to tell if a method expects text with or without markup.
type PangoUnit = Double
pangoScale :: Double
data Color

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
show/hide Instances
data Rectangle

Rectangle

  • Specifies x, y, width and height
Constructors
Rectangle Int Int Int Int
show/hide Instances
data PangoRectangle

Rectangles describing an area in Doubles.

  • Specifies x, y, width and height
Constructors
PangoRectangle Double Double Double Double
show/hide Instances
data Language
An RFC-3066 language designator to choose scripts.
show/hide Instances
emptyLanguage :: Language
Specifying no particular language.
languageFromString :: String -> IO 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.

  • This function first canonicalizes the string by converting it to lowercase, mapping '_' to '-', and stripping all characters other than letters and '-'.
data FontMetrics

The characteristic measurements of a font.

Constructors
FontMetrics
ascent :: DoubleThe 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 :: DoubleThe 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 :: DoubleThe 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 :: DoubleThe 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 :: DoubleThe suggested thickness to draw an underline.
underlinePosition :: DoubleThe 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.
strikethroughThickenss :: DoubleThe suggested thickness to draw for the strikethrough.
strikethroughPosition :: DoubleThe suggested position to draw the strikethrough. The value returned is the distance above the baseline of the top of the strikethrough.
show/hide Instances
data Size
Define attributes for FontSize.
Constructors
SizePoint Double
SizeUnreadable
SizeTiny
SizeSmall
SizeMedium
SizeLarge
SizeHuge
SizeGiant
SizeSmaller
SizeLarger
show/hide Instances
data FontStyle

The style of a font.

Constructors
StyleNormal
StyleOblique
StyleItalic
show/hide Instances
data Weight
Define attributes for Weight.
Constructors
WeightThin
WeightUltralight
WeightLight
WeightBook
WeightNormal
WeightMedium
WeightSemibold
WeightBold
WeightUltrabold
WeightHeavy
WeightUltraheavy
show/hide Instances
data Variant
Constructors
VariantNormal
VariantSmallCaps
show/hide Instances
data Stretch
Define how wide characters are.
Constructors
StretchUltraCondensed
StretchExtraCondensed
StretchCondensed
StretchSemiCondensed
StretchNormal
StretchSemiExpanded
StretchExpanded
StretchExtraExpanded
StretchUltraExpanded
show/hide Instances
data Underline

Define attributes for Underline.

  • The squiggly underline for errors is only available in Gtk 2.4 and higher.
Constructors
UnderlineNone
UnderlineSingle
UnderlineDouble
UnderlineLow
UnderlineError
show/hide Instances
data PangoDirection

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 Graphics.UI.Gtk.Pango.Rendering.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
show/hide Instances
data PangoAttribute

Attributes for PangoItems.

  • A given attribute is applied from its start position paStart up, but not including the end position, paEnd.
Constructors
AttrLanguageA hint as to what language this piece of text is written in.
paStart :: Int
paEnd :: Int
paLang :: Language
AttrFamilyThe font family, e.g. sans serif.
paStart :: Int
paEnd :: Int
paFamily :: String
AttrStyleThe slant of the current font.
paStart :: Int
paEnd :: Int
paStyle :: FontStyle
AttrWeightWeight of font, e.g. WeightBold.
paStart :: Int
paEnd :: Int
paWeight :: Weight
AttrVariantVariantSmallCaps will display lower case letters as small upper case letters (if the font supports this).
paStart :: Int
paEnd :: Int
paVariant :: Variant
AttrStretchStretch or condense the width of the letters.
paStart :: Int
paEnd :: Int
paStretch :: Stretch
AttrSizeSpecify the size of the font in points.
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.
paStart :: Int
paEnd :: Int
paSize :: Double
AttrFontDescriptionSpecify 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.
paStart :: Int
paEnd :: Int
paFontDescription :: FontDescription
AttrForegroundSpecify the foreground color.
paStart :: Int
paEnd :: Int
paColor :: Color
AttrBackgroundSpecify the background color.
paStart :: Int
paEnd :: Int
paColor :: Color
AttrUnderlineSpecify the kind of underline, e.g. UnderlineSingle.
paStart :: Int
paEnd :: Int
paUnderline :: Underline
AttrUnderlineColor

Specify the color of an underline.

  • Available in Pango 1.8.0 and higher.
paStart :: Int
paEnd :: Int
paColor :: Color
AttrStrikethroughSpecify if this piece of text should have a line through it.
paStart :: Int
paEnd :: Int
paStrikethrough :: Bool
AttrStrikethroughColor

Specify the color of the strike through line.

  • Available in Pango 1.8.0 and higher.
paStart :: Int
paEnd :: Int
paColor :: Color
AttrRiseDisplace the text vertically. Positive values move the text upwards.
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.
paStart :: Int
paEnd :: Int
paInk :: PangoRectangle
paLogical :: PangoRectangle
AttrScaleScale the font up (values greater than one) or shrink the font.
paStart :: Int
paEnd :: Int
paScale :: Double
AttrFallbackDetermine if a fall back font should be substituted if no matching font is available.
paStart :: Int
paEnd :: Int
paFallback :: Bool
AttrLetterSpacing

Add extra space between graphemes of the text.

  • Available in Pango 1.6.0 and higher.
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.
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.
paStart :: Int
paEnd :: Int
paGravityHint :: PangoGravityHint
show/hide Instances
data EllipsizeMode
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
show/hide Instances
data PangoGravity

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
show/hide Instances
data PangoGravityHint

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
show/hide Instances
Produced by Haddock version 2.4.2