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 |
A FontMetrics
structure holds the overall metric information
for a font (possibly restricted to a script). The fields of this
structure are private to implementations of a font backend. See
the documentation of the corresponding getters for documentation
of their meaning.
- newtype FontMetrics = FontMetrics (ManagedPtr FontMetrics)
- newZeroFontMetrics :: MonadIO m => m FontMetrics
- noFontMetrics :: Maybe FontMetrics
- data FontMetricsGetApproximateCharWidthMethodInfo
- fontMetricsGetApproximateCharWidth :: (HasCallStack, MonadIO m) => FontMetrics -> m Int32
- data FontMetricsGetApproximateDigitWidthMethodInfo
- fontMetricsGetApproximateDigitWidth :: (HasCallStack, MonadIO m) => FontMetrics -> m Int32
- data FontMetricsGetAscentMethodInfo
- fontMetricsGetAscent :: (HasCallStack, MonadIO m) => FontMetrics -> m Int32
- data FontMetricsGetDescentMethodInfo
- fontMetricsGetDescent :: (HasCallStack, MonadIO m) => FontMetrics -> m Int32
- data FontMetricsGetStrikethroughPositionMethodInfo
- fontMetricsGetStrikethroughPosition :: (HasCallStack, MonadIO m) => FontMetrics -> m Int32
- data FontMetricsGetStrikethroughThicknessMethodInfo
- fontMetricsGetStrikethroughThickness :: (HasCallStack, MonadIO m) => FontMetrics -> m Int32
- data FontMetricsGetUnderlinePositionMethodInfo
- fontMetricsGetUnderlinePosition :: (HasCallStack, MonadIO m) => FontMetrics -> m Int32
- data FontMetricsGetUnderlineThicknessMethodInfo
- fontMetricsGetUnderlineThickness :: (HasCallStack, MonadIO m) => FontMetrics -> m Int32
- fontMetricsNew :: (HasCallStack, MonadIO m) => m FontMetrics
- data FontMetricsRefMethodInfo
- fontMetricsRef :: (HasCallStack, MonadIO m) => FontMetrics -> m (Maybe FontMetrics)
- data FontMetricsUnrefMethodInfo
- fontMetricsUnref :: (HasCallStack, MonadIO m) => FontMetrics -> m ()
Exported types
newtype FontMetrics Source #
newZeroFontMetrics :: MonadIO m => m FontMetrics Source #
Construct a FontMetrics
struct initialized to zero.
Methods
getApproximateCharWidth
data FontMetricsGetApproximateCharWidthMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * FontMetricsGetApproximateCharWidthMethodInfo FontMetrics signature Source # | |
fontMetricsGetApproximateCharWidth Source #
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m Int32 | Returns: the character width, in Pango units. |
Gets the approximate character width for a font metrics structure. 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.
getApproximateDigitWidth
data FontMetricsGetApproximateDigitWidthMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * FontMetricsGetApproximateDigitWidthMethodInfo FontMetrics signature Source # | |
fontMetricsGetApproximateDigitWidth Source #
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m Int32 | Returns: the digit width, in Pango units. |
Gets the approximate digit width for a font metrics structure.
This is merely a representative value useful, for example, for
determining the initial size for a window. Actual digits in
text can be wider or narrower than this, though this value
is generally somewhat more accurate than the result of
fontMetricsGetApproximateCharWidth
for digits.
getAscent
data FontMetricsGetAscentMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * FontMetricsGetAscentMethodInfo FontMetrics signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m Int32 | Returns: the ascent, in Pango units. |
Gets the ascent from a font metrics structure. The 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.)
getDescent
data FontMetricsGetDescentMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * FontMetricsGetDescentMethodInfo FontMetrics signature Source # | |
fontMetricsGetDescent Source #
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m Int32 | Returns: the descent, in Pango units. |
Gets the descent from a font metrics structure. The 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.)
getStrikethroughPosition
data FontMetricsGetStrikethroughPositionMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * FontMetricsGetStrikethroughPositionMethodInfo FontMetrics signature Source # | |
fontMetricsGetStrikethroughPosition Source #
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m Int32 | Returns: the suggested strikethrough position, in Pango units. |
Gets the suggested position to draw the strikethrough. The value returned is the distance <emphasis>above</emphasis> the baseline of the top of the strikethrough.
Since: 1.6
getStrikethroughThickness
data FontMetricsGetStrikethroughThicknessMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * FontMetricsGetStrikethroughThicknessMethodInfo FontMetrics signature Source # | |
fontMetricsGetStrikethroughThickness Source #
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m Int32 | Returns: the suggested strikethrough thickness, in Pango units. |
Gets the suggested thickness to draw for the strikethrough.
Since: 1.6
getUnderlinePosition
data FontMetricsGetUnderlinePositionMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * FontMetricsGetUnderlinePositionMethodInfo FontMetrics signature Source # | |
fontMetricsGetUnderlinePosition Source #
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m Int32 | Returns: the suggested underline position, in Pango units. |
Gets the suggested position to draw the underline. The value returned is the distance <emphasis>above</emphasis> the baseline of the top of the underline. Since most fonts have underline positions beneath the baseline, this value is typically negative.
Since: 1.6
getUnderlineThickness
data FontMetricsGetUnderlineThicknessMethodInfo Source #
((~) * signature (m Int32), MonadIO m) => MethodInfo * FontMetricsGetUnderlineThicknessMethodInfo FontMetrics signature Source # | |
fontMetricsGetUnderlineThickness Source #
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m Int32 | Returns: the suggested underline thickness, in Pango units. |
Gets the suggested thickness to draw for the underline.
Since: 1.6
new
:: (HasCallStack, MonadIO m) | |
=> m FontMetrics | Returns: a newly-created |
Creates a new FontMetrics
structure. This is only for
internal use by Pango backends and there is no public way
to set the fields of the structure.
ref
data FontMetricsRefMethodInfo Source #
((~) * signature (m (Maybe FontMetrics)), MonadIO m) => MethodInfo * FontMetricsRefMethodInfo FontMetrics signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m (Maybe FontMetrics) | Returns: |
Increase the reference count of a font metrics structure by one.
unref
data FontMetricsUnrefMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * FontMetricsUnrefMethodInfo FontMetrics signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> FontMetrics |
|
-> m () |
Decrease the reference count of a font metrics structure by one. If the result is zero, frees the structure and any associated memory.