Oops. Exchange west<->east and north<->south gravities. The gravity is the
authorBehdad Esfahbod <behdad@gnome.org>
Tue, 15 Aug 2006 13:03:04 +0000 (13:03 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Tue, 15 Aug 2006 13:03:04 +0000 (13:03 +0000)
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.

ChangeLog
docs/pango-sections.txt
docs/tmpl/main.sgml
examples/renderdemo.c
pango/pango-context.c
pango/pango-types.h
pango/pangocairo-fcfont.c
pango/pangofc-fontmap.c

index 19d9061..b9d8beb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 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.
 
index edd813e..7364aa0 100644 (file)
@@ -60,6 +60,7 @@ pango_shape
 <SUBSECTION Private>
 pango_direction_get_type
 pango_context_get_type
+pango_gravity_get_type
 pango_item_get_type
 </SECTION>
 
index ab47b4d..0751fc7 100644 (file)
@@ -50,6 +50,7 @@ fields:
 @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.
 
@@ -72,6 +73,22 @@ The #GObject type for #PangoDirection.
 
 
 
+<!-- ##### 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>
 
@@ -226,6 +243,24 @@ The #GObject type for #PangoDirection.
 @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>
 
index 1378161..e77ddce 100644 (file)
@@ -56,7 +56,7 @@ int opt_width = -1;
 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;
@@ -401,7 +401,7 @@ parse_gravity (const char *name,
         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;
     }
 
@@ -582,7 +582,7 @@ parse_options (int argc, char *argv[])
     {"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,
index 34a91f4..f0fae76 100644 (file)
@@ -59,7 +59,7 @@ static void
 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;
 
@@ -435,7 +435,7 @@ pango_context_set_base_gravity (PangoContext  *context,
 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;
 }
@@ -887,12 +887,12 @@ itemize_state_add_character (ItemizeState     *state,
    */
   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++;
     }
 
index 4ab528c..3c8233d 100644 (file)
@@ -183,21 +183,21 @@ typedef enum {
 
 /**
  * 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 ())
index 4169930..488dca0 100644 (file)
@@ -134,7 +134,7 @@ pango_cairo_fc_font_get_scaled_font (PangoCairoFont *font)
       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;
@@ -147,16 +147,16 @@ pango_cairo_fc_font_get_scaled_font (PangoCairoFont *font)
 
          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;
            }
index a681eea..93f4959 100644 (file)
@@ -814,13 +814,13 @@ pango_fc_make_pattern (const  PangoFontDescription *description,
 
   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;
     }