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 |
- Methods
- attrBackgroundAlphaNew
- attrBackgroundNew
- attrFallbackNew
- attrFamilyNew
- attrForegroundAlphaNew
- attrForegroundNew
- attrGravityHintNew
- attrGravityNew
- attrLetterSpacingNew
- attrRiseNew
- attrScaleNew
- attrStretchNew
- attrStrikethroughColorNew
- attrStrikethroughNew
- attrStyleNew
- attrUnderlineColorNew
- attrUnderlineNew
- attrVariantNew
- attrWeightNew
- break
- configKeyGet
- configKeyGetSystem
- defaultBreak
- extentsToPixels
- findBaseDir
- findParagraphBoundary
- getLibSubdirectory
- getLogAttrs
- getMirrorChar
- getSysconfSubdirectory
- isZeroWidth
- itemize
- itemizeWithBaseDir
- log2visGetEmbeddingLevels
- lookupAliases
- markupParserFinish
- markupParserNew
- moduleRegister
- parseEnum
- parseMarkup
- quantizeLineGeometry
- readLine
- reorderItems
- scanInt
- scanString
- scanWord
- shape
- shapeFull
- skipSpace
- splitFileList
- trimString
- unicharDirection
- unitsFromDouble
- unitsToDouble
- version
- versionCheck
- versionString
Synopsis
- attrBackgroundAlphaNew :: (HasCallStack, MonadIO m) => Word16 -> m Attribute
- attrBackgroundNew :: (HasCallStack, MonadIO m) => Word16 -> Word16 -> Word16 -> m Attribute
- attrFallbackNew :: (HasCallStack, MonadIO m) => Bool -> m Attribute
- attrFamilyNew :: (HasCallStack, MonadIO m) => Text -> m Attribute
- attrForegroundAlphaNew :: (HasCallStack, MonadIO m) => Word16 -> m Attribute
- attrForegroundNew :: (HasCallStack, MonadIO m) => Word16 -> Word16 -> Word16 -> m Attribute
- attrGravityHintNew :: (HasCallStack, MonadIO m) => GravityHint -> m Attribute
- attrGravityNew :: (HasCallStack, MonadIO m) => Gravity -> m Attribute
- attrLetterSpacingNew :: (HasCallStack, MonadIO m) => Int32 -> m Attribute
- attrRiseNew :: (HasCallStack, MonadIO m) => Int32 -> m Attribute
- attrScaleNew :: (HasCallStack, MonadIO m) => Double -> m Attribute
- attrStretchNew :: (HasCallStack, MonadIO m) => Stretch -> m Attribute
- attrStrikethroughColorNew :: (HasCallStack, MonadIO m) => Word16 -> Word16 -> Word16 -> m Attribute
- attrStrikethroughNew :: (HasCallStack, MonadIO m) => Bool -> m Attribute
- attrStyleNew :: (HasCallStack, MonadIO m) => Style -> m Attribute
- attrUnderlineColorNew :: (HasCallStack, MonadIO m) => Word16 -> Word16 -> Word16 -> m Attribute
- attrUnderlineNew :: (HasCallStack, MonadIO m) => Underline -> m Attribute
- attrVariantNew :: (HasCallStack, MonadIO m) => Variant -> m Attribute
- attrWeightNew :: (HasCallStack, MonadIO m) => Weight -> m Attribute
- break :: (HasCallStack, MonadIO m) => Text -> Int32 -> Analysis -> [LogAttr] -> m ()
- configKeyGet :: (HasCallStack, MonadIO m) => Text -> m Text
- configKeyGetSystem :: (HasCallStack, MonadIO m) => Text -> m Text
- defaultBreak :: (HasCallStack, MonadIO m) => Text -> Int32 -> Maybe Analysis -> LogAttr -> Int32 -> m ()
- extentsToPixels :: (HasCallStack, MonadIO m) => Maybe Rectangle -> Maybe Rectangle -> m ()
- findBaseDir :: (HasCallStack, MonadIO m) => Text -> Int32 -> m Direction
- findParagraphBoundary :: (HasCallStack, MonadIO m) => Text -> Int32 -> m (Int32, Int32)
- getLibSubdirectory :: (HasCallStack, MonadIO m) => m Text
- getLogAttrs :: (HasCallStack, MonadIO m) => Text -> Int32 -> Int32 -> Language -> [LogAttr] -> m ()
- getMirrorChar :: (HasCallStack, MonadIO m) => Char -> Char -> m Bool
- getSysconfSubdirectory :: (HasCallStack, MonadIO m) => m Text
- isZeroWidth :: (HasCallStack, MonadIO m) => Char -> m Bool
- itemize :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> Int32 -> Int32 -> AttrList -> Maybe AttrIterator -> m [Item]
- itemizeWithBaseDir :: (HasCallStack, MonadIO m, IsContext a) => a -> Direction -> Text -> Int32 -> Int32 -> AttrList -> Maybe AttrIterator -> m [Item]
- log2visGetEmbeddingLevels :: (HasCallStack, MonadIO m) => Text -> Int32 -> Direction -> m Word8
- lookupAliases :: (HasCallStack, MonadIO m) => Text -> m [Text]
- markupParserFinish :: (HasCallStack, MonadIO m) => MarkupParseContext -> m (AttrList, Text, Char)
- markupParserNew :: (HasCallStack, MonadIO m) => Char -> m MarkupParseContext
- moduleRegister :: (HasCallStack, MonadIO m) => IncludedModule -> m ()
- parseEnum :: (HasCallStack, MonadIO m) => GType -> Maybe Text -> Bool -> m (Bool, Int32, Text)
- parseMarkup :: (HasCallStack, MonadIO m) => Text -> Int32 -> Char -> m (AttrList, Text, Char)
- quantizeLineGeometry :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> m (Int32, Int32)
- readLine :: (HasCallStack, MonadIO m) => Ptr () -> m (Int32, String)
- reorderItems :: (HasCallStack, MonadIO m) => [Item] -> m [Item]
- scanInt :: (HasCallStack, MonadIO m) => Text -> m (Bool, Text, Int32)
- scanString :: (HasCallStack, MonadIO m) => Text -> m (Bool, Text, String)
- scanWord :: (HasCallStack, MonadIO m) => Text -> m (Bool, Text, String)
- shape :: (HasCallStack, MonadIO m) => Text -> Int32 -> Analysis -> GlyphString -> m ()
- shapeFull :: (HasCallStack, MonadIO m) => Text -> Int32 -> Maybe Text -> Int32 -> Analysis -> GlyphString -> m ()
- skipSpace :: (HasCallStack, MonadIO m) => Text -> m (Bool, Text)
- splitFileList :: (HasCallStack, MonadIO m) => Text -> m [Text]
- trimString :: (HasCallStack, MonadIO m) => Text -> m Text
- unicharDirection :: (HasCallStack, MonadIO m) => Char -> m Direction
- unitsFromDouble :: (HasCallStack, MonadIO m) => Double -> m Int32
- unitsToDouble :: (HasCallStack, MonadIO m) => Int32 -> m Double
- version :: (HasCallStack, MonadIO m) => m Int32
- versionCheck :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> Int32 -> m (Maybe Text)
- versionString :: (HasCallStack, MonadIO m) => m Text
Methods
attrBackgroundAlphaNew
attrBackgroundAlphaNew Source #
:: (HasCallStack, MonadIO m) | |
=> Word16 |
|
-> m Attribute | Returns: the new allocated |
Create a new background alpha attribute.
Since: 1.38
attrBackgroundNew
:: (HasCallStack, MonadIO m) | |
=> Word16 |
|
-> Word16 |
|
-> Word16 |
|
-> m Attribute | Returns: the newly allocated |
Create a new background color attribute.
attrFallbackNew
:: (HasCallStack, MonadIO m) | |
=> Bool |
|
-> m Attribute | Returns: the newly allocated |
Create a new font fallback attribute.
If fallback is disabled, characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text.
Since: 1.4
attrFamilyNew
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Attribute | Returns: the newly allocated |
Create a new font family attribute.
attrForegroundAlphaNew
attrForegroundAlphaNew Source #
:: (HasCallStack, MonadIO m) | |
=> Word16 |
|
-> m Attribute | Returns: the new allocated |
Create a new foreground alpha attribute.
Since: 1.38
attrForegroundNew
:: (HasCallStack, MonadIO m) | |
=> Word16 |
|
-> Word16 |
|
-> Word16 |
|
-> m Attribute | Returns: the newly allocated |
Create a new foreground color attribute.
attrGravityHintNew
:: (HasCallStack, MonadIO m) | |
=> GravityHint |
|
-> m Attribute | Returns: the newly allocated |
Create a new gravity hint attribute.
Since: 1.16
attrGravityNew
:: (HasCallStack, MonadIO m) | |
=> Gravity |
|
-> m Attribute | Returns: the newly allocated |
Create a new gravity attribute.
Since: 1.16
attrLetterSpacingNew
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> m Attribute | Returns: the newly allocated |
Create a new letter-spacing attribute.
Since: 1.6
attrRiseNew
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> m Attribute | Returns: the newly allocated |
Create a new baseline displacement attribute.
attrScaleNew
:: (HasCallStack, MonadIO m) | |
=> Double |
|
-> m Attribute | Returns: the newly allocated |
Create a new font size scale attribute. The base font for the
affected text will have its size multiplied by scaleFactor
.
attrStretchNew
:: (HasCallStack, MonadIO m) | |
=> Stretch |
|
-> m Attribute | Returns: the newly allocated |
Create a new font stretch attribute
attrStrikethroughColorNew
attrStrikethroughColorNew Source #
:: (HasCallStack, MonadIO m) | |
=> Word16 |
|
-> Word16 |
|
-> Word16 |
|
-> m Attribute | Returns: the newly allocated |
Create a new strikethrough color attribute. This attribute modifies the color of strikethrough lines. If not set, strikethrough lines will use the foreground color.
Since: 1.8
attrStrikethroughNew
:: (HasCallStack, MonadIO m) | |
=> Bool |
|
-> m Attribute | Returns: the newly allocated |
Create a new strike-through attribute.
attrStyleNew
:: (HasCallStack, MonadIO m) | |
=> Style |
|
-> m Attribute | Returns: the newly allocated |
Create a new font slant style attribute.
attrUnderlineColorNew
attrUnderlineColorNew Source #
:: (HasCallStack, MonadIO m) | |
=> Word16 |
|
-> Word16 |
|
-> Word16 |
|
-> m Attribute | Returns: the newly allocated |
Create a new underline color attribute. This attribute modifies the color of underlines. If not set, underlines will use the foreground color.
Since: 1.8
attrUnderlineNew
:: (HasCallStack, MonadIO m) | |
=> Underline |
|
-> m Attribute | Returns: the newly allocated |
Create a new underline-style attribute.
attrVariantNew
:: (HasCallStack, MonadIO m) | |
=> Variant |
|
-> m Attribute | Returns: the newly allocated |
Create a new font variant attribute (normal or small caps)
attrWeightNew
:: (HasCallStack, MonadIO m) | |
=> Weight |
|
-> m Attribute | Returns: the newly allocated |
Create a new font weight attribute.
break
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> Analysis | |
-> [LogAttr] |
|
-> m () |
Determines possible line, word, and character breaks
for a string of Unicode text with a single analysis. For most
purposes you may want to use getLogAttrs
.
configKeyGet
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Text | Returns: |
Deprecated: (Since version 1.38)
Do not use. Does not do anything.
configKeyGetSystem
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Text | Returns: |
Deprecated: (Since version 1.38)
Do not use. Does not do anything.
defaultBreak
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> Maybe Analysis |
|
-> LogAttr |
|
-> Int32 |
|
-> m () |
This is the default break algorithm, used if no language
engine overrides it. Normally you should use break
instead. Unlike break
,
analysis
can be Nothing
, but only do that if you know what
you're doing. If you need an analysis to pass to break
,
you need to itemize
. In most cases however you should
simply use getLogAttrs
.
extentsToPixels
:: (HasCallStack, MonadIO m) | |
=> Maybe Rectangle |
|
-> Maybe Rectangle |
|
-> m () |
Converts extents from Pango units to device units, dividing by the
SCALE
factor and performing rounding.
The inclusive
rectangle is converted by flooring the x/y coordinates and extending
width/height, such that the final rectangle completely includes the original
rectangle.
The nearest
rectangle is converted by rounding the coordinates
of the rectangle to the nearest device unit (pixel).
The rule to which argument to use is: if you want the resulting device-space
rectangle to completely contain the original rectangle, pass it in as inclusive
.
If you want two touching-but-not-overlapping rectangles stay
touching-but-not-overlapping after rounding to device units, pass them in
as nearest
.
Since: 1.16
findBaseDir
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> m Direction | Returns: The direction corresponding to the first strong character.
If no such character is found, then |
Searches a string the first character that has a strong direction, according to the Unicode bidirectional algorithm.
Since: 1.4
findParagraphBoundary
findParagraphBoundary Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> m (Int32, Int32) |
Locates a paragraph boundary in text
. A boundary is caused by
delimiter characters, such as a newline, carriage return, carriage
return-newline pair, or Unicode paragraph separator character. The
index of the run of delimiters is returned in
paragraphDelimiterIndex
. The index of the start of the paragraph
(index after all delimiters) is stored in nextParagraphStart
.
If no delimiters are found, both paragraphDelimiterIndex
and
nextParagraphStart
are filled with the length of text
(an index one
off the end).
getLibSubdirectory
:: (HasCallStack, MonadIO m) | |
=> m Text | Returns: the Pango lib directory. The returned string should not be freed. |
Deprecated: (Since version 1.38)
Returns the name of the "pango" subdirectory of LIBDIR (which is set at compile time).
getLogAttrs
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> Int32 |
|
-> Language |
|
-> [LogAttr] |
|
-> m () |
Computes a LogAttr
for each character in text
. The logAttrs
array must have one LogAttr
for each position in text
; if
text
contains N characters, it has N+1 positions, including the
last position at the end of the text. text
should be an entire
paragraph; logical attributes can't be computed without context
(for example you need to see spaces on either side of a word to know
the word is a word).
getMirrorChar
:: (HasCallStack, MonadIO m) | |
=> Char |
|
-> Char |
|
-> m Bool | Returns: |
If ch
has the Unicode mirrored property and there is another Unicode
character that typically has a glyph that is the mirror image of ch
's
glyph, puts that character in the address pointed to by mirroredCh
.
Use unicharGetMirrorChar
instead; the docs for that function
provide full details.
getSysconfSubdirectory
getSysconfSubdirectory Source #
:: (HasCallStack, MonadIO m) | |
=> m Text | Returns: the Pango sysconf directory. The returned string should not be freed. |
Deprecated: (Since version 1.38)
Returns the name of the "pango" subdirectory of SYSCONFDIR (which is set at compile time).
isZeroWidth
:: (HasCallStack, MonadIO m) | |
=> Char |
|
-> m Bool | Returns: |
Checks ch
to see if it is a character that should not be
normally rendered on the screen. This includes all Unicode characters
with "ZERO WIDTH" in their name, as well as <firstterm>bidi</firstterm> formatting characters, and
a few other ones. This is totally different from unicharIszerowidth
and is at best misnamed.
Since: 1.10
itemize
:: (HasCallStack, MonadIO m, IsContext a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> Int32 |
|
-> AttrList |
|
-> Maybe AttrIterator |
|
-> m [Item] | Returns: a |
Breaks a piece of text into segments with consistent
directional level and shaping engine. Each byte of text
will
be contained in exactly one of the items in the returned list;
the generated list of items will be in logical order (the start
offsets of the items are ascending).
cachedIter
should be an iterator over attrs
currently positioned at a
range before or containing startIndex
; cachedIter
will be advanced to
the range covering the position just after startIndex
+ length
.
(i.e. if itemizing in a loop, just keep passing in the same cachedIter
).
itemizeWithBaseDir
:: (HasCallStack, MonadIO m, IsContext a) | |
=> a |
|
-> Direction |
|
-> Text |
|
-> Int32 |
|
-> Int32 |
|
-> AttrList |
|
-> Maybe AttrIterator |
|
-> m [Item] | Returns: a |
log2visGetEmbeddingLevels
log2visGetEmbeddingLevels Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> Direction |
|
-> m Word8 | Returns: a newly allocated array of embedding levels, one item per character (not byte), that should be freed using g_free. |
This will return the bidirectional embedding levels of the input paragraph as defined by the Unicode Bidirectional Algorithm available at:
http://www.unicode.org/reports/tr9/
If the input base direction is a weak direction, the direction of the characters in the text will determine the final resolved direction.
Since: 1.4
lookupAliases
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m [Text] |
Deprecated: (Since version 1.32)This function is not thread-safe.
Look up all user defined aliases for the alias fontname
.
The resulting font family names will be stored in families
,
and the number of families in nFamilies
.
markupParserFinish
:: (HasCallStack, MonadIO m) | |
=> MarkupParseContext |
|
-> m (AttrList, Text, Char) | (Can throw |
After feeding a pango markup parser some data with markupParseContextParse
,
use this function to get the list of pango attributes and text out of the
markup. This function will not free context
, use markupParseContextFree
to do so.
Since: 1.31.0
markupParserNew
:: (HasCallStack, MonadIO m) | |
=> Char |
|
-> m MarkupParseContext | Returns: a |
Parses marked-up text (see <link linkend="PangoMarkupFormat">markup format</link>) to create a plain-text string and an attribute list.
If accelMarker
is nonzero, the given character will mark the
character following it as an accelerator. For example, accelMarker
might be an ampersand or underscore. All characters marked
as an accelerator will receive a UnderlineLow
attribute,
and the first character so marked will be returned in accelChar
,
when calling finish()
. Two accelMarker
characters following each
other produce a single literal accelMarker
character.
To feed markup to the parser, use markupParseContextParse
on the returned MarkupParseContext
. When done with feeding markup
to the parser, use markupParserFinish
to get the data out
of it, and then use markupParseContextFree
to free it.
This function is designed for applications that read pango markup
from streams. To simply parse a string containing pango markup,
the simpler parseMarkup
API is recommended instead.
Since: 1.31.0
moduleRegister
:: (HasCallStack, MonadIO m) | |
=> IncludedModule |
|
-> m () |
Deprecated: (Since version 1.38)
Do not use. Does not do anything.
parseEnum
:: (HasCallStack, MonadIO m) | |
=> GType |
|
-> Maybe Text |
|
-> Bool |
|
-> m (Bool, Int32, Text) | Returns: |
Deprecated: (Since version 1.38)
Parses an enum type and stores the result in value
.
If str
does not match the nick name of any of the possible values for the
enum and is not an integer, False
is returned, a warning is issued
if warn
is True
, and a
string representing the list of possible values is stored in
possibleValues
. The list is slash-separated, eg.
"none/start/middle/end". If failed and possibleValues
is not Nothing
,
returned string should be freed using free
.
Since: 1.16
parseMarkup
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> Char |
|
-> m (AttrList, Text, Char) | (Can throw |
Parses marked-up text (see <link linkend="PangoMarkupFormat">markup format</link>) to create a plain-text string and an attribute list.
If accelMarker
is nonzero, the given character will mark the
character following it as an accelerator. For example, accelMarker
might be an ampersand or underscore. All characters marked
as an accelerator will receive a UnderlineLow
attribute,
and the first character so marked will be returned in accelChar
.
Two accelMarker
characters following each other produce a single
literal accelMarker
character.
To parse a stream of pango markup incrementally, use markupParserNew
.
If any error happens, none of the output arguments are touched except
for error
.
quantizeLineGeometry
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> m (Int32, Int32) |
Quantizes the thickness and position of a line, typically an
underline or strikethrough, to whole device pixels, that is integer
multiples of SCALE
. The purpose of this function is to avoid
such lines looking blurry.
Care is taken to make sure thickness
is at least one pixel when this
function returns, but returned position
may become zero as a result
of rounding.
Since: 1.12
readLine
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m (Int32, String) | Returns: 0 if the stream was already at an |
Deprecated: (Since version 1.38)
Reads an entire line from a file into a buffer. Lines may be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter is not written into the buffer. Text after a '#' character is treated as a comment and skipped. '\' can be used to escape a # character. '\' proceeding a line delimiter combines adjacent lines. A '\' proceeding any other character is ignored and written into the output buffer unmodified.
reorderItems
:: (HasCallStack, MonadIO m) | |
=> [Item] | |
-> m [Item] | Returns: a (Please open a bug if you use this function. It is not a particularly convenient interface, and the code is duplicated elsewhere in Pango for that reason.) |
From a list of items in logical order and the associated directional levels, produce a list in visual order. The original list is unmodified.
scanInt
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Bool, Text, Int32) | Returns: |
Deprecated: (Since version 1.38)
Scans an integer. Leading white space is skipped.
scanString
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Bool, Text, String) | Returns: |
Deprecated: (Since version 1.38)
Scans a string into a String
buffer. The string may either
be a sequence of non-white-space characters, or a quoted
string with '"'. Instead a quoted string, '\"' represents
a literal quote. Leading white space outside of quotes is skipped.
scanWord
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Bool, Text, String) | Returns: |
Deprecated: (Since version 1.38)
Scans a word into a String
buffer. A word consists
of [A-Za-z_] followed by zero or more [A-Za-z_0-9]
Leading white space is skipped.
shape
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> Analysis | |
-> GlyphString |
|
-> m () |
Given a segment of text and the corresponding
Analysis
structure returned from itemize
,
convert the characters into glyphs. You may also pass
in only a substring of the item from itemize
.
It is recommended that you use shapeFull
instead, since
that API allows for shaping interaction happening across text item
boundaries.
shapeFull
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> Maybe Text |
|
-> Int32 |
|
-> Analysis | |
-> GlyphString |
|
-> m () |
Given a segment of text and the corresponding
Analysis
structure returned from itemize
,
convert the characters into glyphs. You may also pass
in only a substring of the item from itemize
.
This is similar to shape
, except it also can optionally take
the full paragraph text as input, which will then be used to perform
certain cross-item shaping interactions. If you have access to the broader
text of which itemText
is part of, provide the broader text as
paragraphText
. If paragraphText
is Nothing
, item text is used instead.
Since: 1.32
skipSpace
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Bool, Text) | Returns: |
Deprecated: (Since version 1.38)
Skips 0 or more characters of white space.
splitFileList
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m [Text] | Returns: a list of
strings to be freed with |
Deprecated: (Since version 1.38)
Splits a SEARCHPATH_SEPARATOR
-separated list of files, stripping
white space and substituting ~/ with $HOME/.
trimString
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Text | Returns: A newly-allocated string that must be freed with |
Deprecated: (Since version 1.38)
Trims leading and trailing whitespace from a string.
unicharDirection
:: (HasCallStack, MonadIO m) | |
=> Char |
|
-> m Direction | Returns: the direction of the character. |
Determines the inherent direction of a character; either
DirectionLtr
, DirectionRtl
, or
DirectionNeutral
.
This function is useful to categorize characters into left-to-right
letters, right-to-left letters, and everything else. If full
Unicode bidirectional type of a character is needed,
bidiTypeForUnichar
can be used instead.
unitsFromDouble
:: (HasCallStack, MonadIO m) | |
=> Double |
|
-> m Int32 | Returns: the value in Pango units. |
Converts a floating-point number to Pango units: multiplies
it by SCALE
and rounds to nearest integer.
Since: 1.16
unitsToDouble
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> m Double | Returns: the double value. |
Converts a number in Pango units to floating-point: divides
it by SCALE
.
Since: 1.16
version
:: (HasCallStack, MonadIO m) | |
=> m Int32 | Returns: The encoded version of Pango library available at run time. |
This is similar to the macro PANGO_VERSION
except that
it returns the encoded version of Pango available at run-time,
as opposed to the version available at compile-time.
A version number can be encoded into an integer using
PANGO_VERSION_ENCODE()
.
Since: 1.16
versionCheck
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> m (Maybe Text) | Returns: |
Checks that the Pango library in use is compatible with the
given version. Generally you would pass in the constants
PANGO_VERSION_MAJOR
, PANGO_VERSION_MINOR
, PANGO_VERSION_MICRO
as the three arguments to this function; that produces
a check that the library in use at run-time is compatible with
the version of Pango the application or module was compiled against.
Compatibility is defined by two things: first the version
of the running library is newer than the version
requiredMajor
.required_minor.requiredMicro
. Second
the running library must be binary compatible with the
version requiredMajor
.required_minor.requiredMicro
(same major version.)
For compile-time version checking use PANGO_VERSION_CHECK()
.
Since: 1.16
versionString
:: (HasCallStack, MonadIO m) | |
=> m Text | Returns: A string containing the version of Pango library available at run time. The returned string is owned by Pango and should not be modified or freed. |
This is similar to the macro PANGO_VERSION_STRING
except that
it returns the version of Pango available at run-time, as opposed to
the version available at compile-time.
Since: 1.16