|
Graphics.UI.Gtk.Pango.Description | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
Description |
Functions to manage font description.
- Font descriptions provide a way to query and state requirements of
fonts. This data structure has several fields describing different
characteristics of a font. Each of these fields can be set of left
unspecified.
|
|
Synopsis |
|
|
|
Documentation |
|
data FontDescription |
A possibly partial description of font(s).
|
|
|
fontDescriptionNew :: IO FontDescription |
Create a new font description.
|
|
fontDescriptionCopy :: FontDescription -> IO FontDescription |
Make a deep copy of a font description.
|
|
fontDescriptionSetFamily :: FontDescription -> String -> IO () |
Set the font famliy.
- A font family is a name designating the design of the font (e.g. Sans
or Times) without the variant.
- In some contexts a comma separated list of font families can be used.
|
|
fontDescriptionGetFamily :: FontDescription -> IO (Maybe String) |
Get the font family.
- Nothing is returned if the font family is not set.
|
|
fontDescriptionSetStyle :: FontDescription -> FontStyle -> IO () |
Set the style field.
- Most fonts will have either a StyleItalic or StyleQblique
but rarely both.
|
|
fontDescriptionGetStyle :: FontDescription -> IO (Maybe FontStyle) |
Get the style field.
|
|
fontDescriptionSetVariant :: FontDescription -> Variant -> IO () |
Set the variant field.
|
|
fontDescriptionGetVariant :: FontDescription -> IO (Maybe Variant) |
Get the variant field.
|
|
fontDescriptionSetWeight :: FontDescription -> Weight -> IO () |
Set the weight field.
|
|
fontDescriptionGetWeight :: FontDescription -> IO (Maybe Weight) |
Get the weight field.
|
|
fontDescriptionSetStretch :: FontDescription -> Stretch -> IO () |
Set the stretch field.
|
|
fontDescriptionGetStretch :: FontDescription -> IO (Maybe Stretch) |
Get the stretch field.
|
|
fontDescriptionSetSize :: FontDescription -> Rational -> IO () |
Set the size field.
- The given size is in points (pts). One point is 1/72 inch.
|
|
fontDescriptionGetSize :: FontDescription -> IO (Maybe Rational) |
Get the size field.
|
|
fontDescriptionUnsetFields :: FontDescription -> [FontMask] -> IO () |
Reset fields in a font description.
|
|
fontDescriptionMerge :: FontDescription -> FontDescription -> Bool -> IO () |
Merge two font descriptions.
- Copy fields from the second description to the first. If the boolean
parameter is set, existing fields in the first description will be
replaced.
|
|
fontDescriptionBetterMatch :: FontDescription -> FontDescription -> FontDescription -> Bool |
Determine which of two descriptions matches a given description better.
- Returns True if the last description is a better match to the first
arguement than the middle one.
- Approximate matching is done on weight and style. If the other
attributes do not match, the function returns False.
|
|
fontDescriptionFromString :: String -> IO FontDescription |
Create a font description from a string.
- The given argument must have the form
[FAMILY-LIST] [STYLE-OPTIONS] [SIZE] where FAMILY_LIST is a comma
separated list of font families optionally terminated by a comma,
STYLE_OPTIONS is a whitespace separated list of words where each
word describes one of style, variant, weight or stretch. SIZE is
a decimal number giving the size of the font in points. If any of
these fields is absent, the resulting FontDescription will have
the corresponing fields unset.
|
|
fontDescriptionToString :: FontDescription -> IO String |
Convert a font description to a string.
|
|
pangoScale :: Int |
Internal unit of measuring sizes.
- This constant represents the scale between
dimensions used for distances in text rendering and Pango device units.
The
definition of device unit is dependent on the output device; it will
typically be pixels for a screen, and points for a printer. When
setting font sizes, device units are always considered to be points
(as in "12 point font"), rather than pixels. For example, setting
the indentation of a paragraph lay to 10 pixels is done by calling
layoutSetIndent lay (10*pangoScale).
|
|
Produced by Haddock version 0.7 |