|
Packit |
0ec9dd |
/* Pango
|
|
Packit |
0ec9dd |
* pango-glyph-item.h: Pair of PangoItem and a glyph string
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* Copyright (C) 2002 Red Hat Software
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* This library is free software; you can redistribute it and/or
|
|
Packit |
0ec9dd |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
0ec9dd |
* License as published by the Free Software Foundation; either
|
|
Packit |
0ec9dd |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
0ec9dd |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
0ec9dd |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
0ec9dd |
* Library General Public License for more details.
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
0ec9dd |
* License along with this library; if not, write to the
|
|
Packit |
0ec9dd |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Packit |
0ec9dd |
* Boston, MA 02111-1307, USA.
|
|
Packit |
0ec9dd |
*/
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
#ifndef __PANGO_GLYPH_ITEM_H__
|
|
Packit |
0ec9dd |
#define __PANGO_GLYPH_ITEM_H__
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
#include <pango/pango-attributes.h>
|
|
Packit |
0ec9dd |
#include <pango/pango-break.h>
|
|
Packit |
0ec9dd |
#include <pango/pango-item.h>
|
|
Packit |
0ec9dd |
#include <pango/pango-glyph.h>
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
G_BEGIN_DECLS
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
/**
|
|
Packit |
0ec9dd |
* PangoGlyphItem:
|
|
Packit |
0ec9dd |
* @item: corresponding #PangoItem.
|
|
Packit |
0ec9dd |
* @glyphs: corresponding #PangoGlyphString.
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* A #PangoGlyphItem is a pair of a #PangoItem and the glyphs
|
|
Packit |
0ec9dd |
* resulting from shaping the text corresponding to an item.
|
|
Packit |
0ec9dd |
* As an example of the usage of #PangoGlyphItem, the results
|
|
Packit |
0ec9dd |
* of shaping text with #PangoLayout is a list of #PangoLayoutLine,
|
|
Packit |
0ec9dd |
* each of which contains a list of #PangoGlyphItem.
|
|
Packit |
0ec9dd |
*/
|
|
Packit |
0ec9dd |
typedef struct _PangoGlyphItem PangoGlyphItem;
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
struct _PangoGlyphItem
|
|
Packit |
0ec9dd |
{
|
|
Packit |
0ec9dd |
PangoItem *item;
|
|
Packit |
0ec9dd |
PangoGlyphString *glyphs;
|
|
Packit |
0ec9dd |
};
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
/**
|
|
Packit |
0ec9dd |
* PANGO_TYPE_GLYPH_ITEM:
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* The #GObject type for #PangoGlyphItem.
|
|
Packit |
0ec9dd |
*/
|
|
Packit |
0ec9dd |
#define PANGO_TYPE_GLYPH_ITEM (pango_glyph_item_get_type ())
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_ALL
|
|
Packit |
0ec9dd |
GType pango_glyph_item_get_type (void) G_GNUC_CONST;
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_2
|
|
Packit |
0ec9dd |
PangoGlyphItem *pango_glyph_item_split (PangoGlyphItem *orig,
|
|
Packit |
0ec9dd |
const char *text,
|
|
Packit |
0ec9dd |
int split_index);
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_20
|
|
Packit |
0ec9dd |
PangoGlyphItem *pango_glyph_item_copy (PangoGlyphItem *orig);
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_6
|
|
Packit |
0ec9dd |
void pango_glyph_item_free (PangoGlyphItem *glyph_item);
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_2
|
|
Packit |
0ec9dd |
GSList * pango_glyph_item_apply_attrs (PangoGlyphItem *glyph_item,
|
|
Packit |
0ec9dd |
const char *text,
|
|
Packit |
0ec9dd |
PangoAttrList *list);
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_6
|
|
Packit |
0ec9dd |
void pango_glyph_item_letter_space (PangoGlyphItem *glyph_item,
|
|
Packit |
0ec9dd |
const char *text,
|
|
Packit |
0ec9dd |
PangoLogAttr *log_attrs,
|
|
Packit |
0ec9dd |
int letter_spacing);
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_26
|
|
Packit |
0ec9dd |
void pango_glyph_item_get_logical_widths (PangoGlyphItem *glyph_item,
|
|
Packit |
0ec9dd |
const char *text,
|
|
Packit |
0ec9dd |
int *logical_widths);
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
/**
|
|
Packit |
0ec9dd |
* PangoGlyphItemIter:
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* A #PangoGlyphItemIter is an iterator over the clusters in a
|
|
Packit |
0ec9dd |
* #PangoGlyphItem. The <firstterm>forward direction</firstterm> of the
|
|
Packit |
0ec9dd |
* iterator is the logical direction of text. That is, with increasing
|
|
Packit |
0ec9dd |
* @start_index and @start_char values. If @glyph_item is right-to-left
|
|
Packit |
0ec9dd |
* (that is, if <literal>@glyph_item->item->analysis.level</literal> is odd),
|
|
Packit |
0ec9dd |
* then @start_glyph decreases as the iterator moves forward. Moreover,
|
|
Packit |
0ec9dd |
* in right-to-left cases, @start_glyph is greater than @end_glyph.
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* An iterator should be initialized using either of
|
|
Packit |
0ec9dd |
* pango_glyph_item_iter_init_start() and
|
|
Packit |
0ec9dd |
* pango_glyph_item_iter_init_end(), for forward and backward iteration
|
|
Packit |
0ec9dd |
* respectively, and walked over using any desired mixture of
|
|
Packit |
0ec9dd |
* pango_glyph_item_iter_next_cluster() and
|
|
Packit |
0ec9dd |
* pango_glyph_item_iter_prev_cluster(). A common idiom for doing a
|
|
Packit |
0ec9dd |
* forward iteration over the clusters is:
|
|
Packit |
0ec9dd |
* <programlisting>
|
|
Packit |
0ec9dd |
* PangoGlyphItemIter cluster_iter;
|
|
Packit |
0ec9dd |
* gboolean have_cluster;
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* for (have_cluster = pango_glyph_item_iter_init_start (&cluster_iter,
|
|
Packit |
0ec9dd |
* glyph_item, text);
|
|
Packit |
0ec9dd |
* have_cluster;
|
|
Packit |
0ec9dd |
* have_cluster = pango_glyph_item_iter_next_cluster (&cluster_iter))
|
|
Packit |
0ec9dd |
* {
|
|
Packit |
0ec9dd |
* ...
|
|
Packit |
0ec9dd |
* }
|
|
Packit |
0ec9dd |
* </programlisting>
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* Note that @text is the start of the text for layout, which is then
|
|
Packit |
0ec9dd |
* indexed by <literal>@glyph_item->item->offset</literal> to get to the
|
|
Packit |
0ec9dd |
* text of @glyph_item. The @start_index and @end_index values can directly
|
|
Packit |
0ec9dd |
* index into @text. The @start_glyph, @end_glyph, @start_char, and @end_char
|
|
Packit |
0ec9dd |
* values however are zero-based for the @glyph_item. For each cluster, the
|
|
Packit |
0ec9dd |
* item pointed at by the start variables is included in the cluster while
|
|
Packit |
0ec9dd |
* the one pointed at by end variables is not.
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* None of the members of a #PangoGlyphItemIter should be modified manually.
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* Since: 1.22
|
|
Packit |
0ec9dd |
*/
|
|
Packit |
0ec9dd |
typedef struct _PangoGlyphItemIter PangoGlyphItemIter;
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
struct _PangoGlyphItemIter
|
|
Packit |
0ec9dd |
{
|
|
Packit |
0ec9dd |
PangoGlyphItem *glyph_item;
|
|
Packit |
0ec9dd |
const gchar *text;
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
int start_glyph;
|
|
Packit |
0ec9dd |
int start_index;
|
|
Packit |
0ec9dd |
int start_char;
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
int end_glyph;
|
|
Packit |
0ec9dd |
int end_index;
|
|
Packit |
0ec9dd |
int end_char;
|
|
Packit |
0ec9dd |
};
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
/**
|
|
Packit |
0ec9dd |
* PANGO_TYPE_GLYPH_ITEM_ITER:
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* The #GObject type for #PangoGlyphItemIter.
|
|
Packit |
0ec9dd |
*
|
|
Packit |
0ec9dd |
* Since: 1.22
|
|
Packit |
0ec9dd |
*/
|
|
Packit |
0ec9dd |
#define PANGO_TYPE_GLYPH_ITEM_ITER (pango_glyph_item_iter_get_type ())
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_22
|
|
Packit |
0ec9dd |
GType pango_glyph_item_iter_get_type (void) G_GNUC_CONST;
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_22
|
|
Packit |
0ec9dd |
PangoGlyphItemIter *pango_glyph_item_iter_copy (PangoGlyphItemIter *orig);
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_22
|
|
Packit |
0ec9dd |
void pango_glyph_item_iter_free (PangoGlyphItemIter *iter);
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_22
|
|
Packit |
0ec9dd |
gboolean pango_glyph_item_iter_init_start (PangoGlyphItemIter *iter,
|
|
Packit |
0ec9dd |
PangoGlyphItem *glyph_item,
|
|
Packit |
0ec9dd |
const char *text);
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_22
|
|
Packit |
0ec9dd |
gboolean pango_glyph_item_iter_init_end (PangoGlyphItemIter *iter,
|
|
Packit |
0ec9dd |
PangoGlyphItem *glyph_item,
|
|
Packit |
0ec9dd |
const char *text);
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_22
|
|
Packit |
0ec9dd |
gboolean pango_glyph_item_iter_next_cluster (PangoGlyphItemIter *iter);
|
|
Packit |
0ec9dd |
PANGO_AVAILABLE_IN_1_22
|
|
Packit |
0ec9dd |
gboolean pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter);
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
G_END_DECLS
|
|
Packit |
0ec9dd |
|
|
Packit |
0ec9dd |
#endif /* __PANGO_GLYPH_ITEM_H__ */
|