1 /** @file
2 * @brief Definition of struct one_glyph
3 */
4 /* This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * See the file COPYING for details.
10 */
12 #ifndef LIBNRTYPE_ONE_GLYPH_H_INKSCAPE
13 #define LIBNRTYPE_ONE_GLYPH_H_INKSCAPE
15 #include <pango/pango-types.h>
17 /**
18 * Information for a single glyph.
19 *
20 * Pango converts the text into glyphs, but scatters the info for a given glyph; here is a
21 * structure holding what inkscape needs to know.
22 */
23 struct one_glyph {
24 int gl; ///< glyph_id
25 double x, y; ///< glyph position in the layout (nominal sizes, in the [0..1] range).
26 bool char_start; /**< Whether this glyph is the beginning of a letter. (RTL is taken in
27 * account.) */
28 bool word_start; ///< Whether this glyph is the beginning of a word.
29 bool para_start; ///< Whether this glyph is the beginning of a paragraph (for indentation).
30 char uni_dir; ///< BiDi orientation of the run containing this glyph.
31 int uni_st, uni_en; /**< Start and end positions of the text corresponding to this glyph.
32 * You always have uni_st < uni_en. */
33 PangoFont *font; /**< Font this glyph uses. (For bidi text, you need several fonts.)
34 * When rendering glyphs, check if this font is the one you're using. */
35 };
38 #endif /* !LIBNRTYPE_ONE_GLYPH_H_INKSCAPE */
40 /*
41 Local Variables:
42 mode:c++
43 c-file-style:"stroustrup"
44 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
45 indent-tabs-mode:nil
46 fill-column:99
47 End:
48 */
49 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :