Portability | portable (depends on GHC) |
---|---|
Stability | provisional |
Maintainer | gtk2hs-users@lists.sourceforge.net |
Safe Haskell | None |
Enumerations for describing font characteristics.
- 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 FontMetrics = FontMetrics {}
- data Size
- = SizePoint Double
- | SizeUnreadable
- | SizeTiny
- | SizeSmall
- | SizeMedium
- | SizeLarge
- | SizeHuge
- | SizeGiant
- | SizeSmaller
- | SizeLarger
- data FontStyle
- data Weight
- data Variant
- data Stretch
- data Underline
- data PangoDirection
- data PangoAttribute
- = AttrLanguage { }
- | AttrFamily { }
- | AttrStyle { }
- | AttrWeight { }
- | AttrVariant { }
- | AttrStretch { }
- | AttrSize { }
- | AttrAbsSize { }
- | AttrFontDescription { }
- | AttrForeground { }
- | AttrBackground { }
- | AttrUnderline { }
- | AttrUnderlineColor { }
- | AttrStrikethrough { }
- | AttrStrikethroughColor { }
- | AttrRise { }
- | AttrShape {
- paStart :: Int
- paEnd :: Int
- paInk :: PangoRectangle
- paLogical :: PangoRectangle
- | AttrScale { }
- | AttrFallback { }
- | AttrLetterSpacing { }
- | AttrGravity { }
- | AttrGravityHint {
- paStart :: Int
- paEnd :: Int
- paGravityHint :: PangoGravityHint
- data EllipsizeMode
- data PangoGravity
- data PangoGravityHint
- type Markup = String
- data Language
- emptyLanguage :: Language
- languageFromString :: String -> IO Language
Documentation
Color
- Specifies a color with three integer values for red, green and blue. All values range from 0 (least intense) to 65535 (highest intensity).
Rectangle
- Specifies x, y, width and height
data PangoRectangle Source
Rectangles describing an area in Double
s.
- Specifies x, y, width and height
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
andapproximateDigitWidth
are available.
FontMetrics | |
|
Define attributes for FontSize
.
The style of a font.
-
StyleOblique
is a slanted font likeStyleItalic
, but in a roman style.
Define attributes for Weight
.
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.
Define how wide characters are.
Define attributes for Underline
.
- The squiggly underline for errors is only available in Gtk 2.4 and higher.
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 ofunicharDirection
andfindBaseDir
cannot bePangoDirectionWeakLtr
orPangoDirectionWeakRtl
, since every character is either neutral or has a strong direction; on the other handPangoDirectionNeutral
doesn't make sense to pass tolog2visGetEmbeddingLevels
.
data PangoAttribute Source
Attributes for PangoItem
s.
AttrLanguage | A hint as to what language this piece of text is written in. |
AttrFamily | The font family, e.g. |
AttrStyle | The slant of the current font. |
AttrWeight | Weight of font, e.g. |
AttrVariant |
|
AttrStretch | Stretch or condense the width of the letters. |
AttrSize | Specify the size of the font in points. |
AttrAbsSize | Specify the size of the font in device units (pixels).
|
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. |
| |
AttrForeground | Specify the foreground color. |
AttrBackground | Specify the background color. |
AttrUnderline | Specify the kind of underline, e.g. |
AttrUnderlineColor | Specify the color of an underline.
|
AttrStrikethrough | Specify if this piece of text should have a line through it. |
AttrStrikethroughColor | Specify the color of the strike through line.
|
AttrRise | Displace the text vertically. Positive values move the text upwards. |
AttrShape | Restrict the amount of what is drawn of the marked shapes.
|
| |
AttrScale | Scale the font up (values greater than one) or shrink the font. |
AttrFallback | Determine if a fall back font should be substituted if no matching font is available. |
AttrLetterSpacing | Add extra space between graphemes of the text.
|
AttrGravity | Sets the gravity field of a font description. The gravity field specifies
how the glyphs should be rotated. If gravity is
|
AttrGravityHint | Set the way horizontal scripts behave in a vertical context.
|
|
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.
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
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.
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.
emptyLanguage :: LanguageSource
Specifying no particular language.
languageFromString :: String -> IO LanguageSource
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 '-'.