diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2013-09-27 14:36:51 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2013-09-27 14:36:51 -0400 |
commit | 6d08bcab0d2821365a2ffd955cbbb07270565664 (patch) | |
tree | 6bffdc716a62ea60c0db7ed08d7f5a0d205302f1 /pango/pango-types.h | |
parent | bb5c4c8497157afddcb5ced7e16c5dad4e893a03 (diff) | |
download | pango-6d08bcab0d2821365a2ffd955cbbb07270565664.tar.gz |
Bug 685167 - migrate docs to no-tmpl flavour
Patch from Rafał Mużyło.
Diffstat (limited to 'pango/pango-types.h')
-rw-r--r-- | pango/pango-types.h | 104 |
1 files changed, 102 insertions, 2 deletions
diff --git a/pango/pango-types.h b/pango/pango-types.h index c4ef8437..0bf4bd7d 100644 --- a/pango/pango-types.h +++ b/pango/pango-types.h @@ -40,10 +40,53 @@ typedef struct _PangoRectangle PangoRectangle; /* A index of a glyph into a font. Rendering system dependent */ +/** + * PangoGlyph: + * + * A #PangoGlyph represents a single glyph in the output form of a string. + */ typedef guint32 PangoGlyph; +/** + * 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 + * 1024, but this may be changed in the future. + * + * When setting font sizes, device units are always considered to be + * points (as in "12 point font"), rather than pixels. + */ +/** + * PANGO_PIXELS: + * @d: a dimension in Pango units. + * + * Converts a dimension to device units by rounding. + * + * Return value: rounded dimension in device units. + */ +/** + * PANGO_PIXELS_FLOOR: + * @d: a dimension in Pango units. + * + * Converts a dimension to device units by flooring. + * + * Return value: floored dimension in device units. + * Since: 1.14 + */ +/** + * PANGO_PIXELS_CEIL: + * @d: a dimension in Pango units. + * + * Converts a dimension to device units by ceiling. + * + * Return value: ceiled dimension in device units. + * Since: 1.14 + */ #define PANGO_SCALE 1024 #define PANGO_PIXELS(d) (((int)(d) + 512) >> 10) #define PANGO_PIXELS_FLOOR(d) (((int)(d)) >> 10) @@ -57,6 +100,16 @@ typedef guint32 PangoGlyph; * PANGO_PIXELS also behaves differently for +512 and -512. */ +/** + * PANGO_UNITS_ROUND: + * @d: a dimension in Pango units. + * + * Rounds a dimension to whole device units, but does not + * convert it to device units. + * + * Return value: rounded dimension in Pango units. + * Since: 1.18 + */ #define PANGO_UNITS_ROUND(d) \ (((d) + (PANGO_SCALE >> 1)) & ~(PANGO_SCALE - 1)) @@ -66,8 +119,17 @@ double pango_units_to_double (int i) G_GNUC_CONST; -/* A rectangle. Used to store logical and physical extents of glyphs, - * runs, strings, etc. +/** + * PangoRectangle: + * @x: X coordinate of the left side of the rectangle. + * @y: Y coordinate of the the top side of the rectangle. + * @width: width of the rectangle. + * @height: height of the rectangle. + * + * 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()) + * */ struct _PangoRectangle { @@ -79,6 +141,44 @@ struct _PangoRectangle /* Macros to translate from extents rectangles to ascent/descent/lbearing/rbearing */ +/** + * PANGO_ASCENT: + * @rect: a #PangoRectangle + * + * Extracts the <firstterm>ascent</firstterm> 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: + * @rect: a #PangoRectangle + * + * Extracts the <firstterm>descent</firstterm> 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: + * @rect: a #PangoRectangle + * + * Extracts the <firstterm>left bearing</firstterm> from a #PangoRectangle + * representing glyph extents. The left bearing 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: + * @rect: a #PangoRectangle + * + * Extracts the <firstterm>right bearing</firstterm> from a #PangoRectangle + * representing glyph extents. The right bearing is the distance from the + * horizontal origin to the farthest right point of the character. + * This is positive except for characters drawn completely to the left of the + * horizontal origin. + */ #define PANGO_ASCENT(rect) (-(rect).y) #define PANGO_DESCENT(rect) ((rect).y + (rect).height) #define PANGO_LBEARING(rect) ((rect).x) |