File indexing completed on 2024-11-15 09:49:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef __PANGO_GLYPH_H__
0023 #define __PANGO_GLYPH_H__
0024
0025 #include <pango/pango-types.h>
0026 #include <pango/pango-item.h>
0027 #include <pango/pango-break.h>
0028
0029 G_BEGIN_DECLS
0030
0031 typedef struct _PangoGlyphGeometry PangoGlyphGeometry;
0032 typedef struct _PangoGlyphVisAttr PangoGlyphVisAttr;
0033 typedef struct _PangoGlyphInfo PangoGlyphInfo;
0034 typedef struct _PangoGlyphString PangoGlyphString;
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 typedef gint32 PangoGlyphUnit;
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078 struct _PangoGlyphGeometry
0079 {
0080 PangoGlyphUnit width;
0081 PangoGlyphUnit x_offset;
0082 PangoGlyphUnit y_offset;
0083 };
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103 struct _PangoGlyphVisAttr
0104 {
0105 guint is_cluster_start : 1;
0106 guint is_color : 1;
0107 };
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120 struct _PangoGlyphInfo
0121 {
0122 PangoGlyph glyph;
0123 PangoGlyphGeometry geometry;
0124 PangoGlyphVisAttr attr;
0125 };
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140 struct _PangoGlyphString {
0141 int num_glyphs;
0142
0143 PangoGlyphInfo *glyphs;
0144 int *log_clusters;
0145
0146
0147 int space;
0148 };
0149
0150 #define PANGO_TYPE_GLYPH_STRING (pango_glyph_string_get_type ())
0151
0152 PANGO_AVAILABLE_IN_ALL
0153 GType pango_glyph_string_get_type (void) G_GNUC_CONST;
0154
0155 PANGO_AVAILABLE_IN_ALL
0156 PangoGlyphString * pango_glyph_string_new (void);
0157 PANGO_AVAILABLE_IN_ALL
0158 void pango_glyph_string_set_size (PangoGlyphString *string,
0159 int new_len);
0160
0161 PANGO_AVAILABLE_IN_ALL
0162 PangoGlyphString * pango_glyph_string_copy (PangoGlyphString *string);
0163 PANGO_AVAILABLE_IN_ALL
0164 void pango_glyph_string_free (PangoGlyphString *string);
0165
0166 PANGO_AVAILABLE_IN_ALL
0167 void pango_glyph_string_extents (PangoGlyphString *glyphs,
0168 PangoFont *font,
0169 PangoRectangle *ink_rect,
0170 PangoRectangle *logical_rect);
0171 PANGO_AVAILABLE_IN_1_14
0172 int pango_glyph_string_get_width (PangoGlyphString *glyphs);
0173
0174 PANGO_AVAILABLE_IN_ALL
0175 void pango_glyph_string_extents_range (PangoGlyphString *glyphs,
0176 int start,
0177 int end,
0178 PangoFont *font,
0179 PangoRectangle *ink_rect,
0180 PangoRectangle *logical_rect);
0181
0182 PANGO_AVAILABLE_IN_ALL
0183 void pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs,
0184 const char *text,
0185 int length,
0186 int embedding_level,
0187 int *logical_widths);
0188
0189 PANGO_AVAILABLE_IN_ALL
0190 void pango_glyph_string_index_to_x (PangoGlyphString *glyphs,
0191 const char *text,
0192 int length,
0193 PangoAnalysis *analysis,
0194 int index_,
0195 gboolean trailing,
0196 int *x_pos);
0197 PANGO_AVAILABLE_IN_ALL
0198 void pango_glyph_string_x_to_index (PangoGlyphString *glyphs,
0199 const char *text,
0200 int length,
0201 PangoAnalysis *analysis,
0202 int x_pos,
0203 int *index_,
0204 int *trailing);
0205
0206 PANGO_AVAILABLE_IN_1_50
0207 void pango_glyph_string_index_to_x_full (PangoGlyphString *glyphs,
0208 const char *text,
0209 int length,
0210 PangoAnalysis *analysis,
0211 PangoLogAttr *attrs,
0212 int index_,
0213 gboolean trailing,
0214 int *x_pos);
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230 typedef enum {
0231 PANGO_SHAPE_NONE = 0,
0232 PANGO_SHAPE_ROUND_POSITIONS = 1 << 0,
0233 } PangoShapeFlags;
0234
0235 PANGO_AVAILABLE_IN_ALL
0236 void pango_shape (const char *text,
0237 int length,
0238 const PangoAnalysis *analysis,
0239 PangoGlyphString *glyphs);
0240
0241 PANGO_AVAILABLE_IN_1_32
0242 void pango_shape_full (const char *item_text,
0243 int item_length,
0244 const char *paragraph_text,
0245 int paragraph_length,
0246 const PangoAnalysis *analysis,
0247 PangoGlyphString *glyphs);
0248
0249 PANGO_AVAILABLE_IN_1_44
0250 void pango_shape_with_flags (const char *item_text,
0251 int item_length,
0252 const char *paragraph_text,
0253 int paragraph_length,
0254 const PangoAnalysis *analysis,
0255 PangoGlyphString *glyphs,
0256 PangoShapeFlags flags);
0257
0258
0259 PANGO_AVAILABLE_IN_1_50
0260 void pango_shape_item (PangoItem *item,
0261 const char *paragraph_text,
0262 int paragraph_length,
0263 PangoLogAttr *log_attrs,
0264 PangoGlyphString *glyphs,
0265 PangoShapeFlags flags);
0266
0267
0268 G_END_DECLS
0269
0270 #endif