Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
pango-glyph-item.h
Go to the documentation of this file.
1/* Pango
2 * pango-glyph-item.h: Pair of PangoItem and a glyph string
3 *
4 * Copyright (C) 2002 Red Hat Software
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
22#ifndef __PANGO_GLYPH_ITEM_H__
23#define __PANGO_GLYPH_ITEM_H__
24
26#include <pango/pango-break.h>
27#include <pango/pango-item.h>
28#include <pango/pango-glyph.h>
29
31
32/**
33 * PangoGlyphItem:
34 * @item: corresponding `PangoItem`
35 * @glyphs: corresponding `PangoGlyphString`
36 * @y_offset: shift of the baseline, relative to the baseline
37 * of the containing line. Positive values shift upwards
38 * @start_x_offset: horizontal displacement to apply before the
39 * glyph item. Positive values shift right
40 * @end_x_offset: horizontal displacement to apply after th
41 * glyph item. Positive values shift right
42 *
43 * A `PangoGlyphItem` is a pair of a `PangoItem` and the glyphs
44 * resulting from shaping the items text.
45 *
46 * As an example of the usage of `PangoGlyphItem`, the results
47 * of shaping text with `PangoLayout` is a list of `PangoLayoutLine`,
48 * each of which contains a list of `PangoGlyphItem`.
49 */
51
60
61#define PANGO_TYPE_GLYPH_ITEM (pango_glyph_item_get_type ())
62
65
68 const char *text,
69 int split_index);
76 const char *text,
77 PangoAttrList *list);
80 const char *text,
81 PangoLogAttr *log_attrs,
82 int letter_spacing);
85 const char *text,
86 int *logical_widths);
87
88
89/**
90 * PangoGlyphItemIter:
91 *
92 * A `PangoGlyphItemIter` is an iterator over the clusters in a
93 * `PangoGlyphItem`.
94 *
95 * The *forward direction* of the iterator is the logical direction of text.
96 * That is, with increasing @start_index and @start_char values. If @glyph_item
97 * is right-to-left (that is, if `glyph_item->item->analysis.level` is odd),
98 * then @start_glyph decreases as the iterator moves forward. Moreover,
99 * in right-to-left cases, @start_glyph is greater than @end_glyph.
100 *
101 * An iterator should be initialized using either
102 * pango_glyph_item_iter_init_start() or
103 * pango_glyph_item_iter_init_end(), for forward and backward iteration
104 * respectively, and walked over using any desired mixture of
105 * pango_glyph_item_iter_next_cluster() and
106 * pango_glyph_item_iter_prev_cluster().
107 *
108 * A common idiom for doing a forward iteration over the clusters is:
109 *
110 * ```
111 * PangoGlyphItemIter cluster_iter;
112 * gboolean have_cluster;
113 *
114 * for (have_cluster = pango_glyph_item_iter_init_start (&cluster_iter,
115 * glyph_item, text);
116 * have_cluster;
117 * have_cluster = pango_glyph_item_iter_next_cluster (&cluster_iter))
118 * {
119 * ...
120 * }
121 * ```
122 *
123 * Note that @text is the start of the text for layout, which is then
124 * indexed by `glyph_item->item->offset` to get to the text of @glyph_item.
125 * The @start_index and @end_index values can directly index into @text. The
126 * @start_glyph, @end_glyph, @start_char, and @end_char values however are
127 * zero-based for the @glyph_item. For each cluster, the item pointed at by
128 * the start variables is included in the cluster while the one pointed at by
129 * end variables is not.
130 *
131 * None of the members of a `PangoGlyphItemIter` should be modified manually.
132 *
133 * Since: 1.22
134 */
136
150
151#define PANGO_TYPE_GLYPH_ITEM_ITER (pango_glyph_item_iter_get_type ())
152
159
162 PangoGlyphItem *glyph_item,
163 const char *text);
166 PangoGlyphItem *glyph_item,
167 const char *text);
172
174
175#endif /* __PANGO_GLYPH_ITEM_H__ */
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
typedefG_BEGIN_DECLS struct _GSList GSList
Definition gslist.h:39
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52
struct _PangoAttrList PangoAttrList
PANGO_AVAILABLE_IN_1_22 void pango_glyph_item_iter_free(PangoGlyphItemIter *iter)
PANGO_AVAILABLE_IN_1_22 gboolean pango_glyph_item_iter_init_end(PangoGlyphItemIter *iter, PangoGlyphItem *glyph_item, const char *text)
PANGO_AVAILABLE_IN_1_22 GType pango_glyph_item_iter_get_type(void) G_GNUC_CONST
PANGO_AVAILABLE_IN_1_2 PangoGlyphItem * pango_glyph_item_split(PangoGlyphItem *orig, const char *text, int split_index)
PANGO_AVAILABLE_IN_1_26 void pango_glyph_item_get_logical_widths(PangoGlyphItem *glyph_item, const char *text, int *logical_widths)
PANGO_AVAILABLE_IN_1_6 void pango_glyph_item_free(PangoGlyphItem *glyph_item)
PANGO_AVAILABLE_IN_1_22 gboolean pango_glyph_item_iter_next_cluster(PangoGlyphItemIter *iter)
PANGO_AVAILABLE_IN_1_2 GSList * pango_glyph_item_apply_attrs(PangoGlyphItem *glyph_item, const char *text, PangoAttrList *list)
PANGO_AVAILABLE_IN_1_22 gboolean pango_glyph_item_iter_prev_cluster(PangoGlyphItemIter *iter)
PANGO_AVAILABLE_IN_1_6 void pango_glyph_item_letter_space(PangoGlyphItem *glyph_item, const char *text, PangoLogAttr *log_attrs, int letter_spacing)
PANGO_AVAILABLE_IN_1_22 PangoGlyphItemIter * pango_glyph_item_iter_copy(PangoGlyphItemIter *orig)
typedefG_BEGIN_DECLS struct _PangoGlyphItem PangoGlyphItem
PANGO_AVAILABLE_IN_ALL GType pango_glyph_item_get_type(void) G_GNUC_CONST
PANGO_AVAILABLE_IN_1_22 gboolean pango_glyph_item_iter_init_start(PangoGlyphItemIter *iter, PangoGlyphItem *glyph_item, const char *text)
PANGO_AVAILABLE_IN_1_20 PangoGlyphItem * pango_glyph_item_copy(PangoGlyphItem *orig)
typedefG_BEGIN_DECLS struct _PangoLogAttr PangoLogAttr
Definition pango-types.h:32
#define PANGO_AVAILABLE_IN_1_20
#define PANGO_AVAILABLE_IN_1_2
#define PANGO_AVAILABLE_IN_1_22
#define PANGO_AVAILABLE_IN_1_6
#define PANGO_AVAILABLE_IN_ALL
#define PANGO_AVAILABLE_IN_1_26
PangoGlyphItem * glyph_item
PangoGlyphString * glyphs