Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- betterMatch
- copy
- copyStatic
- equal
- free
- fromString
- getFamily
- getGravity
- getSetFields
- getSize
- getSizeIsAbsolute
- getStretch
- getStyle
- getVariant
- getWeight
- hash
- merge
- mergeStatic
- new
- setAbsoluteSize
- setFamily
- setFamilyStatic
- setGravity
- setSize
- setStretch
- setStyle
- setVariant
- setWeight
- toFilename
- toString
- unsetFields
The FontDescription
structure represents the description
of an ideal font. These structures are used both to list
what fonts are available on the system and also for specifying
the characteristics of a font to load.
- newtype FontDescription = FontDescription (ManagedPtr FontDescription)
- noFontDescription :: Maybe FontDescription
- data FontDescriptionBetterMatchMethodInfo
- fontDescriptionBetterMatch :: (HasCallStack, MonadIO m) => FontDescription -> Maybe FontDescription -> FontDescription -> m Bool
- data FontDescriptionCopyMethodInfo
- fontDescriptionCopy :: (HasCallStack, MonadIO m) => FontDescription -> m (Maybe FontDescription)
- data FontDescriptionCopyStaticMethodInfo
- fontDescriptionCopyStatic :: (HasCallStack, MonadIO m) => FontDescription -> m (Maybe FontDescription)
- data FontDescriptionEqualMethodInfo
- fontDescriptionEqual :: (HasCallStack, MonadIO m) => FontDescription -> FontDescription -> m Bool
- data FontDescriptionFreeMethodInfo
- fontDescriptionFree :: (HasCallStack, MonadIO m) => FontDescription -> m ()
- fontDescriptionFromString :: (HasCallStack, MonadIO m) => Text -> m FontDescription
- data FontDescriptionGetFamilyMethodInfo
- fontDescriptionGetFamily :: (HasCallStack, MonadIO m) => FontDescription -> m (Maybe Text)
- data FontDescriptionGetGravityMethodInfo
- fontDescriptionGetGravity :: (HasCallStack, MonadIO m) => FontDescription -> m Gravity
- data FontDescriptionGetSetFieldsMethodInfo
- fontDescriptionGetSetFields :: (HasCallStack, MonadIO m) => FontDescription -> m [FontMask]
- data FontDescriptionGetSizeMethodInfo
- fontDescriptionGetSize :: (HasCallStack, MonadIO m) => FontDescription -> m Int32
- data FontDescriptionGetSizeIsAbsoluteMethodInfo
- fontDescriptionGetSizeIsAbsolute :: (HasCallStack, MonadIO m) => FontDescription -> m Bool
- data FontDescriptionGetStretchMethodInfo
- fontDescriptionGetStretch :: (HasCallStack, MonadIO m) => FontDescription -> m Stretch
- data FontDescriptionGetStyleMethodInfo
- fontDescriptionGetStyle :: (HasCallStack, MonadIO m) => FontDescription -> m Style
- data FontDescriptionGetVariantMethodInfo
- fontDescriptionGetVariant :: (HasCallStack, MonadIO m) => FontDescription -> m Variant
- data FontDescriptionGetWeightMethodInfo
- fontDescriptionGetWeight :: (HasCallStack, MonadIO m) => FontDescription -> m Weight
- data FontDescriptionHashMethodInfo
- fontDescriptionHash :: (HasCallStack, MonadIO m) => FontDescription -> m Word32
- data FontDescriptionMergeMethodInfo
- fontDescriptionMerge :: (HasCallStack, MonadIO m) => FontDescription -> Maybe FontDescription -> Bool -> m ()
- data FontDescriptionMergeStaticMethodInfo
- fontDescriptionMergeStatic :: (HasCallStack, MonadIO m) => FontDescription -> FontDescription -> Bool -> m ()
- fontDescriptionNew :: (HasCallStack, MonadIO m) => m FontDescription
- data FontDescriptionSetAbsoluteSizeMethodInfo
- fontDescriptionSetAbsoluteSize :: (HasCallStack, MonadIO m) => FontDescription -> Double -> m ()
- data FontDescriptionSetFamilyMethodInfo
- fontDescriptionSetFamily :: (HasCallStack, MonadIO m) => FontDescription -> Text -> m ()
- data FontDescriptionSetFamilyStaticMethodInfo
- fontDescriptionSetFamilyStatic :: (HasCallStack, MonadIO m) => FontDescription -> Text -> m ()
- data FontDescriptionSetGravityMethodInfo
- fontDescriptionSetGravity :: (HasCallStack, MonadIO m) => FontDescription -> Gravity -> m ()
- data FontDescriptionSetSizeMethodInfo
- fontDescriptionSetSize :: (HasCallStack, MonadIO m) => FontDescription -> Int32 -> m ()
- data FontDescriptionSetStretchMethodInfo
- fontDescriptionSetStretch :: (HasCallStack, MonadIO m) => FontDescription -> Stretch -> m ()
- data FontDescriptionSetStyleMethodInfo
- fontDescriptionSetStyle :: (HasCallStack, MonadIO m) => FontDescription -> Style -> m ()
- data FontDescriptionSetVariantMethodInfo
- fontDescriptionSetVariant :: (HasCallStack, MonadIO m) => FontDescription -> Variant -> m ()
- data FontDescriptionSetWeightMethodInfo
- fontDescriptionSetWeight :: (HasCallStack, MonadIO m) => FontDescription -> Weight -> m ()
- data FontDescriptionToFilenameMethodInfo
- fontDescriptionToFilename :: (HasCallStack, MonadIO m) => FontDescription -> m Text
- data FontDescriptionToStringMethodInfo
- fontDescriptionToString :: (HasCallStack, MonadIO m) => FontDescription -> m Text
- data FontDescriptionUnsetFieldsMethodInfo
- fontDescriptionUnsetFields :: (HasCallStack, MonadIO m) => FontDescription -> [FontMask] -> m ()
Exported types
newtype FontDescription Source #
Methods
betterMatch
data FontDescriptionBetterMatchMethodInfo Source #
((~) * signature (Maybe FontDescription -> FontDescription -> m Bool), MonadIO m) => MethodInfo * FontDescriptionBetterMatchMethodInfo FontDescription signature Source # | |
fontDescriptionBetterMatch Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Maybe FontDescription |
|
-> FontDescription |
|
-> m Bool | Returns: |
Determines if the style attributes of newMatch
are a closer match
for desc
than those of oldMatch
are, or if oldMatch
is Nothing
,
determines if newMatch
is a match at all.
Approximate matching is done for
weight and style; other style attributes must match exactly.
Style attributes are all attributes other than family and size-related
attributes. Approximate matching for style considers PANGO_STYLE_OBLIQUE
and PANGO_STYLE_ITALIC as matches, but not as good a match as when the
styles are equal.
Note that oldMatch
must match desc
.
copy
data FontDescriptionCopyMethodInfo Source #
((~) * signature (m (Maybe FontDescription)), MonadIO m) => MethodInfo * FontDescriptionCopyMethodInfo FontDescription signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m (Maybe FontDescription) | Returns: the newly allocated
|
Make a copy of a FontDescription
.
copyStatic
data FontDescriptionCopyStaticMethodInfo Source #
((~) * signature (m (Maybe FontDescription)), MonadIO m) => MethodInfo * FontDescriptionCopyStaticMethodInfo FontDescription signature Source # | |
fontDescriptionCopyStatic Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m (Maybe FontDescription) | Returns: the newly allocated
|
Like fontDescriptionCopy
, but only a shallow copy is made
of the family name and other allocated fields. The result can only
be used until desc
is modified or freed. This is meant to be used
when the copy is only needed temporarily.
equal
data FontDescriptionEqualMethodInfo Source #
((~) * signature (FontDescription -> m Bool), MonadIO m) => MethodInfo * FontDescriptionEqualMethodInfo FontDescription signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> FontDescription |
|
-> m Bool | Returns: |
Compares two font descriptions for equality. Two font descriptions
are considered equal if the fonts they describe are provably identical.
This means that their masks do not have to match, as long as other fields
are all the same. (Two font descriptions may result in identical fonts
being loaded, but still compare False
.)
free
data FontDescriptionFreeMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * FontDescriptionFreeMethodInfo FontDescription signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m () |
Frees a font description.
fromString
fontDescriptionFromString Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m FontDescription | Returns: a new |
Creates a new font description from a string representation in the
form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a
comma separated list of families optionally terminated by a comma,
STYLE_OPTIONS is a whitespace separated list of words where each word
describes one of style, variant, weight, stretch, or gravity, and SIZE
is a decimal number (size in points) or optionally followed by the
unit modifier "px" for absolute size. Any one of the options may
be absent. If FAMILY-LIST is absent, then the family_name field of
the resulting font description will be initialized to Nothing
. If
STYLE-OPTIONS is missing, then all style options will be set to the
default values. If SIZE is missing, the size in the resulting font
description will be set to 0.
getFamily
data FontDescriptionGetFamilyMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m) => MethodInfo * FontDescriptionGetFamilyMethodInfo FontDescription signature Source # | |
fontDescriptionGetFamily Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m (Maybe Text) | Returns: the family name field for the font
description, or |
Gets the family name field of a font description. See
fontDescriptionSetFamily
.
getGravity
data FontDescriptionGetGravityMethodInfo Source #
((~) * signature (m Gravity), MonadIO m) => MethodInfo * FontDescriptionGetGravityMethodInfo FontDescription signature Source # | |
fontDescriptionGetGravity Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Gravity | Returns: the gravity field for the font description. Use
|
Gets the gravity field of a font description. See
fontDescriptionSetGravity
.
Since: 1.16
getSetFields
data FontDescriptionGetSetFieldsMethodInfo Source #
((~) * signature (m [FontMask]), MonadIO m) => MethodInfo * FontDescriptionGetSetFieldsMethodInfo FontDescription signature Source # | |
fontDescriptionGetSetFields Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m [FontMask] | Returns: a bitmask with bits set corresponding to the
fields in |
Determines which fields in a font description have been set.
getSize
data FontDescriptionGetSizeMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * FontDescriptionGetSizeMethodInfo FontDescription signature Source # | |
fontDescriptionGetSize Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Int32 | Returns: the size field for the font description in points or device units.
You must call |
Gets the size field of a font description.
See fontDescriptionSetSize
.
getSizeIsAbsolute
data FontDescriptionGetSizeIsAbsoluteMethodInfo Source #
((~) * signature (m Bool), MonadIO m) => MethodInfo * FontDescriptionGetSizeIsAbsoluteMethodInfo FontDescription signature Source # | |
fontDescriptionGetSizeIsAbsolute Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Bool | Returns: whether the size for the font description is in
points or device units. Use |
Determines whether the size of the font is in points (not absolute) or device units (absolute).
See fontDescriptionSetSize
and fontDescriptionSetAbsoluteSize
.
Since: 1.8
getStretch
data FontDescriptionGetStretchMethodInfo Source #
((~) * signature (m Stretch), MonadIO m) => MethodInfo * FontDescriptionGetStretchMethodInfo FontDescription signature Source # | |
fontDescriptionGetStretch Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Stretch | Returns: the stretch field for the font description. Use
|
Gets the stretch field of a font description.
See fontDescriptionSetStretch
.
getStyle
data FontDescriptionGetStyleMethodInfo Source #
((~) * signature (m Style), MonadIO m) => MethodInfo * FontDescriptionGetStyleMethodInfo FontDescription signature Source # | |
fontDescriptionGetStyle Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Style | Returns: the style field for the font description.
Use |
Gets the style field of a FontDescription
. See
fontDescriptionSetStyle
.
getVariant
data FontDescriptionGetVariantMethodInfo Source #
((~) * signature (m Variant), MonadIO m) => MethodInfo * FontDescriptionGetVariantMethodInfo FontDescription signature Source # | |
fontDescriptionGetVariant Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Variant | Returns: the variant field for the font description. Use
|
Gets the variant field of a FontDescription
. See
fontDescriptionSetVariant
.
getWeight
data FontDescriptionGetWeightMethodInfo Source #
((~) * signature (m Weight), MonadIO m) => MethodInfo * FontDescriptionGetWeightMethodInfo FontDescription signature Source # | |
fontDescriptionGetWeight Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Weight | Returns: the weight field for the font description. Use
|
Gets the weight field of a font description. See
fontDescriptionSetWeight
.
hash
data FontDescriptionHashMethodInfo Source #
((~) * signature (m Word32), MonadIO m) => MethodInfo * FontDescriptionHashMethodInfo FontDescription signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Word32 | Returns: the hash value. |
Computes a hash of a FontDescription
structure suitable
to be used, for example, as an argument to g_hash_table_new()
.
The hash value is independent of desc
->mask.
merge
data FontDescriptionMergeMethodInfo Source #
((~) * signature (Maybe FontDescription -> Bool -> m ()), MonadIO m) => MethodInfo * FontDescriptionMergeMethodInfo FontDescription signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Maybe FontDescription |
|
-> Bool |
|
-> m () |
mergeStatic
data FontDescriptionMergeStaticMethodInfo Source #
((~) * signature (FontDescription -> Bool -> m ()), MonadIO m) => MethodInfo * FontDescriptionMergeStaticMethodInfo FontDescription signature Source # | |
fontDescriptionMergeStatic Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> FontDescription |
|
-> Bool |
|
-> m () |
Like fontDescriptionMerge
, but only a shallow copy is made
of the family name and other allocated fields. desc
can only be
used until descToMerge
is modified or freed. This is meant
to be used when the merged font description is only needed temporarily.
new
:: (HasCallStack, MonadIO m) | |
=> m FontDescription | Returns: the newly allocated |
Creates a new font description structure with all fields unset.
setAbsoluteSize
data FontDescriptionSetAbsoluteSizeMethodInfo Source #
((~) * signature (Double -> m ()), MonadIO m) => MethodInfo * FontDescriptionSetAbsoluteSizeMethodInfo FontDescription signature Source # | |
fontDescriptionSetAbsoluteSize Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Double |
|
-> m () |
Sets the size field of a font description, in device units. This is mutually
exclusive with fontDescriptionSetSize
which sets the font size
in points.
Since: 1.8
setFamily
data FontDescriptionSetFamilyMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * FontDescriptionSetFamilyMethodInfo FontDescription signature Source # | |
fontDescriptionSetFamily Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Text |
|
-> m () |
Sets the family name field of a font description. The family
name represents a family of related font styles, and will
resolve to a particular FontFamily
. In some uses of
FontDescription
, it is also possible to use a comma
separated list of family names for this field.
setFamilyStatic
data FontDescriptionSetFamilyStaticMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m) => MethodInfo * FontDescriptionSetFamilyStaticMethodInfo FontDescription signature Source # | |
fontDescriptionSetFamilyStatic Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Text |
|
-> m () |
Like fontDescriptionSetFamily
, except that no
copy of family
is made. The caller must make sure that the
string passed in stays around until desc
has been freed
or the name is set again. This function can be used if
family
is a static string such as a C string literal, or
if desc
is only needed temporarily.
setGravity
data FontDescriptionSetGravityMethodInfo Source #
((~) * signature (Gravity -> m ()), MonadIO m) => MethodInfo * FontDescriptionSetGravityMethodInfo FontDescription signature Source # | |
fontDescriptionSetGravity Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Gravity |
|
-> m () |
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 Context
.
Since: 1.16
setSize
data FontDescriptionSetSizeMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m) => MethodInfo * FontDescriptionSetSizeMethodInfo FontDescription signature Source # | |
fontDescriptionSetSize Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Int32 |
|
-> m () |
Sets the size field of a font description in fractional points. This is mutually
exclusive with fontDescriptionSetAbsoluteSize
.
setStretch
data FontDescriptionSetStretchMethodInfo Source #
((~) * signature (Stretch -> m ()), MonadIO m) => MethodInfo * FontDescriptionSetStretchMethodInfo FontDescription signature Source # | |
fontDescriptionSetStretch Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Stretch |
|
-> m () |
Sets the stretch field of a font description. The stretch field specifies how narrow or wide the font should be.
setStyle
data FontDescriptionSetStyleMethodInfo Source #
((~) * signature (Style -> m ()), MonadIO m) => MethodInfo * FontDescriptionSetStyleMethodInfo FontDescription signature Source # | |
fontDescriptionSetStyle Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Style |
|
-> m () |
Sets the style field of a FontDescription
. The
Style
enumeration describes whether the font is slanted and
the manner in which it is slanted; it can be either
PANGO_STYLE_NORMAL
, PANGO_STYLE_ITALIC
, or PANGO_STYLE_OBLIQUE
.
Most fonts will either have a italic style or an oblique
style, but not both, and font matching in Pango will
match italic specifications with oblique fonts and vice-versa
if an exact match is not found.
setVariant
data FontDescriptionSetVariantMethodInfo Source #
((~) * signature (Variant -> m ()), MonadIO m) => MethodInfo * FontDescriptionSetVariantMethodInfo FontDescription signature Source # | |
fontDescriptionSetVariant Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Variant |
|
-> m () |
Sets the variant field of a font description. The Variant
can either be VariantNormal
or VariantSmallCaps
.
setWeight
data FontDescriptionSetWeightMethodInfo Source #
((~) * signature (Weight -> m ()), MonadIO m) => MethodInfo * FontDescriptionSetWeightMethodInfo FontDescription signature Source # | |
fontDescriptionSetWeight Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> Weight |
|
-> m () |
Sets the weight field of a font description. The weight field
specifies how bold or light the font should be. In addition
to the values of the Weight
enumeration, other intermediate
numeric values are possible.
toFilename
data FontDescriptionToFilenameMethodInfo Source #
((~) * signature (m Text), MonadIO m) => MethodInfo * FontDescriptionToFilenameMethodInfo FontDescription signature Source # | |
fontDescriptionToFilename Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Text | Returns: a new string that must be freed with |
Creates a filename representation of a font description. The
filename is identical to the result from calling
fontDescriptionToString
, but with underscores instead of
characters that are untypical in filenames, and in lower case only.
toString
data FontDescriptionToStringMethodInfo Source #
((~) * signature (m Text), MonadIO m) => MethodInfo * FontDescriptionToStringMethodInfo FontDescription signature Source # | |
fontDescriptionToString Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> m Text | Returns: a new string that must be freed with |
Creates a string representation of a font description. See
fontDescriptionFromString
for a description of the
format of the string representation. The family list in the
string description will only have a terminating comma if the
last word of the list is a valid style option.
unsetFields
data FontDescriptionUnsetFieldsMethodInfo Source #
((~) * signature ([FontMask] -> m ()), MonadIO m) => MethodInfo * FontDescriptionUnsetFieldsMethodInfo FontDescription signature Source # | |
fontDescriptionUnsetFields Source #
:: (HasCallStack, MonadIO m) | |
=> FontDescription |
|
-> [FontMask] |
|
-> m () |
Unsets some of the fields in a FontDescription
. The unset
fields will get back to their default values.