Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GI.Pango.Objects.Font
Description
A PangoFont
is used to represent a font in a
rendering-system-independent manner.
Synopsis
- newtype Font = Font (ManagedPtr Font)
- class (GObject o, IsDescendantOf Font o) => IsFont o
- toFont :: (MonadIO m, IsFont o) => o -> m Font
- fontDescribe :: (HasCallStack, MonadIO m, IsFont a) => a -> m FontDescription
- fontDescribeWithAbsoluteSize :: (HasCallStack, MonadIO m, IsFont a) => a -> m FontDescription
- fontDescriptionsFree :: (HasCallStack, MonadIO m) => Maybe [FontDescription] -> m ()
- fontGetCoverage :: (HasCallStack, MonadIO m, IsFont a) => a -> Language -> m Coverage
- fontGetFace :: (HasCallStack, MonadIO m, IsFont a) => a -> m FontFace
- fontGetFeatures :: (HasCallStack, MonadIO m, IsFont a) => a -> [FeatureT] -> Word32 -> m ([FeatureT], Word32)
- fontGetFontMap :: (HasCallStack, MonadIO m, IsFont a) => a -> m (Maybe FontMap)
- fontGetGlyphExtents :: (HasCallStack, MonadIO m, IsFont a) => a -> Word32 -> m (Rectangle, Rectangle)
- fontGetMetrics :: (HasCallStack, MonadIO m, IsFont a) => a -> Maybe Language -> m FontMetrics
- fontHasChar :: (HasCallStack, MonadIO m, IsFont a) => a -> Char -> m Bool
Exported types
Memory-managed wrapper type.
Instances
Eq Font Source # | |
GObject Font Source # | |
Defined in GI.Pango.Objects.Font | |
ManagedPtrNewtype Font Source # | |
Defined in GI.Pango.Objects.Font Methods toManagedPtr :: Font -> ManagedPtr Font | |
TypedObject Font Source # | |
Defined in GI.Pango.Objects.Font Methods glibType :: IO GType | |
HasParentTypes Font Source # | |
Defined in GI.Pango.Objects.Font | |
IsGValue (Maybe Font) Source # | Convert |
Defined in GI.Pango.Objects.Font Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Font -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Font) | |
type ParentTypes Font Source # | |
Defined in GI.Pango.Objects.Font type ParentTypes Font = '[Object] |
class (GObject o, IsDescendantOf Font o) => IsFont o Source #
Instances
(GObject o, IsDescendantOf Font o) => IsFont o Source # | |
Defined in GI.Pango.Objects.Font |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, describe, describeWithAbsoluteSize, forceFloating, freezeNotify, getv, hasChar, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getCoverage, getData, getFace, getFeatures, getFontMap, getGlyphExtents, getMetrics, getProperty, getQdata.
Setters
describe
Arguments
:: (HasCallStack, MonadIO m, IsFont a) | |
=> a |
|
-> m FontDescription | Returns: a newly-allocated |
Returns a description of the font, with font size set in points.
Use [methodpango
.Font.describe_with_absolute_size] if you want
the font size in device units.
describeWithAbsoluteSize
fontDescribeWithAbsoluteSize Source #
Arguments
:: (HasCallStack, MonadIO m, IsFont a) | |
=> a |
|
-> m FontDescription | Returns: a newly-allocated |
Returns a description of the font, with absolute font size set in device units.
Use [methodpango
.Font.describe] if you want the font size in points.
Since: 1.14
descriptionsFree
Arguments
:: (HasCallStack, MonadIO m) | |
=> Maybe [FontDescription] |
|
-> m () |
Frees an array of font descriptions.
getCoverage
Arguments
:: (HasCallStack, MonadIO m, IsFont a) | |
=> a |
|
-> Language |
|
-> m Coverage | Returns: a newly-allocated |
Computes the coverage map for a given font and language tag.
getFace
Arguments
:: (HasCallStack, MonadIO m, IsFont a) | |
=> a |
|
-> m FontFace | Returns: the |
Gets the PangoFontFace
to which font
belongs.
Since: 1.46
getFeatures
Arguments
:: (HasCallStack, MonadIO m, IsFont a) | |
=> a |
|
-> [FeatureT] |
|
-> Word32 |
|
-> m ([FeatureT], Word32) |
Obtain the OpenType features that are provided by the font.
These are passed to the rendering system, together with features that have been explicitly set via attributes.
Note that this does not include OpenType features which the rendering system enables by default.
Since: 1.44
getFontMap
Arguments
:: (HasCallStack, MonadIO m, IsFont a) | |
=> a |
|
-> m (Maybe FontMap) | Returns: the |
Gets the font map for which the font was created.
Note that the font maintains a *weak* reference to
the font map, so if all references to font map are
dropped, the font map will be finalized even if there
are fonts created with the font map that are still alive.
In that case this function will return Nothing
.
It is the responsibility of the user to ensure that the
font map is kept alive. In most uses this is not an issue
as a PangoContext
holds a reference to the font map.
Since: 1.10
getGlyphExtents
Arguments
:: (HasCallStack, MonadIO m, IsFont a) | |
=> a |
|
-> Word32 |
|
-> m (Rectangle, Rectangle) |
Gets the logical and ink extents of a glyph within a font.
The coordinate system for each rectangle has its origin at the
base line and horizontal origin of the character with increasing
coordinates extending to the right and down. The macros PANGO_ASCENT()
,
PANGO_DESCENT()
, PANGO_LBEARING()
, and PANGO_RBEARING()
can be used to convert
from the extents rectangle to more traditional font metrics. The units
of the rectangles are in 1/PANGO_SCALE of a device unit.
If font
is Nothing
, this function gracefully sets some sane values in the
output variables and returns.
getMetrics
Arguments
:: (HasCallStack, MonadIO m, IsFont a) | |
=> a |
|
-> Maybe Language |
|
-> m FontMetrics | Returns: a |
Gets overall metric information for a font.
Since the metrics may be substantially different for different scripts, a language tag can be provided to indicate that the metrics should be retrieved that correspond to the script(s) used by that language.
If font
is Nothing
, this function gracefully sets some sane values in the
output variables and returns.
hasChar
Arguments
:: (HasCallStack, MonadIO m, IsFont a) | |
=> a |
|
-> Char |
|
-> m Bool |
Returns whether the font provides a glyph for this character.
Returns True
if font
can render wc
Since: 1.44