| 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 |
GI.Pango.Structs.GlyphItem
Contents
Description
- newtype GlyphItem = GlyphItem (ManagedPtr GlyphItem)
- newZeroGlyphItem :: MonadIO m => m GlyphItem
- noGlyphItem :: Maybe GlyphItem
- data GlyphItemApplyAttrsMethodInfo
- glyphItemApplyAttrs :: (HasCallStack, MonadIO m) => GlyphItem -> Text -> AttrList -> m [GlyphItem]
- data GlyphItemCopyMethodInfo
- glyphItemCopy :: (HasCallStack, MonadIO m) => GlyphItem -> m (Maybe GlyphItem)
- data GlyphItemFreeMethodInfo
- glyphItemFree :: (HasCallStack, MonadIO m) => GlyphItem -> m ()
- data GlyphItemGetLogicalWidthsMethodInfo
- glyphItemGetLogicalWidths :: (HasCallStack, MonadIO m) => GlyphItem -> Text -> Ptr Int32 -> m ()
- data GlyphItemLetterSpaceMethodInfo
- glyphItemLetterSpace :: (HasCallStack, MonadIO m) => GlyphItem -> Text -> Ptr (Ptr LogAttr) -> Int32 -> m ()
- data GlyphItemSplitMethodInfo
- glyphItemSplit :: (HasCallStack, MonadIO m) => GlyphItem -> Text -> Int32 -> m GlyphItem
- clearGlyphItemGlyphs :: MonadIO m => GlyphItem -> m ()
- getGlyphItemGlyphs :: MonadIO m => GlyphItem -> m (Maybe GlyphString)
- glyphItem_glyphs :: AttrLabelProxy "glyphs"
- setGlyphItemGlyphs :: MonadIO m => GlyphItem -> Ptr GlyphString -> m ()
- clearGlyphItemItem :: MonadIO m => GlyphItem -> m ()
- getGlyphItemItem :: MonadIO m => GlyphItem -> m (Maybe Item)
- glyphItem_item :: AttrLabelProxy "item"
- setGlyphItemItem :: MonadIO m => GlyphItem -> Ptr Item -> m ()
Exported types
Constructors
| GlyphItem (ManagedPtr GlyphItem) |
Instances
newZeroGlyphItem :: MonadIO m => m GlyphItem Source #
Construct a GlyphItem struct initialized to zero.
Methods
applyAttrs
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GlyphItem |
|
| -> Text |
|
| -> AttrList |
|
| -> m [GlyphItem] | Returns: a
list of glyph items resulting from splitting |
Splits a shaped item (PangoGlyphItem) into multiple items based
on an attribute list. The idea is that if you have attributes
that don't affect shaping, such as color or underline, to avoid
affecting shaping, you filter them out (attrListFilter),
apply the shaping process and then reapply them to the result using
this function.
All attributes that start or end inside a cluster are applied to that cluster; for instance, if half of a cluster is underlined and the other-half strikethrough, then the cluster will end up with both underline and strikethrough attributes. In these cases, it may happen that item->extra_attrs for some of the result items can have multiple attributes of the same type.
This function takes ownership of glyphItem; it will be reused
as one of the elements in the list.
Since: 1.2
copy
data GlyphItemCopyMethodInfo Source #
Instances
| ((~) * signature (m (Maybe GlyphItem)), MonadIO m) => MethodInfo * GlyphItemCopyMethodInfo GlyphItem signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GlyphItem | |
| -> m (Maybe GlyphItem) | Returns: the newly allocated |
Make a deep copy of an existing GlyphItem structure.
Since: 1.20
free
data GlyphItemFreeMethodInfo Source #
Instances
| ((~) * signature (m ()), MonadIO m) => MethodInfo * GlyphItemFreeMethodInfo GlyphItem signature Source # | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GlyphItem | |
| -> m () |
Frees a GlyphItem and resources to which it points.
Since: 1.6
getLogicalWidths
glyphItemGetLogicalWidths Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GlyphItem |
|
| -> Text |
|
| -> Ptr Int32 |
|
| -> m () |
Given a GlyphItem and the corresponding
text, determine the screen width corresponding to each character. When
multiple characters compose a single cluster, the width of the entire
cluster is divided equally among the characters.
See also glyphStringGetLogicalWidths.
Since: 1.26
letterSpace
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GlyphItem |
|
| -> Text |
|
| -> Ptr (Ptr LogAttr) |
|
| -> Int32 |
|
| -> m () |
Adds spacing between the graphemes of glyphItem to
give the effect of typographic letter spacing.
Since: 1.6
split
Arguments
| :: (HasCallStack, MonadIO m) | |
| => GlyphItem |
|
| -> Text |
|
| -> Int32 |
|
| -> m GlyphItem | Returns: the newly allocated item representing text before
|
Modifies orig to cover only the text after splitIndex, and
returns a new item that covers the text before splitIndex that
used to be in orig. You can think of splitIndex as the length of
the returned item. splitIndex may not be 0, and it may not be
greater than or equal to the length of orig (that is, there must
be at least one byte assigned to each item, you can't create a
zero-length item).
This function is similar in function to itemSplit (and uses
it internally.)
Since: 1.2
Properties
glyphs
clearGlyphItemGlyphs :: MonadIO m => GlyphItem -> m () Source #
getGlyphItemGlyphs :: MonadIO m => GlyphItem -> m (Maybe GlyphString) Source #
glyphItem_glyphs :: AttrLabelProxy "glyphs" Source #
setGlyphItemGlyphs :: MonadIO m => GlyphItem -> Ptr GlyphString -> m () Source #
item
clearGlyphItemItem :: MonadIO m => GlyphItem -> m () Source #
glyphItem_item :: AttrLabelProxy "item" Source #