summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog35
-rw-r--r--docs/pango-sections.txt2
-rw-r--r--docs/tmpl/glyphs.sgml9
-rw-r--r--docs/tmpl/main.sgml9
-rw-r--r--examples/Makefile.am1
-rw-r--r--examples/test-chinese.txt7
-rw-r--r--examples/viewer-pangocairo.c114
-rw-r--r--pango/Makefile.am2
-rwxr-xr-xpango/check.defs23
-rw-r--r--pango/pango-context.c4
-rw-r--r--pango/pango-matrix.c28
-rw-r--r--pango/pango-types.h216
-rw-r--r--pango/pango-utils.c31
-rw-r--r--pango/pango-utils.h7
-rw-r--r--pango/pango.def9
-rw-r--r--pango/pangocairo-fcfont.c13
-rw-r--r--pango/pangocairo.def3
-rw-r--r--pango/pangoft2.def3
18 files changed, 382 insertions, 134 deletions
diff --git a/ChangeLog b/ChangeLog
index c2c512d5..3f3e2b00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,40 @@
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.
+
+2006-08-16 Behdad Esfahbod <behdad@gnome.org>
+
* modules/basic/basic-fc.c (fallback_shape): Remove redundant
positioning block!
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt
index 7364aa08..eb67adef 100644
--- a/docs/pango-sections.txt
+++ b/docs/pango-sections.txt
@@ -39,6 +39,7 @@ pango_context_list_families
pango_get_mirror_char
pango_unichar_direction
pango_find_base_dir
+pango_gravity_to_rotation
<SUBSECTION Standard>
PANGO_TYPE_CONTEXT
PangoContextClass
@@ -86,6 +87,7 @@ pango_matrix_scale
pango_matrix_rotate
pango_matrix_concat
pango_matrix_get_font_scale_factor
+pango_matrix_to_gravity
PangoGlyph
PANGO_GLYPH_EMPTY
PANGO_GLYPH_UNKNOWN_FLAG
diff --git a/docs/tmpl/glyphs.sgml b/docs/tmpl/glyphs.sgml
index 54daf25e..a2c8f087 100644
--- a/docs/tmpl/glyphs.sgml
+++ b/docs/tmpl/glyphs.sgml
@@ -207,6 +207,15 @@ horizontal origin.
@Returns:
+<!-- ##### FUNCTION pango_matrix_to_gravity ##### -->
+<para>
+
+</para>
+
+@matrix:
+@Returns:
+
+
<!-- ##### TYPEDEF PangoGlyph ##### -->
<para>
A #PangoGlyph represents a single glyph in the output form of a string.
diff --git a/docs/tmpl/main.sgml b/docs/tmpl/main.sgml
index 4444b786..24487182 100644
--- a/docs/tmpl/main.sgml
+++ b/docs/tmpl/main.sgml
@@ -352,6 +352,15 @@ The #GObject type for #PangoGravity.
@Returns:
+<!-- ##### FUNCTION pango_gravity_to_rotation ##### -->
+<para>
+
+</para>
+
+@gravity:
+@Returns:
+
+
<!-- ##### FUNCTION pango_break ##### -->
<para>
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 3b8dfea7..9a3a10b8 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -2,6 +2,7 @@
TEST_TEXTS = \
test-arabic.txt \
+ test-chinese.txt \
test-devanagari.txt \
test-hebrew.txt \
test-ipa.txt \
diff --git a/examples/test-chinese.txt b/examples/test-chinese.txt
new file mode 100644
index 00000000..d4fb796a
--- /dev/null
+++ b/examples/test-chinese.txt
@@ -0,0 +1,7 @@
+你好,这是中文竖排测试。
+欢迎来到中国北京。
+白日依山尽,
+黄河入海流。
+欲穷千里目,
+更上一层楼。
+谢谢!
diff --git a/examples/viewer-pangocairo.c b/examples/viewer-pangocairo.c
index 82b8f05e..8420f8cc 100644
--- a/examples/viewer-pangocairo.c
+++ b/examples/viewer-pangocairo.c
@@ -142,44 +142,119 @@ render_callback (PangoLayout *layout,
cairo_save (cr);
cairo_translate (cr, x, y);
- pango_cairo_show_layout (cr,
- layout);
if (show_borders)
{
+ cairo_pattern_t *pattern;
PangoRectangle ink, logical;
double lw = cairo_get_line_width (cr);
PangoLayoutIter* iter;
pango_layout_get_extents (layout, &ink, &logical);
- cairo_set_source_rgba (cr, 1.0, 0.0, 0.0, 0.5);
- cairo_rectangle (cr,
- (double)logical.x / PANGO_SCALE - lw / 2,
- (double)logical.y / PANGO_SCALE - lw / 2,
- (double)logical.width / PANGO_SCALE + lw,
- (double)logical.height / PANGO_SCALE + lw);
+ /* draw resolved gravity "roof" in blue */
+ cairo_save (cr);
+ cairo_translate (cr,
+ (double)logical.x / PANGO_SCALE,
+ (double)logical.y / PANGO_SCALE);
+ cairo_scale (cr,
+ (double)logical.width / PANGO_SCALE * 0.5,
+ (double)logical.height / PANGO_SCALE * 0.5);
+ cairo_translate (cr, 1.0, 1.0);
+ cairo_rotate (cr,
+ pango_gravity_to_rotation (
+ pango_context_get_base_gravity (
+ pango_layout_get_context (layout))));
+ cairo_move_to (cr, -1.0, -1.1);
+ cairo_rel_line_to (cr, +1.0, -0.2); /* / */
+ cairo_rel_line_to (cr, +1.0, +0.2); /* \ */
+ cairo_close_path (cr); /* - */
+ pattern = cairo_pattern_create_linear (0, -1.1, 0, -1.3);
+ cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0.0, 1.0, 0.0);
+ cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0.0, 1.0, 0.15);
+ cairo_set_source (cr, pattern);
+ cairo_fill_preserve (cr);
+ /* silly line_width is not locked :(. get rid of scale. */
+ cairo_restore (cr);
+ cairo_save (cr);
+ cairo_set_source_rgba (cr, 0.0, 0.0, 0.7, 0.2);
+ cairo_stroke (cr);
+ cairo_restore (cr);
+
+
+ /* draw block progression arrow in green */
+ cairo_save (cr);
+ cairo_translate (cr,
+ (double)logical.x / PANGO_SCALE,
+ (double)logical.y / PANGO_SCALE);
+ cairo_scale (cr,
+ (double)logical.width / PANGO_SCALE * 0.5,
+ (double)logical.height / PANGO_SCALE * 0.5);
+ cairo_translate (cr, 1.0, 1.0);
+ cairo_move_to (cr, -0.4, -0.7);
+ cairo_rel_line_to (cr, +0.8, 0.0); /* -- */
+ cairo_rel_line_to (cr, 0.0, +0.9); /* | */
+ cairo_rel_line_to (cr, +0.4, 0.0); /* - */
+ cairo_rel_line_to (cr, -0.8, +0.5); /* / */
+ cairo_rel_line_to (cr, -0.8, -0.5); /* \ */
+ cairo_rel_line_to (cr, +0.4, 0.0); /* - */
+ cairo_close_path (cr); /* | */
+ pattern = cairo_pattern_create_linear (0, -0.7, 0, 0.7);
+ cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 1.0, 0.0, 0.0);
+ cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 1.0, 0.0, 0.15);
+ cairo_set_source (cr, pattern);
+ cairo_fill_preserve (cr);
+ /* silly line_width is not locked :(. get rid of scale. */
+ cairo_restore (cr);
+ cairo_save (cr);
+ cairo_set_source_rgba (cr, 0.0, 0.7, 0.0, 0.2);
cairo_stroke (cr);
+ cairo_restore (cr);
+ /* draw baselines with line direction arrow in orange */
cairo_save (cr);
- cairo_set_line_width (cr, lw / 2);
- cairo_set_source_rgba (cr, 0.4, 0.4, 1.0, 0.75);
+ cairo_set_source_rgba (cr, 1.0, 0.5, 0.0, 0.5);
iter = pango_layout_get_iter (layout);
do
{
+ PangoLayoutLine *line = pango_layout_iter_get_line (iter);
+ double width = (double)logical.width / PANGO_SCALE;
+
y = pango_layout_iter_get_baseline (iter);
- cairo_move_to (cr,
- (double)logical.x / PANGO_SCALE,
- (double)y / PANGO_SCALE + lw / 4);
- cairo_rel_line_to (cr,
- (double)logical.width / PANGO_SCALE,
- 0);
- cairo_stroke (cr);
+ cairo_save (cr);
+ cairo_translate (cr,
+ (double)logical.x / PANGO_SCALE + width * 0.5,
+ (double)y / PANGO_SCALE);
+ if (line->resolved_dir)
+ cairo_scale (cr, -1, 1);
+ cairo_move_to (cr, -width * .5, -lw*0.2);
+ cairo_rel_line_to (cr, +width * .9, -lw*0.3);
+ cairo_rel_line_to (cr, 0, -lw);
+ cairo_rel_line_to (cr, +width * .1, +lw*1.5);
+ cairo_rel_line_to (cr, -width * .1, +lw*1.5);
+ cairo_rel_line_to (cr, 0, -lw);
+ cairo_rel_line_to (cr, -width * .9, -lw*0.3);
+ cairo_close_path (cr);
+ cairo_fill (cr);
+ cairo_restore (cr);
}
while (pango_layout_iter_next_line (iter));
pango_layout_iter_free (iter);
cairo_restore (cr);
+ /* draw the logical rect in red */
+ cairo_save (cr);
+ cairo_set_source_rgba (cr, 1.0, 0.0, 0.0, 0.5);
+ cairo_rectangle (cr,
+ (double)logical.x / PANGO_SCALE - lw / 2,
+ (double)logical.y / PANGO_SCALE - lw / 2,
+ (double)logical.width / PANGO_SCALE + lw,
+ (double)logical.height / PANGO_SCALE + lw);
+ cairo_stroke (cr);
+ cairo_restore (cr);
+
+ /* draw the ink rect in green */
+ cairo_save (cr);
cairo_set_source_rgba (cr, 0.0, 1.0, 0.0, 0.5);
cairo_rectangle (cr,
(double)ink.x / PANGO_SCALE - lw / 2,
@@ -187,8 +262,11 @@ render_callback (PangoLayout *layout,
(double)ink.width / PANGO_SCALE + lw,
(double)ink.height / PANGO_SCALE + lw);
cairo_stroke (cr);
-
+ cairo_restore (cr);
}
+
+ pango_cairo_show_layout (cr, layout);
+
cairo_restore (cr);
}
diff --git a/pango/Makefile.am b/pango/Makefile.am
index e2b9bd11..728b2fe1 100644
--- a/pango/Makefile.am
+++ b/pango/Makefile.am
@@ -481,3 +481,5 @@ if DISABLE_EXPLICIT_DEPS
endif
uninstall-local: uninstall-ms-lib uninstall-def-files
+
+TESTS = check.defs
diff --git a/pango/check.defs b/pango/check.defs
new file mode 100755
index 00000000..a4d0a67f
--- /dev/null
+++ b/pango/check.defs
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+LANG=C
+
+test -z "$srcdir" && srcdir=.
+status=0
+
+for def in $srcdir/*.def; do
+ lib=${def%.def}
+ lib=${lib##*/}
+ so=.libs/lib${lib}-1.0.so
+
+ test -f $so || continue
+ echo Checking $def
+
+ nm $so | grep ' T ' | cut -d' ' -f3 | sort -u > NM
+ cut -f 2 $def | grep -v '^EXPORTS$' > DEF
+
+ diff DEF NM || status=1
+ rm -f DEF NM
+done
+
+exit $status
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 31953c71..48c6980b 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -413,6 +413,8 @@ pango_context_get_base_dir (PangoContext *context)
* Sets the base gravity for the context.
*
* The base gravity is used in laying vertical text out.
+ *
+ * Since: 1.16
**/
void
pango_context_set_base_gravity (PangoContext *context,
@@ -431,6 +433,8 @@ pango_context_set_base_gravity (PangoContext *context,
* pango_context_set_base_gravity().
*
* Return value: the base gravity for the context.
+ *
+ * Since: 1.16
**/
PangoGravity
pango_context_get_base_gravity (PangoContext *context)
diff --git a/pango/pango-matrix.c b/pango/pango-matrix.c
index 58be83e1..322a4931 100644
--- a/pango/pango-matrix.c
+++ b/pango/pango-matrix.c
@@ -20,6 +20,7 @@
*/
#include <config.h>
+#include <stdlib.h>
#include <math.h>
#include "pango-types.h"
@@ -248,3 +249,30 @@ pango_matrix_get_font_scale_factor (const PangoMatrix *matrix)
return minor;
}
}
+
+/**
+ * pango_matrix_to_gravity:
+ * @matrix: a #PangoMatrix
+ *
+ * Finds the gravity that best matches the rotation component
+ * in a #PangoMatrix.
+ *
+ * Return value: the gravity of @matrix, which will never be
+ * %PANGO_GRAVITY_AUTO
+ *
+ * Since: 1.16
+ */
+PangoGravity
+pango_matrix_to_gravity (const PangoMatrix *matrix)
+{
+ PangoGravity gravity;
+ double x = matrix->xy;
+ double y = matrix->yy;
+
+ if (abs (x) > abs (y))
+ gravity = x < 0 ? PANGO_GRAVITY_WEST : PANGO_GRAVITY_EAST;
+ else
+ gravity = y < 0 ? PANGO_GRAVITY_NORTH : PANGO_GRAVITY_SOUTH;
+
+ return gravity;
+}
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 (&amp;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 (&amp;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
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index 63976aed..5e1fccdc 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -1,4 +1,4 @@
-/* Pango
+ /* Pango
* pango-utils.c: Utilities for internal functions and modules
*
* Copyright (C) 2000 Red Hat Software
@@ -23,6 +23,7 @@
#include <errno.h>
#include <string.h>
#include <stdlib.h>
+#include <math.h>
#include "pango-font.h"
#include "pango-impl-utils.h"
@@ -1625,3 +1626,31 @@ pango_quantize_line_geometry (int *thickness,
*thickness = thickness_pixels * PANGO_SCALE;
}
+
+/**
+ * pango_gravity_to_rotation:
+ * @gravity: gravity to query
+ *
+ * Converts a #PangoGravity value to its rotation value.
+ *
+ * Return value: the rotation value corresponding to @gravity,
+ * or zero if @gravity is #PANGO_GRAVITY_AUTO
+ *
+ * Since: 1.16
+ */
+double
+pango_gravity_to_rotation (PangoGravity gravity)
+{
+ double rotation;
+
+ switch (gravity)
+ {
+ default:
+ case PANGO_GRAVITY_SOUTH: rotation = 0; break;
+ case PANGO_GRAVITY_NORTH: rotation = M_PI; break;
+ case PANGO_GRAVITY_EAST: rotation = -M_PI_2; break;
+ case PANGO_GRAVITY_WEST: rotation = +M_PI_2; break;
+ }
+
+ return rotation;
+}
diff --git a/pango/pango-utils.h b/pango/pango-utils.h
index 13df824c..f0392f72 100644
--- a/pango/pango-utils.h
+++ b/pango/pango-utils.h
@@ -92,18 +92,11 @@ guint8 * pango_log2vis_get_embedding_levels (const gchar *text,
int length,
PangoDirection *pbase_dir);
-G_CONST_RETURN char *pango_language_get_sample_string (PangoLanguage *language);
-
/* Unicode characters that are zero-width and should not be rendered
* normally.
*/
gboolean pango_is_zero_width (gunichar ch) G_GNUC_CONST;
-/* Hint line position and thickness.
- */
-void pango_quantize_line_geometry (int *thickness,
- int *position);
-
G_END_DECLS
#endif /* __PANGO_UTILS_H__ */
diff --git a/pango/pango.def b/pango/pango.def
index d39b1805..32576db6 100644
--- a/pango/pango.def
+++ b/pango/pango.def
@@ -51,9 +51,9 @@ EXPORTS
pango_color_parse
pango_config_key_get
pango_context_get_base_dir
+ pango_context_get_base_gravity
pango_context_get_font_description
pango_context_get_font_map
- pango_context_get_gravity
pango_context_get_language
pango_context_get_matrix
pango_context_get_metrics
@@ -63,9 +63,9 @@ EXPORTS
pango_context_load_fontset
pango_context_new
pango_context_set_base_dir
+ pango_context_set_base_gravity
pango_context_set_font_description
pango_context_set_font_map
- pango_context_set_gravity
pango_context_set_language
pango_context_set_matrix
pango_coverage_copy
@@ -179,6 +179,8 @@ EXPORTS
pango_glyph_string_new
pango_glyph_string_set_size
pango_glyph_string_x_to_index
+ pango_gravity_get_type
+ pango_gravity_to_rotation
pango_is_zero_width
pango_item_copy
pango_item_free
@@ -275,6 +277,7 @@ EXPORTS
pango_matrix_get_type
pango_matrix_rotate
pango_matrix_scale
+ pango_matrix_to_gravity
pango_matrix_translate
pango_module_register
pango_parse_markup
@@ -309,7 +312,7 @@ EXPORTS
pango_script_get_type
pango_script_iter_free
pango_script_iter_get_range
- pango_script_iter_new
+ pango_script_iter_new
pango_script_iter_next
pango_shape
pango_skip_space
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c
index 0e503061..a0dec5c6 100644
--- a/pango/pangocairo-fcfont.c
+++ b/pango/pangocairo-fcfont.c
@@ -496,7 +496,7 @@ _pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap,
PangoCairoFcFont *cffont;
const PangoMatrix *pango_ctm;
FcMatrix *fc_matrix;
- double size, rotation;
+ double size;
g_return_val_if_fail (PANGO_IS_CAIRO_FC_FONT_MAP (cffontmap), NULL);
g_return_val_if_fail (pattern != NULL, NULL);
@@ -521,15 +521,8 @@ _pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap,
else
cairo_matrix_init_identity (&cffont->font_matrix);
- switch (cffont->gravity)
- {
- default:
- case PANGO_GRAVITY_SOUTH: rotation = 0; break;
- case PANGO_GRAVITY_NORTH: rotation = M_PI; break;
- case PANGO_GRAVITY_EAST: rotation = -M_PI_2; break;
- case PANGO_GRAVITY_WEST: rotation = +M_PI_2; break;
- }
- cairo_matrix_rotate(&cffont->font_matrix, rotation);
+ cairo_matrix_rotate(&cffont->font_matrix,
+ pango_gravity_to_rotation (cffont->gravity));
pango_ctm = pango_context_get_matrix (context);
diff --git a/pango/pangocairo.def b/pango/pangocairo.def
index 2b635888..f5e5af32 100644
--- a/pango/pangocairo.def
+++ b/pango/pangocairo.def
@@ -5,6 +5,8 @@ EXPORTS
pango_cairo_context_set_resolution
pango_cairo_create_layout
pango_cairo_error_underline_path
+ pango_cairo_fc_font_get_type
+ pango_cairo_fc_font_map_get_type
pango_cairo_font_get_type
pango_cairo_font_map_create_context
pango_cairo_font_map_get_default
@@ -15,6 +17,7 @@ EXPORTS
pango_cairo_glyph_string_path
pango_cairo_layout_line_path
pango_cairo_layout_path
+ pango_cairo_renderer_get_type
pango_cairo_show_error_underline
pango_cairo_show_glyph_string
pango_cairo_show_layout
diff --git a/pango/pangoft2.def b/pango/pangoft2.def
index b559627a..100909b7 100644
--- a/pango/pangoft2.def
+++ b/pango/pangoft2.def
@@ -1,6 +1,7 @@
EXPORTS
pango_fc_decoder_get_charset
pango_fc_decoder_get_glyph
+ pango_fc_decoder_get_type
pango_fc_font_create_metrics_for_context
pango_fc_font_description_from_pattern
pango_fc_font_get_glyph
@@ -19,6 +20,7 @@ EXPORTS
pango_ft2_font_get_coverage
pango_ft2_font_get_face
pango_ft2_font_get_kerning
+ pango_ft2_font_get_type
pango_ft2_font_map_create_context
pango_ft2_font_map_for_display
pango_ft2_font_map_get_type
@@ -34,6 +36,7 @@ EXPORTS
pango_ft2_render_layout_line_subpixel
pango_ft2_render_layout_subpixel
pango_ft2_render_transformed
+ pango_ft2_renderer_get_type
pango_ft2_shutdown_display
pango_ot_buffer_add_glyph
pango_ot_buffer_clear