2 * pango-gravity.h: Gravity routines
4 * Copyright (C) 2006, 2007 Red Hat Software
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef __PANGO_GRAVITY_H__
23 #define __PANGO_GRAVITY_H__
31 * @PANGO_GRAVITY_SOUTH: Glyphs stand upright (default)
32 * @PANGO_GRAVITY_EAST: Glyphs are rotated 90 degrees clockwise
33 * @PANGO_GRAVITY_NORTH: Glyphs are upside-down
34 * @PANGO_GRAVITY_WEST: Glyphs are rotated 90 degrees counter-clockwise
35 * @PANGO_GRAVITY_AUTO: Gravity is resolved from the context matrix
37 * The #PangoGravity type represents the orientation of glyphs in a segment
38 * of text. This is useful when rendering vertical text layouts. In
39 * those situations, the layout is rotated using a non-identity PangoMatrix,
40 * and then glyph orientation is controlled using #PangoGravity.
41 * Not every value in this enumeration makes sense for every usage of
42 * #PangoGravity; for example, %PANGO_GRAVITY_AUTO only can be passed to
43 * pango_context_set_base_gravity() and can only be returned by
44 * pango_context_get_base_gravity().
46 * See also: #PangoGravityHint
60 * @PANGO_GRAVITY_HINT_NATURAL: scripts will take their natural gravity based
61 * on the base gravity and the script. This is the default.
62 * @PANGO_GRAVITY_HINT_STRONG: always use the base gravity set, regardless of
64 * @PANGO_GRAVITY_HINT_LINE: for scripts not in their natural direction (eg.
65 * Latin in East gravity), choose per-script gravity such that every script
66 * respects the line progression. This means, Latin and Arabic will take
67 * opposite gravities and both flow top-to-bottom for example.
69 * The #PangoGravityHint defines how horizontal scripts should behave in a
70 * vertical context. That is, English excerpt in a vertical paragraph for
78 PANGO_GRAVITY_HINT_NATURAL,
79 PANGO_GRAVITY_HINT_STRONG,
80 PANGO_GRAVITY_HINT_LINE
84 * PANGO_GRAVITY_IS_VERTICAL:
85 * @gravity: the #PangoGravity to check
87 * Whether a #PangoGravity represents vertical writing directions.
89 * Returns: %TRUE if @gravity is %PANGO_GRAVITY_EAST or %PANGO_GRAVITY_WEST,
94 #define PANGO_GRAVITY_IS_VERTICAL(gravity) \
95 ((gravity) == PANGO_GRAVITY_EAST || (gravity) == PANGO_GRAVITY_WEST)
97 #include <pango/pango-matrix.h>
98 #include <pango/pango-script.h>
100 double pango_gravity_to_rotation (PangoGravity gravity) G_GNUC_CONST;
101 PangoGravity pango_gravity_get_for_matrix (const PangoMatrix *matrix) G_GNUC_PURE;
102 PangoGravity pango_gravity_get_for_script (PangoScript script,
103 PangoGravity base_gravity,
104 PangoGravityHint hint) G_GNUC_CONST;
105 PangoGravity pango_gravity_get_for_script_and_width
108 PangoGravity base_gravity,
109 PangoGravityHint hint) G_GNUC_CONST;
114 #endif /* __PANGO_GRAVITY_H__ */