diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-08-16 07:23:08 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-08-16 07:23:08 +0000 |
commit | bb26941a468b994331286a55d41447cc2ef9326f (patch) | |
tree | 7e38be8a1800f49aeed0e0b54e8e74524124a46c /pango/pango-types.h | |
parent | 292545e94970319545d1a2d8a5ebb700ade67565 (diff) | |
download | pango-bb26941a468b994331286a55d41447cc2ef9326f.tar.gz |
Render block progression and line direction arrows, and a base gravity
2006-08-16 Behdad Esfahbod <behdad@gnome.org>
* examples/viewer-pangocairo.c (render_callback): Render block
progression and line direction arrows, and a base gravity roof-top.
* pango/pango-matrix.c (pango_matrix_to_gravity): New function.
* pango/pango-utils.c (pango_gravity_to_rotation): New function.
* pango/pangocairo-fcfont.c (_pango_cairo_fc_font_new): Use
pango_gravity_to_rotation().
* pango/pango-utils.h:
* pango/pango-types.h:
Reorder a bit.
* examples/Makefile.am:
* examples/test-chinese.txt: New test text for Chinese.
* pango/check.defs: New script that checks that all the exported
symbols are listed in the respective .def file. (only checks the
libraries actually built. No win32 for example.)
* pango/Makefile.am: Hook check.defs as a 'make check' test.
* pango/pango.def:
* pango/pangoft2.def:
* pango/pangocairo.def:
Update.
* docs/tmpl/glyphs.sgml:
* docs/tmpl/main.sgml:
* docs/pango-sections.txt:
Update.
Diffstat (limited to 'pango/pango-types.h')
-rw-r--r-- | pango/pango-types.h | 216 |
1 files changed, 121 insertions, 95 deletions
diff --git a/pango/pango-types.h b/pango/pango-types.h index 3c8233d5..9d4caba6 100644 --- a/pango/pango-types.h +++ b/pango/pango-types.h @@ -38,92 +38,12 @@ typedef struct _PangoFontMap PangoFontMap; typedef struct _PangoMatrix PangoMatrix; typedef struct _PangoRectangle PangoRectangle; -/* Dummy typedef - internally it's a 'const char *' */ -typedef struct _PangoLanguage PangoLanguage; - -/* A index of a glyph into a font. Rendering system dependent - */ -typedef guint32 PangoGlyph; - -/* A rectangle. Used to store logical and physical extents of glyphs, - * runs, strings, etc. - */ -struct _PangoRectangle -{ - int x; - int y; - int width; - int height; -}; - -/** - * PangoMatrix: - * @xx: 1st component of the transformation matrix - * @xy: 2nd component of the transformation matrix - * @yx: 3rd component of the transformation matrix - * @yy: 4th component of the transformation matrix - * @x0: x translation - * @y0: y translation - * - * A structure specifying a transformation between user-space - * coordinates and device coordinates. The transformation - * is given by - * - * <programlisting> - * x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0; - * y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0; - * </programlisting> - * - * Since: 1.6 - **/ -struct _PangoMatrix -{ - double xx; - double xy; - double yx; - double yy; - double x0; - double y0; -}; - -/** - * PANGO_TYPE_MATRIX - * - * The GObject type for #PangoMatrix - **/ -#define PANGO_TYPE_MATRIX (pango_matrix_get_type ()) -/** - * PANGO_MATRIX_INIT - * - * Constant that can be used to initialize a PangoMatrix to - * the identity transform. - * - * <informalexample><programlisting> - * PangoMatrix matrix = PANGO_MATRIX_INIT; - * pango_matrix_rotate (&matrix, 45.); - * </programlisting></informalexample> - * - * Since: 1.6 - **/ -#define PANGO_MATRIX_INIT { 1., 0., 0., 1., 0., 0. } -GType pango_matrix_get_type (void); +/* A index of a glyph into a font. Rendering system dependent */ +typedef guint32 PangoGlyph; -PangoMatrix *pango_matrix_copy (const PangoMatrix *matrix); -void pango_matrix_free (PangoMatrix *matrix); -void pango_matrix_translate (PangoMatrix *matrix, - double tx, - double ty); -void pango_matrix_scale (PangoMatrix *matrix, - double scale_x, - double scale_y); -void pango_matrix_rotate (PangoMatrix *matrix, - double degrees); -void pango_matrix_concat (PangoMatrix *matrix, - const PangoMatrix *new_matrix); -double pango_matrix_get_font_scale_factor (const PangoMatrix *matrix); #define PANGO_SCALE 1024 #define PANGO_PIXELS(d) (((int)(d) + 512) >> 10) @@ -136,6 +56,40 @@ double pango_matrix_get_font_scale_factor (const PangoMatrix *matrix); * integers and floating point. */ +/* Hint line position and thickness. + */ +void pango_quantize_line_geometry (int *thickness, + int *position); + + + +/* Dummy typedef - internally it's a 'const char *' */ +typedef struct _PangoLanguage PangoLanguage; + +#define PANGO_TYPE_LANGUAGE (pango_language_get_type ()) + +GType pango_language_get_type (void); +PangoLanguage *pango_language_from_string (const char *language); +#define pango_language_to_string(language) ((const char *)language) + +G_CONST_RETURN char *pango_language_get_sample_string (PangoLanguage *language); + +gboolean pango_language_matches (PangoLanguage *language, + const char *range_list); + + + +/* A rectangle. Used to store logical and physical extents of glyphs, + * runs, strings, etc. + */ +struct _PangoRectangle +{ + int x; + int y; + int width; + int height; +}; + /* Macros to translate from extents rectangles to ascent/descent/lbearing/rbearing */ #define PANGO_ASCENT(rect) (-(rect).y) @@ -143,6 +97,8 @@ double pango_matrix_get_font_scale_factor (const PangoMatrix *matrix); #define PANGO_LBEARING(rect) ((rect).x) #define PANGO_RBEARING(rect) ((rect).x + (rect).width) + + /** * PangoDirection: * @PANGO_DIRECTION_LTR: A strong left-to-right direction @@ -181,6 +137,17 @@ typedef enum { PANGO_DIRECTION_NEUTRAL } PangoDirection; +PangoDirection pango_unichar_direction (gunichar ch); +PangoDirection pango_find_base_dir (const gchar *text, + gint length); + +#ifndef PANGO_DISABLE_DEPRECATED +gboolean pango_get_mirror_char (gunichar ch, + gunichar *mirrored_ch); +#endif + + + /** * PangoGravity: * @PANGO_GRAVITY_SOUTH: Glyphs stand upright (default) @@ -192,6 +159,8 @@ typedef enum { * of text. This is useful when rendering vertical text layouts. In * those situations, the layout is rotated using a non-identity PangoMatrix, * and then glyph orientation is controlled using #PangoGravity. + * + * Since: 1.16 **/ typedef enum { PANGO_GRAVITY_SOUTH, @@ -200,24 +169,81 @@ typedef enum { PANGO_GRAVITY_WEST } PangoGravity; -#define PANGO_TYPE_LANGUAGE (pango_language_get_type ()) +double pango_gravity_to_rotation (PangoGravity gravity); -GType pango_language_get_type (void); -PangoLanguage *pango_language_from_string (const char *language); -#define pango_language_to_string(language) ((const char *)language) -gboolean pango_language_matches (PangoLanguage *language, - const char *range_list); -#ifndef PANGO_DISABLE_DEPRECATED -gboolean pango_get_mirror_char (gunichar ch, - gunichar *mirrored_ch); -#endif +/** + * PangoMatrix: + * @xx: 1st component of the transformation matrix + * @xy: 2nd component of the transformation matrix + * @yx: 3rd component of the transformation matrix + * @yy: 4th component of the transformation matrix + * @x0: x translation + * @y0: y translation + * + * A structure specifying a transformation between user-space + * coordinates and device coordinates. The transformation + * is given by + * + * <programlisting> + * x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0; + * y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0; + * </programlisting> + * + * Since: 1.6 + **/ +struct _PangoMatrix +{ + double xx; + double xy; + double yx; + double yy; + double x0; + double y0; +}; + +/** + * PANGO_TYPE_MATRIX + * + * The GObject type for #PangoMatrix + **/ +#define PANGO_TYPE_MATRIX (pango_matrix_get_type ()) + +/** + * PANGO_MATRIX_INIT + * + * Constant that can be used to initialize a PangoMatrix to + * the identity transform. + * + * <informalexample><programlisting> + * PangoMatrix matrix = PANGO_MATRIX_INIT; + * pango_matrix_rotate (&matrix, 45.); + * </programlisting></informalexample> + * + * Since: 1.6 + **/ +#define PANGO_MATRIX_INIT { 1., 0., 0., 1., 0., 0. } + +GType pango_matrix_get_type (void); + +PangoMatrix *pango_matrix_copy (const PangoMatrix *matrix); +void pango_matrix_free (PangoMatrix *matrix); + +void pango_matrix_translate (PangoMatrix *matrix, + double tx, + double ty); +void pango_matrix_scale (PangoMatrix *matrix, + double scale_x, + double scale_y); +void pango_matrix_rotate (PangoMatrix *matrix, + double degrees); +void pango_matrix_concat (PangoMatrix *matrix, + const PangoMatrix *new_matrix); +double pango_matrix_get_font_scale_factor (const PangoMatrix *matrix); +PangoGravity pango_matrix_to_gravity (const PangoMatrix *matrix); -PangoDirection pango_unichar_direction (gunichar ch); -PangoDirection pango_find_base_dir (const gchar *text, - gint length); G_END_DECLS |