2
* pango-glyph.h: Glyph storage
4
* Copyright (C) 2000 Red Hat Software
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.
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.
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.
22
#ifndef __PANGO_GLYPH_H__
23
#define __PANGO_GLYPH_H__
25
#include <pango/pango-types.h>
26
#include <pango/pango-item.h>
30
typedef struct _PangoGlyphGeometry PangoGlyphGeometry;
31
typedef struct _PangoGlyphVisAttr PangoGlyphVisAttr;
32
typedef struct _PangoGlyphInfo PangoGlyphInfo;
33
typedef struct _PangoGlyphString PangoGlyphString;
35
/* 1024ths of a device unit */
36
typedef gint32 PangoGlyphUnit;
38
/* Positioning information about a glyph
40
struct _PangoGlyphGeometry
43
PangoGlyphUnit x_offset;
44
PangoGlyphUnit y_offset;
47
/* Visual attributes of a glyph
49
struct _PangoGlyphVisAttr
51
guint is_cluster_start : 1;
56
struct _PangoGlyphInfo
59
PangoGlyphGeometry geometry;
60
PangoGlyphVisAttr attr;
63
/* A string of glyphs with positional information and visual attributes -
66
struct _PangoGlyphString {
69
PangoGlyphInfo *glyphs;
71
/* This is a memory inefficient way of representing the information
72
* here - each value gives the byte index within the text
73
* corresponding to the glyph string of the start of the cluster to
74
* which the glyph belongs.
82
#define PANGO_TYPE_GLYPH_STRING (pango_glyph_string_get_type ())
84
PangoGlyphString *pango_glyph_string_new (void);
85
void pango_glyph_string_set_size (PangoGlyphString *string,
87
GType pango_glyph_string_get_type (void);
88
PangoGlyphString *pango_glyph_string_copy (PangoGlyphString *string);
89
void pango_glyph_string_free (PangoGlyphString *string);
90
void pango_glyph_string_extents (PangoGlyphString *glyphs,
92
PangoRectangle *ink_rect,
93
PangoRectangle *logical_rect);
94
int pango_glyph_string_get_width(PangoGlyphString *glyphs);
96
void pango_glyph_string_extents_range (PangoGlyphString *glyphs,
100
PangoRectangle *ink_rect,
101
PangoRectangle *logical_rect);
103
void pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs,
107
int *logical_widths);
109
void pango_glyph_string_index_to_x (PangoGlyphString *glyphs,
112
PangoAnalysis *analysis,
116
void pango_glyph_string_x_to_index (PangoGlyphString *glyphs,
119
PangoAnalysis *analysis,
124
/* Turn a string of characters into a string of glyphs
126
void pango_shape (const gchar *text,
128
const PangoAnalysis *analysis,
129
PangoGlyphString *glyphs);
131
GList *pango_reorder_items (GList *logical_items);
135
#endif /* __PANGO_GLYPH_H__ */