2006-08-15 Behdad Esfahbod <behdad@gnome.org>
+ * docs/pango-sections.txt:
+ * docs/tmpl/main.sgml:
+ * examples/renderdemo.c (parse_gravity), (parse_options):
+ * pango/pango-context.c (pango_context_init),
+ (pango_context_get_base_gravity), (itemize_state_add_character):
+ * pango/pango-types.h:
+ * pango/pangocairo-fcfont.c (pango_cairo_fc_font_get_scaled_font):
+ * pango/pangofc-fontmap.c (pango_fc_make_pattern):
+ Oops. Exchange west<->east and north<->south gravities. The gravity
+ is the side that the glyph sits on. So, for normal Latin text for
+ example, gravity is south, not north.
+
+2006-08-15 Behdad Esfahbod <behdad@gnome.org>
+
* examples/renderdemo.c (do_output), (parse_gravity),
(parse_options): Support --gravity.
<SUBSECTION Private>
pango_direction_get_type
pango_context_get_type
+pango_gravity_get_type
pango_item_get_type
</SECTION>
@lang_engine: the engine for doing rendering-system-independent processing.
@font: the font for this segment.
@level: the bidrectional level for this segment.
+@gravity: the glyph orientation for this segment.
@language: the detected language for this segment.
@extra_attrs: extra attributes for this segment.
+<!-- ##### ENUM PangoGravity ##### -->
+<para>
+</para>
+
+@PANGO_GRAVITY_SOUTH:
+@PANGO_GRAVITY_EAST:
+@PANGO_GRAVITY_NORTH:
+@PANGO_GRAVITY_WEST:
+
+<!-- ##### MACRO PANGO_TYPE_GRAVITY ##### -->
+<para>
+The #GObject type for #PangoGravity.
+</para>
+
+
+
<!-- ##### FUNCTION pango_itemize ##### -->
<para>
@direction:
+<!-- ##### FUNCTION pango_context_get_base_gravity ##### -->
+<para>
+
+</para>
+
+@context:
+@Returns:
+
+
+<!-- ##### FUNCTION pango_context_set_base_gravity ##### -->
+<para>
+
+</para>
+
+@context:
+@gravity:
+
+
<!-- ##### FUNCTION pango_context_get_matrix ##### -->
<para>
int opt_indent = 0;
int opt_runs = 1;
PangoEllipsizeMode opt_ellipsize = PANGO_ELLIPSIZE_NONE;
-PangoGravity opt_gravity = PANGO_GRAVITY_NORTH;
+PangoGravity opt_gravity = PANGO_GRAVITY_SOUTH;
HintMode opt_hinting = HINT_DEFAULT;
PangoWrapMode opt_wrap = PANGO_WRAP_WORD_CHAR;
gboolean opt_wrap_set = FALSE;
g_set_error(error,
G_OPTION_ERROR,
G_OPTION_ERROR_BAD_VALUE,
- "Argument for --gravity must be one of north/west/south/east");
+ "Argument for --gravity must be one of south/east/north/west");
ret = FALSE;
}
{"font", 0, 0, G_OPTION_ARG_STRING, &opt_font,
"Set the font description", "description"},
{"gravity", 0, 0, G_OPTION_ARG_CALLBACK, &parse_gravity,
- "Gravity", "north/west/south/east"},
+ "Gravity", "south/east/north/west"},
{"header", 0, 0, G_OPTION_ARG_NONE, &opt_header,
"Display the options in the output", NULL},
{"hinting", 0, 0, G_OPTION_ARG_CALLBACK, &parse_hinting,
pango_context_init (PangoContext *context)
{
context->base_dir = PANGO_DIRECTION_WEAK_LTR;
- context->base_gravity = PANGO_GRAVITY_NORTH;
+ context->base_gravity = PANGO_GRAVITY_SOUTH;
context->language = NULL;
context->font_map = NULL;
PangoGravity
pango_context_get_base_gravity (PangoContext *context)
{
- g_return_val_if_fail (context != NULL, PANGO_GRAVITY_NORTH);
+ g_return_val_if_fail (context != NULL, PANGO_GRAVITY_SOUTH);
return context->base_gravity;
}
*/
switch (state->item->analysis.gravity)
{
- case PANGO_GRAVITY_NORTH:
- case PANGO_GRAVITY_WEST:
- default:
- break;
case PANGO_GRAVITY_SOUTH:
case PANGO_GRAVITY_EAST:
+ default:
+ break;
+ case PANGO_GRAVITY_NORTH:
+ case PANGO_GRAVITY_WEST:
state->item->analysis.level++;
}
/**
* PangoGravity:
- * @PANGO_GRAVITY_NORTH: Glyphs stand upright (default)
- * @PANGO_GRAVITY_WEST: Glyphs are rotated 90 degrees clockwise
- * @PANGO_GRAVITY_SOUTH: Glyphs are upside-down
- * @PANGO_GRAVITY_EAST: Glyphs are rotated 90 degrees counter-clockwise
+ * @PANGO_GRAVITY_SOUTH: Glyphs stand upright (default)
+ * @PANGO_GRAVITY_EAST: Glyphs are rotated 90 degrees clockwise
+ * @PANGO_GRAVITY_NORTH: Glyphs are upside-down
+ * @PANGO_GRAVITY_WEST: Glyphs are rotated 90 degrees counter-clockwise
*
- * The #PangoGravity type represents the direction that the glyphs are
- * rotated. This is useful when rendering vertical text layouts. In
+ * The #PangoGravity type represents the orientation of glyphs in a segment
+ * 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 rotation is controlled using #PangoGravity.
+ * and then glyph orientation is controlled using #PangoGravity.
**/
typedef enum {
- PANGO_GRAVITY_NORTH,
- PANGO_GRAVITY_WEST,
PANGO_GRAVITY_SOUTH,
- PANGO_GRAVITY_EAST
+ PANGO_GRAVITY_EAST,
+ PANGO_GRAVITY_NORTH,
+ PANGO_GRAVITY_WEST
} PangoGravity;
#define PANGO_TYPE_LANGUAGE (pango_language_get_type ())
if (!cffont->scaled_font)
return NULL;
- if (cffont->gravity != PANGO_GRAVITY_NORTH)
+ if (cffont->gravity != PANGO_GRAVITY_SOUTH)
{
cairo_font_extents_t metrics;
cairo_matrix_t matrix;
switch (cffont->gravity)
{
- case PANGO_GRAVITY_NORTH:
+ case PANGO_GRAVITY_SOUTH:
default:
break;
- case PANGO_GRAVITY_SOUTH:
+ case PANGO_GRAVITY_NORTH:
cairo_matrix_rotate(&matrix, M_PI);
break;
- case PANGO_GRAVITY_WEST:
+ case PANGO_GRAVITY_EAST:
cairo_matrix_rotate(&matrix, -M_PI_2);
break;
- case PANGO_GRAVITY_EAST:
+ case PANGO_GRAVITY_WEST:
cairo_matrix_rotate(&matrix, +M_PI_2);
break;
}
switch (gravity)
{
- case PANGO_GRAVITY_NORTH:
case PANGO_GRAVITY_SOUTH:
+ case PANGO_GRAVITY_NORTH:
default:
vertical = FcFalse;
break;
- case PANGO_GRAVITY_WEST:
case PANGO_GRAVITY_EAST:
+ case PANGO_GRAVITY_WEST:
vertical = FcTrue;
break;
}