Details
PANGO_SCALE
The PANGO_SCALE macro represents the scale between dimensions used
for pango distances and device units. (The definition of device
units is dependent on the output device; it will typically be pixels
for a screen, and points for a printer.) PANGO_SCALE is currently
1000, but this may be changed in the future.
struct PangoRectangle
struct PangoRectangle
{
int x;
int y;
int width;
int height;
}; |
The PangoRectangle structure represents a rectangle. It is frequently
used to represent the logical or ink extents of a single glyph or section
of text. (See, for instance, pango_font_get_glyph_extents())
PANGO_ASCENT()
#define PANGO_ASCENT(rect) (-(rect).y) |
Extracts the ascent from a PangoRectangle
representing glyph extents. The ascent is the distance from the
baseline to the highest point of the character. This is positive if the
glyph ascends above the baseline.
PANGO_DESCENT()
#define PANGO_DESCENT(rect) ((rect).y + (rect).height) |
Extracts the descent from a PangoRectangle
representing glyph extents. The descent is the distance from the
baseline to the lowest point of the character. This is positive if the
glyph descends below the baseline.
PANGO_LBEARING()
#define PANGO_LBEARING(rect) ((rect).x) |
Extracts the left bearing from a PangoRectangle
representing glyph extents. The descent is the distance from the
horizontal origin to the farthest left point of the character.
This is positive for characters drawn completely to the right of the
glyph origin.
PANGO_RBEARING()
#define PANGO_RBEARING(rect) ((rect).x + (rect).width) |
Extracts the left bearing from a PangoRectangle
representing glyph extents. The descent is the distance from the
horizontal origin to the farthest left point of the character.
This is positive except for characters drawn completely to the left of the
horizontal origin.
PangoGlyph
typedef guint32 PangoGlyph; |
The PangoGlyph structure represents a single glyph in the output
form of a string. It contains the following fields.
struct PangoGlyphInfo
struct PangoGlyphInfo
{
PangoGlyph glyph;
PangoGlyphGeometry geometry;
PangoGlyphVisAttr attr;
}; |
struct PangoGlyphGeometry
struct PangoGlyphGeometry
{
PangoGlyphUnit width;
PangoGlyphUnit x_offset;
PangoGlyphUnit y_offset;
}; |
The PangoGlyphGeometry structure contains width and positioning
information for a single glyph. Distances are in
1/64ths of a point.
PangoGlyphUnit
typedef gint32 PangoGlyphUnit; |
The PangoGlyphUnit type is used to store dimensions within
Pango. Dimensions are stored in 1/64ths of a point.
struct PangoGlyphVisAttr
struct PangoGlyphVisAttr
{
guint is_cluster_start : 1;
}; |
The PangoGlyphVisAttr is used to communicate information between
the shaping phase and the rendering phase. It's contents
are still evolving.
struct PangoGlyphString
struct PangoGlyphString {
gint num_glyphs;
PangoGlyphInfo *glyphs;
/* This is a memory inefficient way of representing the
* information here - each value gives the character index
* of the start of the cluster to which the glyph belongs.
*/
gint *log_clusters;
/*< private >*/
gint space;
}; |
The PangoGlyphString structure is used to store strings
of glyphs with geometry and visual attribute information.
The storage for the glyph information is owned
by the structure which simplifies memory management.
PangoGlyphString contains the following publically
accessible fields
pango_glyph_string_new ()
Create a new PangoGlyphString.
pango_glyph_string_set_size ()
Resize a glyph string to the given length.
pango_glyph_string_free ()
Free a glyph string and associated storage.
pango_glyph_string_extents ()
Compute the logical and ink extents of a glyph string. See the documentation
for pango_font_get_glyph_extents() for details about the interpretation
of the rectangles.
pango_glyph_string_index_to_x ()
void pango_glyph_string_index_to_x (PangoGlyphString *glyphs,
char *text,
int length,
PangoAnalysis *analysis,
int index,
gboolean trailing,
int *x_pos); |
Converts from character position to x position. (X position
is measured from the left edge of the run)
pango_glyph_string_x_to_index ()
void pango_glyph_string_x_to_index (PangoGlyphString *glyphs,
char *text,
int length,
PangoAnalysis *analysis,
int x_pos,
int *index,
int *trailing); |
Convert from x offset to position.
pango_glyph_string_get_logical_widths ()
void pango_glyph_string_get_logical_widths
(PangoGlyphString *glyphs,
const char *text,
int length,
int embedding_level,
int *logical_widths); |
Given a PangoGlyphString resulting from pango_shape() and the corresponding
text, determine the screen width corresponding to each character. When
multiple characters compose a single cluster, the width of the entire
cluster is divided equally among the characters.