gimp r27432 - in trunk: . app/pdb app/text app/tools libgimp libgimpbase tools/pdbgen tools/pdbgen/pdb



Author: neo
Date: Mon Oct 27 07:59:32 2008
New Revision: 27432
URL: http://svn.gnome.org/viewvc/gimp?rev=27432&view=rev

Log:
2008-10-27  Sven Neumann  <sven gimp org>

	* libgimpbase/gimpbaseenums.[ch]: added new enum 
GimpTextHintStyle.

	* libgimp/gimpenums.c.tail
	* tools/pdbgen/enums.pl: regenerated.

	* app/text/gimptext.[ch]: added new property "hint-style". 
Removed
	"autohint" property and mapped the boolean property "hinting" to
	the new enum property "hint-style".

	* app/text/gimptextlayout-render.c 
(gimp_text_layout_render_flags):
	use "hint-style".

	* app/tools/gimptextoptions.[ch]: changed tool options 
accordingly.

	* tools/pdbgen/pdb/text_layer.pdb: deprecated the "hinting" API
	and introduced getters and setters for "hint-style".

	* app/pdb/text-layer-cmds.c
	* app/pdb/internal-procs.c
	* libgimp/gimptextlayer_pdb.[ch]: regenerated.



Modified:
   trunk/ChangeLog
   trunk/app/pdb/internal-procs.c
   trunk/app/pdb/text-layer-cmds.c
   trunk/app/text/gimptext.c
   trunk/app/text/gimptext.h
   trunk/app/text/gimptextlayout-render.c
   trunk/app/tools/gimptextoptions.c
   trunk/app/tools/gimptextoptions.h
   trunk/libgimp/gimpenums.c.tail
   trunk/libgimp/gimptextlayer_pdb.c
   trunk/libgimp/gimptextlayer_pdb.h
   trunk/libgimpbase/gimpbaseenums.c
   trunk/libgimpbase/gimpbaseenums.h
   trunk/tools/pdbgen/enums.pl
   trunk/tools/pdbgen/pdb/text_layer.pdb

Modified: trunk/app/pdb/internal-procs.c
==============================================================================
--- trunk/app/pdb/internal-procs.c	(original)
+++ trunk/app/pdb/internal-procs.c	Mon Oct 27 07:59:32 2008
@@ -29,7 +29,7 @@
 #include "internal-procs.h"
 
 
-/* 593 procedures registered total */
+/* 595 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)

Modified: trunk/app/pdb/text-layer-cmds.c
==============================================================================
--- trunk/app/pdb/text-layer-cmds.c	(original)
+++ trunk/app/pdb/text-layer-cmds.c	Mon Oct 27 07:59:32 2008
@@ -327,18 +327,17 @@
 }
 
 static GValueArray *
-text_layer_get_hinting_invoker (GimpProcedure      *procedure,
-                                Gimp               *gimp,
-                                GimpContext        *context,
-                                GimpProgress       *progress,
-                                const GValueArray  *args,
-                                GError            **error)
+text_layer_get_antialias_invoker (GimpProcedure      *procedure,
+                                  Gimp               *gimp,
+                                  GimpContext        *context,
+                                  GimpProgress       *progress,
+                                  const GValueArray  *args,
+                                  GError            **error)
 {
   gboolean success = TRUE;
   GValueArray *return_vals;
   GimpLayer *layer;
-  gboolean hinting = FALSE;
-  gboolean autohint = FALSE;
+  gboolean antialias = FALSE;
 
   layer = gimp_value_get_layer (&args->values[0], gimp);
 
@@ -347,8 +346,7 @@
       if (gimp_pdb_layer_is_text_layer (layer, error))
         {
           g_object_get (gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)),
-                        "hinting",  &hinting,
-                        "autohint", &autohint,
+                        "antialias", &antialias,
                         NULL);
         }
       else
@@ -361,30 +359,25 @@
                                                   error ? *error : NULL);
 
   if (success)
-    {
-      g_value_set_boolean (&return_vals->values[1], hinting);
-      g_value_set_boolean (&return_vals->values[2], autohint);
-    }
+    g_value_set_boolean (&return_vals->values[1], antialias);
 
   return return_vals;
 }
 
 static GValueArray *
-text_layer_set_hinting_invoker (GimpProcedure      *procedure,
-                                Gimp               *gimp,
-                                GimpContext        *context,
-                                GimpProgress       *progress,
-                                const GValueArray  *args,
-                                GError            **error)
+text_layer_set_antialias_invoker (GimpProcedure      *procedure,
+                                  Gimp               *gimp,
+                                  GimpContext        *context,
+                                  GimpProgress       *progress,
+                                  const GValueArray  *args,
+                                  GError            **error)
 {
   gboolean success = TRUE;
   GimpLayer *layer;
-  gboolean hinting;
-  gboolean autohint;
+  gboolean antialias;
 
   layer = gimp_value_get_layer (&args->values[0], gimp);
-  hinting = g_value_get_boolean (&args->values[1]);
-  autohint = g_value_get_boolean (&args->values[2]);
+  antialias = g_value_get_boolean (&args->values[1]);
 
   if (success)
     {
@@ -392,8 +385,7 @@
         {
           gimp_text_layer_set (GIMP_TEXT_LAYER (layer),
                                _("Set text layer attribute"),
-                               "hinting",  hinting,
-                               "autohint", autohint,
+                               "antialias", antialias,
                                NULL);
         }
       else
@@ -407,17 +399,17 @@
 }
 
 static GValueArray *
-text_layer_get_antialias_invoker (GimpProcedure      *procedure,
-                                  Gimp               *gimp,
-                                  GimpContext        *context,
-                                  GimpProgress       *progress,
-                                  const GValueArray  *args,
-                                  GError            **error)
+text_layer_get_hint_style_invoker (GimpProcedure      *procedure,
+                                   Gimp               *gimp,
+                                   GimpContext        *context,
+                                   GimpProgress       *progress,
+                                   const GValueArray  *args,
+                                   GError            **error)
 {
   gboolean success = TRUE;
   GValueArray *return_vals;
   GimpLayer *layer;
-  gboolean antialias = FALSE;
+  gint32 style = 0;
 
   layer = gimp_value_get_layer (&args->values[0], gimp);
 
@@ -426,7 +418,7 @@
       if (gimp_pdb_layer_is_text_layer (layer, error))
         {
           g_object_get (gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)),
-                        "antialias", &antialias,
+                        "hint-style", &style,
                         NULL);
         }
       else
@@ -439,25 +431,25 @@
                                                   error ? *error : NULL);
 
   if (success)
-    g_value_set_boolean (&return_vals->values[1], antialias);
+    g_value_set_enum (&return_vals->values[1], style);
 
   return return_vals;
 }
 
 static GValueArray *
-text_layer_set_antialias_invoker (GimpProcedure      *procedure,
-                                  Gimp               *gimp,
-                                  GimpContext        *context,
-                                  GimpProgress       *progress,
-                                  const GValueArray  *args,
-                                  GError            **error)
+text_layer_set_hint_style_invoker (GimpProcedure      *procedure,
+                                   Gimp               *gimp,
+                                   GimpContext        *context,
+                                   GimpProgress       *progress,
+                                   const GValueArray  *args,
+                                   GError            **error)
 {
   gboolean success = TRUE;
   GimpLayer *layer;
-  gboolean antialias;
+  gint32 style;
 
   layer = gimp_value_get_layer (&args->values[0], gimp);
-  antialias = g_value_get_boolean (&args->values[1]);
+  style = g_value_get_enum (&args->values[1]);
 
   if (success)
     {
@@ -465,7 +457,7 @@
         {
           gimp_text_layer_set (GIMP_TEXT_LAYER (layer),
                                _("Set text layer attribute"),
-                               "antialias", antialias,
+                               "hint-style", style,
                                NULL);
         }
       else
@@ -1052,6 +1044,84 @@
                                            error ? *error : NULL);
 }
 
+static GValueArray *
+text_layer_get_hinting_invoker (GimpProcedure      *procedure,
+                                Gimp               *gimp,
+                                GimpContext        *context,
+                                GimpProgress       *progress,
+                                const GValueArray  *args,
+                                GError            **error)
+{
+  gboolean success = TRUE;
+  GValueArray *return_vals;
+  GimpLayer *layer;
+  gboolean hinting = FALSE;
+  gboolean autohint = FALSE;
+
+  layer = gimp_value_get_layer (&args->values[0], gimp);
+
+  if (success)
+    {
+      if (gimp_pdb_layer_is_text_layer (layer, error))
+        {
+          g_object_get (gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)),
+                        "hinting", &hinting,
+                        NULL);
+        }
+      else
+        {
+          success = FALSE;
+        }
+    }
+
+  return_vals = gimp_procedure_get_return_values (procedure, success,
+                                                  error ? *error : NULL);
+
+  if (success)
+    {
+      g_value_set_boolean (&return_vals->values[1], hinting);
+      g_value_set_boolean (&return_vals->values[2], autohint);
+    }
+
+  return return_vals;
+}
+
+static GValueArray *
+text_layer_set_hinting_invoker (GimpProcedure      *procedure,
+                                Gimp               *gimp,
+                                GimpContext        *context,
+                                GimpProgress       *progress,
+                                const GValueArray  *args,
+                                GError            **error)
+{
+  gboolean success = TRUE;
+  GimpLayer *layer;
+  gboolean hinting;
+  gboolean autohint;
+
+  layer = gimp_value_get_layer (&args->values[0], gimp);
+  hinting = g_value_get_boolean (&args->values[1]);
+  autohint = g_value_get_boolean (&args->values[2]);
+
+  if (success)
+    {
+      if (gimp_pdb_layer_is_text_layer (layer, error))
+        {
+          gimp_text_layer_set (GIMP_TEXT_LAYER (layer),
+                               _("Set text layer attribute"),
+                               "hinting", hinting,
+                               NULL);
+        }
+      else
+        {
+          success = FALSE;
+        }
+    }
+
+  return gimp_procedure_get_return_values (procedure, success,
+                                           error ? *error : NULL);
+}
+
 void
 register_text_layer_procs (GimpPDB *pdb)
 {
@@ -1309,15 +1379,15 @@
   g_object_unref (procedure);
 
   /*
-   * gimp-text-layer-get-hinting
+   * gimp-text-layer-get-antialias
    */
-  procedure = gimp_procedure_new (text_layer_get_hinting_invoker);
+  procedure = gimp_procedure_new (text_layer_get_antialias_invoker);
   gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-text-layer-get-hinting");
+                               "gimp-text-layer-get-antialias");
   gimp_procedure_set_static_strings (procedure,
-                                     "gimp-text-layer-get-hinting",
-                                     "Get information about hinting in the specified text layer.",
-                                     "This procedure provides information about the hinting that is being used in a text layer.",
+                                     "gimp-text-layer-get-antialias",
+                                     "Check if antialiasing is used in the text layer.",
+                                     "This procedure checks if antialiasing is enabled in the specified text layer.",
                                      "Marcus Heese <heese cip ifi lmu de>",
                                      "Marcus Heese",
                                      "2008",
@@ -1329,30 +1399,24 @@
                                                          pdb->gimp, FALSE,
                                                          GIMP_PARAM_READWRITE));
   gimp_procedure_add_return_value (procedure,
-                                   g_param_spec_boolean ("hinting",
-                                                         "hinting",
-                                                         "A flag which is true if hinting is used on the font.",
-                                                         FALSE,
-                                                         GIMP_PARAM_READWRITE));
-  gimp_procedure_add_return_value (procedure,
-                                   g_param_spec_boolean ("autohint",
-                                                         "autohint",
-                                                         "A flag which is true if the text layer is forced to use the autohinter from FreeType.",
+                                   g_param_spec_boolean ("antialias",
+                                                         "antialias",
+                                                         "A flag which is true if antialiasing is used for rendering the font in the text layer.",
                                                          FALSE,
                                                          GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
   /*
-   * gimp-text-layer-set-hinting
+   * gimp-text-layer-set-antialias
    */
-  procedure = gimp_procedure_new (text_layer_set_hinting_invoker);
+  procedure = gimp_procedure_new (text_layer_set_antialias_invoker);
   gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-text-layer-set-hinting");
+                               "gimp-text-layer-set-antialias");
   gimp_procedure_set_static_strings (procedure,
-                                     "gimp-text-layer-set-hinting",
-                                     "Enable/disable the use of hinting in a text layer.",
-                                     "This procedure enables or disables hinting on the text of a text layer. If you enable 'auto-hint', FreeType\'s automatic hinter will be used and hinting information from the font will be ignored.",
+                                     "gimp-text-layer-set-antialias",
+                                     "Enable/disable anti-aliasing in a text layer.",
+                                     "This procedure enables or disables anti-aliasing of the text in a text layer.",
                                      "Marcus Heese <heese cip ifi lmu de>",
                                      "Marcus Heese",
                                      "2008",
@@ -1364,30 +1428,24 @@
                                                          pdb->gimp, FALSE,
                                                          GIMP_PARAM_READWRITE));
   gimp_procedure_add_argument (procedure,
-                               g_param_spec_boolean ("hinting",
-                                                     "hinting",
-                                                     "Enable/disable the use of hinting on the text",
-                                                     FALSE,
-                                                     GIMP_PARAM_READWRITE));
-  gimp_procedure_add_argument (procedure,
-                               g_param_spec_boolean ("autohint",
-                                                     "autohint",
-                                                     "Force the use of the autohinter provided through FreeType",
+                               g_param_spec_boolean ("antialias",
+                                                     "antialias",
+                                                     "Enable/disable antialiasing of the text",
                                                      FALSE,
                                                      GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
   /*
-   * gimp-text-layer-get-antialias
+   * gimp-text-layer-get-hint-style
    */
-  procedure = gimp_procedure_new (text_layer_get_antialias_invoker);
+  procedure = gimp_procedure_new (text_layer_get_hint_style_invoker);
   gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-text-layer-get-antialias");
+                               "gimp-text-layer-get-hint-style");
   gimp_procedure_set_static_strings (procedure,
-                                     "gimp-text-layer-get-antialias",
-                                     "Check if antialiasing is used in the text layer.",
-                                     "This procedure checks if antialiasing is enabled in the specified text layer.",
+                                     "gimp-text-layer-get-hint-style",
+                                     "Get information about hinting in the specified text layer.",
+                                     "This procedure provides information about the hinting that is being used in a text layer. Hinting can be optimized for fidelity or contrast or it can be turned entirely off.",
                                      "Marcus Heese <heese cip ifi lmu de>",
                                      "Marcus Heese",
                                      "2008",
@@ -1399,26 +1457,27 @@
                                                          pdb->gimp, FALSE,
                                                          GIMP_PARAM_READWRITE));
   gimp_procedure_add_return_value (procedure,
-                                   g_param_spec_boolean ("antialias",
-                                                         "antialias",
-                                                         "A flag which is true if antialiasing is used for rendering the font in the text layer.",
-                                                         FALSE,
-                                                         GIMP_PARAM_READWRITE));
+                                   g_param_spec_enum ("style",
+                                                      "style",
+                                                      "The hint style used for font outlines",
+                                                      GIMP_TYPE_TEXT_HINT_STYLE,
+                                                      GIMP_TEXT_HINT_STYLE_NONE,
+                                                      GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
   /*
-   * gimp-text-layer-set-antialias
+   * gimp-text-layer-set-hint-style
    */
-  procedure = gimp_procedure_new (text_layer_set_antialias_invoker);
+  procedure = gimp_procedure_new (text_layer_set_hint_style_invoker);
   gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-text-layer-set-antialias");
+                               "gimp-text-layer-set-hint-style");
   gimp_procedure_set_static_strings (procedure,
-                                     "gimp-text-layer-set-antialias",
-                                     "Enable/disable anti-aliasing in a text layer.",
-                                     "This procedure enables or disables anti-aliasing of the text in a text layer.",
-                                     "Marcus Heese <heese cip ifi lmu de>",
-                                     "Marcus Heese",
+                                     "gimp-text-layer-set-hint-style",
+                                     "Control how font outlines are hinted in a text layer.",
+                                     "This procedure sets the hint style for font outlines in a text layer. This controls whether to fit font outlines to the pixel grid, and if so, whether to optimize for fidelity or contrast.",
+                                     "Sven Neumann <sven gimp org>",
+                                     "Sven Neumann",
                                      "2008",
                                      NULL);
   gimp_procedure_add_argument (procedure,
@@ -1428,11 +1487,12 @@
                                                          pdb->gimp, FALSE,
                                                          GIMP_PARAM_READWRITE));
   gimp_procedure_add_argument (procedure,
-                               g_param_spec_boolean ("antialias",
-                                                     "antialias",
-                                                     "Enable/disable antialiasing of the text",
-                                                     FALSE,
-                                                     GIMP_PARAM_READWRITE));
+                               g_param_spec_enum ("style",
+                                                  "style",
+                                                  "The new hint style",
+                                                  GIMP_TYPE_TEXT_HINT_STYLE,
+                                                  GIMP_TEXT_HINT_STYLE_NONE,
+                                                  GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
 
@@ -1907,4 +1967,74 @@
                                                     GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
+
+  /*
+   * gimp-text-layer-get-hinting
+   */
+  procedure = gimp_procedure_new (text_layer_get_hinting_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-text-layer-get-hinting");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-text-layer-get-hinting",
+                                     "This procedure is deprecated! Use 'gimp-text-layer-get-hint-style' instead.",
+                                     "This procedure is deprecated! Use 'gimp-text-layer-get-hint-style' instead.",
+                                     "",
+                                     "",
+                                     "",
+                                     "gimp-text-layer-get-hint-style");
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_layer_id ("layer",
+                                                         "layer",
+                                                         "The text layer",
+                                                         pdb->gimp, FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("hinting",
+                                                         "hinting",
+                                                         "A flag which is true if hinting is used on the font.",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_procedure_add_return_value (procedure,
+                                   g_param_spec_boolean ("autohint",
+                                                         "autohint",
+                                                         "A flag which is true if the text layer is forced to use the autohinter from FreeType.",
+                                                         FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
+
+  /*
+   * gimp-text-layer-set-hinting
+   */
+  procedure = gimp_procedure_new (text_layer_set_hinting_invoker);
+  gimp_object_set_static_name (GIMP_OBJECT (procedure),
+                               "gimp-text-layer-set-hinting");
+  gimp_procedure_set_static_strings (procedure,
+                                     "gimp-text-layer-set-hinting",
+                                     "Enable/disable the use of hinting in a text layer.",
+                                     "This procedure enables or disables hinting on the text of a text layer. If you enable 'auto-hint', FreeType\'s automatic hinter will be used and hinting information from the font will be ignored.",
+                                     "Marcus Heese <heese cip ifi lmu de>",
+                                     "Marcus Heese",
+                                     "2008",
+                                     "gimp-text-layer-set-hint-style");
+  gimp_procedure_add_argument (procedure,
+                               gimp_param_spec_layer_id ("layer",
+                                                         "layer",
+                                                         "The text layer",
+                                                         pdb->gimp, FALSE,
+                                                         GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_boolean ("hinting",
+                                                     "hinting",
+                                                     "Enable/disable the use of hinting on the text",
+                                                     FALSE,
+                                                     GIMP_PARAM_READWRITE));
+  gimp_procedure_add_argument (procedure,
+                               g_param_spec_boolean ("autohint",
+                                                     "autohint",
+                                                     "Force the use of the autohinter provided through FreeType",
+                                                     FALSE,
+                                                     GIMP_PARAM_READWRITE));
+  gimp_pdb_register_procedure (pdb, procedure);
+  g_object_unref (procedure);
 }

Modified: trunk/app/text/gimptext.c
==============================================================================
--- trunk/app/text/gimptext.c	(original)
+++ trunk/app/text/gimptext.c	Mon Oct 27 07:59:32 2008
@@ -46,9 +46,8 @@
   PROP_FONT,
   PROP_FONT_SIZE,
   PROP_UNIT,
-  PROP_HINTING,
-  PROP_AUTOHINT,
   PROP_ANTIALIAS,
+  PROP_HINT_STYLE,
   PROP_KERNING,
   PROP_LANGUAGE,
   PROP_BASE_DIR,
@@ -65,7 +64,9 @@
   PROP_TRANSFORMATION,
   PROP_OFFSET_X,
   PROP_OFFSET_Y,
-  PROP_BORDER
+  PROP_BORDER,
+  /* for backward compatibility */
+  PROP_HINTING
 };
 
 
@@ -128,19 +129,16 @@
                                  "font-size-unit", NULL,
                                  TRUE, FALSE, GIMP_UNIT_PIXEL,
                                  GIMP_PARAM_STATIC_STRINGS);
-  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_HINTING,
-                                    "hinting", NULL,
-                                    TRUE,
-                                    GIMP_PARAM_STATIC_STRINGS);
-  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_AUTOHINT,
-                                    "autohint", NULL,
-                                    FALSE,
-                                    GIMP_PARAM_STATIC_STRINGS |
-                                    GIMP_CONFIG_PARAM_DEFAULTS);
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_ANTIALIAS,
                                     "antialias", NULL,
                                     TRUE,
                                     GIMP_PARAM_STATIC_STRINGS);
+  GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_HINT_STYLE,
+                                "hint-style", NULL,
+                                 GIMP_TYPE_TEXT_HINT_STYLE,
+                                 GIMP_TEXT_HINT_STYLE_MEDIUM,
+                                 GIMP_PARAM_STATIC_STRINGS |
+                                 GIMP_CONFIG_PARAM_DEFAULTS);
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_KERNING,
                                     "kerning", NULL,
                                     FALSE,
@@ -228,6 +226,12 @@
                                                      G_PARAM_CONSTRUCT |
                                                      GIMP_PARAM_WRITABLE));
 
+  /*  the old hinting options have been replaced by 'hint-style'  */
+  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_HINTING,
+                                    "hinting", NULL,
+                                    TRUE,
+                                    GIMP_PARAM_STATIC_STRINGS);
+
   g_free (language);
 }
 
@@ -282,15 +286,12 @@
     case PROP_UNIT:
       g_value_set_int (value, text->unit);
       break;
-    case PROP_HINTING:
-      g_value_set_boolean (value, text->hinting);
-      break;
-    case PROP_AUTOHINT:
-      g_value_set_boolean (value, text->autohint);
-      break;
     case PROP_ANTIALIAS:
       g_value_set_boolean (value, text->antialias);
       break;
+    case PROP_HINT_STYLE:
+      g_value_set_enum (value, text->hint_style);
+      break;
     case PROP_KERNING:
       g_value_set_boolean (value, text->kerning);
       break;
@@ -339,6 +340,10 @@
     case PROP_OFFSET_Y:
       g_value_set_double (value, text->offset_y);
       break;
+    case PROP_HINTING:
+      g_value_set_boolean (value,
+                           text->hint_style != GIMP_TEXT_HINT_STYLE_NONE);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;
@@ -388,15 +393,12 @@
     case PROP_UNIT:
       text->unit = g_value_get_int (value);
       break;
-    case PROP_HINTING:
-      text->hinting = g_value_get_boolean (value);
-      break;
-    case PROP_AUTOHINT:
-      text->autohint = g_value_get_boolean (value);
-      break;
     case PROP_ANTIALIAS:
       text->antialias = g_value_get_boolean (value);
       break;
+    case PROP_HINT_STYLE:
+      text->hint_style = g_value_get_enum (value);
+      break;
     case PROP_KERNING:
       text->kerning = g_value_get_boolean (value);
       break;
@@ -451,6 +453,11 @@
     case PROP_BORDER:
       text->border = g_value_get_int (value);
       break;
+    case PROP_HINTING:
+      text->hint_style = (g_value_get_boolean (value) ?
+                          GIMP_TEXT_HINT_STYLE_MEDIUM :
+                          GIMP_TEXT_HINT_STYLE_NONE);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
       break;

Modified: trunk/app/text/gimptext.h
==============================================================================
--- trunk/app/text/gimptext.h	(original)
+++ trunk/app/text/gimptext.h	Mon Oct 27 07:59:32 2008
@@ -45,9 +45,8 @@
   gchar                 *font;
   GimpUnit               unit;
   gdouble                font_size;
-  gboolean               hinting;
-  gboolean               autohint;
   gboolean               antialias;
+  GimpTextHintStyle      hint_style;
   gboolean               kerning;
   gchar                 *language;
   GimpTextDirection      base_dir;

Modified: trunk/app/text/gimptextlayout-render.c
==============================================================================
--- trunk/app/text/gimptextlayout-render.c	(original)
+++ trunk/app/text/gimptextlayout-render.c	Mon Oct 27 07:59:32 2008
@@ -208,16 +208,24 @@
                                             CAIRO_ANTIALIAS_DEFAULT :
                                             CAIRO_ANTIALIAS_NONE));
 
-  /*
-   * FIXME:
-   *
-   * The autohint property can't be supported any longer, but we
-   * should expose the cairo_hint_style_t enum.
-   */
-
-  cairo_font_options_set_hint_style (flags, (text->hinting ?
-                                             CAIRO_HINT_STYLE_DEFAULT :
-                                             CAIRO_HINT_STYLE_NONE));
+  switch (text->hint_style)
+    {
+    case GIMP_TEXT_HINT_STYLE_NONE:
+      cairo_font_options_set_hint_style (flags, CAIRO_HINT_STYLE_NONE);
+      break;
+
+    case GIMP_TEXT_HINT_STYLE_SLIGHT:
+      cairo_font_options_set_hint_style (flags, CAIRO_HINT_STYLE_SLIGHT);
+      break;
+
+    case GIMP_TEXT_HINT_STYLE_MEDIUM:
+      cairo_font_options_set_hint_style (flags, CAIRO_HINT_STYLE_MEDIUM);
+      break;
+
+    case GIMP_TEXT_HINT_STYLE_FULL:
+      cairo_font_options_set_hint_style (flags, CAIRO_HINT_STYLE_FULL);
+      break;
+    }
 
   return flags;
 }

Modified: trunk/app/tools/gimptextoptions.c
==============================================================================
--- trunk/app/tools/gimptextoptions.c	(original)
+++ trunk/app/tools/gimptextoptions.c	Mon Oct 27 07:59:32 2008
@@ -53,9 +53,8 @@
   PROP_0 = GIMP_RECTANGLE_OPTIONS_PROP_LAST + 1,
   PROP_FONT_SIZE,
   PROP_UNIT,
-  PROP_HINTING,
-  PROP_AUTOHINT,
   PROP_ANTIALIAS,
+  PROP_HINT_STYLE,
   PROP_LANGUAGE,
   PROP_BASE_DIR,
   PROP_JUSTIFICATION,
@@ -123,24 +122,18 @@
                                    "font-size", NULL,
                                    0.0, 8192.0, 18.0,
                                    GIMP_PARAM_STATIC_STRINGS);
-  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_HINTING,
-                                    "hinting",
-                                    N_("Hinting alters the font outline to "
-                                       "produce a crisp bitmap at small "
-                                       "sizes"),
-                                    TRUE,
-                                    GIMP_PARAM_STATIC_STRINGS);
-  GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_AUTOHINT,
-                                    "autohint",
-                                    N_("If available, hints from the font are "
-                                       "used but you may prefer to always use "
-                                       "the automatic hinter"),
-                                    FALSE,
-                                    GIMP_PARAM_STATIC_STRINGS);
   GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_ANTIALIAS,
                                     "antialias", NULL,
                                     TRUE,
                                     GIMP_PARAM_STATIC_STRINGS);
+  GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_HINT_STYLE,
+                                 "hint-style",
+                                 N_("Hinting alters the font outline to "
+                                    "produce a crisp bitmap at small "
+                                    "sizes"),
+                                 GIMP_TYPE_TEXT_HINT_STYLE,
+                                 GIMP_TEXT_HINT_STYLE_MEDIUM,
+                                 GIMP_PARAM_STATIC_STRINGS);
   GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_LANGUAGE,
                                    "language", NULL,
                                    (const gchar *) gtk_get_default_language (),
@@ -220,15 +213,12 @@
     case PROP_UNIT:
       g_value_set_int (value, options->unit);
       break;
-    case PROP_HINTING:
-      g_value_set_boolean (value, options->hinting);
-      break;
-    case PROP_AUTOHINT:
-      g_value_set_boolean (value, options->autohint);
-      break;
     case PROP_ANTIALIAS:
       g_value_set_boolean (value, options->antialias);
       break;
+    case PROP_HINT_STYLE:
+      g_value_set_enum (value, options->hint_style);
+      break;
     case PROP_LANGUAGE:
       g_value_set_string (value, options->language);
       break;
@@ -281,15 +271,12 @@
     case PROP_UNIT:
       options->unit = g_value_get_int (value);
       break;
-    case PROP_HINTING:
-      options->hinting = g_value_get_boolean (value);
-      break;
-    case PROP_AUTOHINT:
-      options->autohint = g_value_get_boolean (value);
-      break;
     case PROP_ANTIALIAS:
       options->antialias = g_value_get_boolean (value);
       break;
+    case PROP_HINT_STYLE:
+      options->hint_style = g_value_get_enum (value);
+      break;
     case PROP_BASE_DIR:
       options->base_dir = g_value_get_enum (value);
       break;
@@ -442,7 +429,6 @@
   GtkWidget       *vbox;
   GtkWidget       *hbox;
   GtkWidget       *button;
-  GtkWidget       *auto_button;
   GtkWidget       *entry;
   GtkWidget       *box;
   GtkWidget       *spinbutton;
@@ -478,23 +464,11 @@
   gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
   gtk_widget_show (button);
 
-  button = gimp_prop_check_button_new (config, "hinting", _("Hinting"));
-  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-  gtk_widget_show (button);
-
-  auto_button = gimp_prop_check_button_new (config, "autohint",
-                                            _("Force auto-hinter"));
-  gtk_box_pack_start (GTK_BOX (vbox), auto_button, FALSE, FALSE, 0);
-  gtk_widget_show (auto_button);
-
-  gtk_widget_set_sensitive (auto_button, options->hinting);
-  g_object_set_data (G_OBJECT (button), "set_sensitive", auto_button);
-
   button = gimp_prop_check_button_new (config, "antialias", _("Antialiasing"));
   gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
   gtk_widget_show (button);
 
-  table = gtk_table_new (5, 3, FALSE);
+  table = gtk_table_new (6, 3, FALSE);
   gtk_table_set_col_spacings (GTK_TABLE (table), 2);
   gtk_table_set_row_spacings (GTK_TABLE (table), 2);
   gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
@@ -504,6 +478,12 @@
 
   size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
+  button = gimp_prop_enum_combo_box_new (config, "hint-style", -1, -1);
+  gimp_table_attach_aligned (GTK_TABLE (table), 0, row++,
+                             _("Hinting:"), 0.0, 0.5,
+                             button, 1, TRUE);
+  gtk_size_group_add_widget (size_group, button);
+
   button = gimp_prop_color_button_new (config, "foreground", _("Text Color"),
                                        40, 24, GIMP_COLOR_AREA_FLAT);
   gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),

Modified: trunk/app/tools/gimptextoptions.h
==============================================================================
--- trunk/app/tools/gimptextoptions.h	(original)
+++ trunk/app/tools/gimptextoptions.h	Mon Oct 27 07:59:32 2008
@@ -40,9 +40,8 @@
 
   GimpUnit               unit;
   gdouble                font_size;
-  gboolean               hinting;
-  gboolean               autohint;
   gboolean               antialias;
+  GimpTextHintStyle      hint_style;
   gchar                 *language;
   GimpTextDirection      base_dir;
   GimpTextJustification  justify;

Modified: trunk/libgimp/gimpenums.c.tail
==============================================================================
--- trunk/libgimp/gimpenums.c.tail	(original)
+++ trunk/libgimp/gimpenums.c.tail	Mon Oct 27 07:59:32 2008
@@ -48,6 +48,7 @@
   gimp_size_type_get_type,
   gimp_stack_trace_mode_get_type,
   gimp_text_direction_get_type,
+  gimp_text_hint_style_get_type,
   gimp_text_justification_get_type,
   gimp_transfer_mode_get_type,
   gimp_transform_direction_get_type,
@@ -103,6 +104,7 @@
   "GimpSizeType",
   "GimpStackTraceMode",
   "GimpTextDirection",
+  "GimpTextHintStyle",
   "GimpTextJustification",
   "GimpTransferMode",
   "GimpTransformDirection",

Modified: trunk/libgimp/gimptextlayer_pdb.c
==============================================================================
--- trunk/libgimp/gimptextlayer_pdb.c	(original)
+++ trunk/libgimp/gimptextlayer_pdb.c	Mon Oct 27 07:59:32 2008
@@ -24,6 +24,9 @@
 #include "config.h"
 
 #include "gimp.h"
+#undef GIMP_DISABLE_DEPRECATED
+#undef __GIMP_TEXT_LAYER_PDB_H__
+#include "gimptextlayer_pdb.h"
 
 /**
  * gimp_text_layer_new:
@@ -284,73 +287,64 @@
 }
 
 /**
- * gimp_text_layer_get_hinting:
+ * gimp_text_layer_get_antialias:
  * @layer_ID: The text layer.
- * @autohint: A flag which is true if the text layer is forced to use the autohinter from FreeType.
  *
- * Get information about hinting in the specified text layer.
+ * Check if antialiasing is used in the text layer.
  *
- * This procedure provides information about the hinting that is being
- * used in a text layer.
+ * This procedure checks if antialiasing is enabled in the specified
+ * text layer.
  *
- * Returns: A flag which is true if hinting is used on the font.
+ * Returns: A flag which is true if antialiasing is used for rendering the font in the text layer.
  *
  * Since: GIMP 2.6
  */
 gboolean
-gimp_text_layer_get_hinting (gint32    layer_ID,
-                             gboolean *autohint)
+gimp_text_layer_get_antialias (gint32 layer_ID)
 {
   GimpParam *return_vals;
   gint nreturn_vals;
-  gboolean hinting = FALSE;
+  gboolean antialias = FALSE;
 
-  return_vals = gimp_run_procedure ("gimp-text-layer-get-hinting",
+  return_vals = gimp_run_procedure ("gimp-text-layer-get-antialias",
                                     &nreturn_vals,
                                     GIMP_PDB_LAYER, layer_ID,
                                     GIMP_PDB_END);
 
   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
-    {
-      hinting = return_vals[1].data.d_int32;
-      *autohint = return_vals[2].data.d_int32;
-    }
+    antialias = return_vals[1].data.d_int32;
 
   gimp_destroy_params (return_vals, nreturn_vals);
 
-  return hinting;
+  return antialias;
 }
 
 /**
- * gimp_text_layer_set_hinting:
+ * gimp_text_layer_set_antialias:
  * @layer_ID: The text layer.
- * @hinting: Enable/disable the use of hinting on the text.
- * @autohint: Force the use of the autohinter provided through FreeType.
+ * @antialias: Enable/disable antialiasing of the text.
  *
- * Enable/disable the use of hinting in a text layer.
+ * Enable/disable anti-aliasing in a text layer.
  *
- * This procedure enables or disables hinting on the text of a text
- * layer. If you enable 'auto-hint', FreeType\'s automatic hinter will
- * be used and hinting information from the font will be ignored.
+ * This procedure enables or disables anti-aliasing of the text in a
+ * text layer.
  *
  * Returns: TRUE on success.
  *
  * Since: GIMP 2.6
  */
 gboolean
-gimp_text_layer_set_hinting (gint32   layer_ID,
-                             gboolean hinting,
-                             gboolean autohint)
+gimp_text_layer_set_antialias (gint32   layer_ID,
+                               gboolean antialias)
 {
   GimpParam *return_vals;
   gint nreturn_vals;
   gboolean success = TRUE;
 
-  return_vals = gimp_run_procedure ("gimp-text-layer-set-hinting",
+  return_vals = gimp_run_procedure ("gimp-text-layer-set-antialias",
                                     &nreturn_vals,
                                     GIMP_PDB_LAYER, layer_ID,
-                                    GIMP_PDB_INT32, hinting,
-                                    GIMP_PDB_INT32, autohint,
+                                    GIMP_PDB_INT32, antialias,
                                     GIMP_PDB_END);
 
   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
@@ -361,64 +355,66 @@
 }
 
 /**
- * gimp_text_layer_get_antialias:
+ * gimp_text_layer_get_hint_style:
  * @layer_ID: The text layer.
  *
- * Check if antialiasing is used in the text layer.
+ * Get information about hinting in the specified text layer.
  *
- * This procedure checks if antialiasing is enabled in the specified
- * text layer.
+ * This procedure provides information about the hinting that is being
+ * used in a text layer. Hinting can be optimized for fidelity or
+ * contrast or it can be turned entirely off.
  *
- * Returns: A flag which is true if antialiasing is used for rendering the font in the text layer.
+ * Returns: The hint style used for font outlines.
  *
- * Since: GIMP 2.6
+ * Since: GIMP 2.8
  */
-gboolean
-gimp_text_layer_get_antialias (gint32 layer_ID)
+GimpTextHintStyle
+gimp_text_layer_get_hint_style (gint32 layer_ID)
 {
   GimpParam *return_vals;
   gint nreturn_vals;
-  gboolean antialias = FALSE;
+  GimpTextHintStyle style = 0;
 
-  return_vals = gimp_run_procedure ("gimp-text-layer-get-antialias",
+  return_vals = gimp_run_procedure ("gimp-text-layer-get-hint-style",
                                     &nreturn_vals,
                                     GIMP_PDB_LAYER, layer_ID,
                                     GIMP_PDB_END);
 
   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
-    antialias = return_vals[1].data.d_int32;
+    style = return_vals[1].data.d_int32;
 
   gimp_destroy_params (return_vals, nreturn_vals);
 
-  return antialias;
+  return style;
 }
 
 /**
- * gimp_text_layer_set_antialias:
+ * gimp_text_layer_set_hint_style:
  * @layer_ID: The text layer.
- * @antialias: Enable/disable antialiasing of the text.
+ * @style: The new hint style.
  *
- * Enable/disable anti-aliasing in a text layer.
+ * Control how font outlines are hinted in a text layer.
  *
- * This procedure enables or disables anti-aliasing of the text in a
- * text layer.
+ * This procedure sets the hint style for font outlines in a text
+ * layer. This controls whether to fit font outlines to the pixel grid,
+ * and if so, whether to optimize for fidelity or contrast.
  *
  * Returns: TRUE on success.
  *
- * Since: GIMP 2.6
+ * Since: GIMP 2.8
  */
 gboolean
-gimp_text_layer_set_antialias (gint32   layer_ID,
-                               gboolean antialias)
+gimp_text_layer_set_hint_style (gint32            layer_ID,
+                                GimpTextHintStyle style)
 {
   GimpParam *return_vals;
   gint nreturn_vals;
   gboolean success = TRUE;
 
-  return_vals = gimp_run_procedure ("gimp-text-layer-set-antialias",
+  return_vals = gimp_run_procedure ("gimp-text-layer-set-hint-style",
                                     &nreturn_vals,
                                     GIMP_PDB_LAYER, layer_ID,
-                                    GIMP_PDB_INT32, antialias,
+                                    GIMP_PDB_INT32, style,
                                     GIMP_PDB_END);
 
   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
@@ -972,3 +968,73 @@
 
   return success;
 }
+
+/**
+ * gimp_text_layer_get_hinting:
+ * @layer_ID: The text layer.
+ * @autohint: A flag which is true if the text layer is forced to use the autohinter from FreeType.
+ *
+ * This procedure is deprecated! Use gimp_text_layer_get_hint_style()
+ * instead.
+ *
+ * Returns: A flag which is true if hinting is used on the font.
+ */
+gboolean
+gimp_text_layer_get_hinting (gint32    layer_ID,
+                             gboolean *autohint)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean hinting = FALSE;
+
+  return_vals = gimp_run_procedure ("gimp-text-layer-get-hinting",
+                                    &nreturn_vals,
+                                    GIMP_PDB_LAYER, layer_ID,
+                                    GIMP_PDB_END);
+
+  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
+    {
+      hinting = return_vals[1].data.d_int32;
+      *autohint = return_vals[2].data.d_int32;
+    }
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return hinting;
+}
+
+/**
+ * gimp_text_layer_set_hinting:
+ * @layer_ID: The text layer.
+ * @hinting: Enable/disable the use of hinting on the text.
+ * @autohint: Force the use of the autohinter provided through FreeType.
+ *
+ * This procedure is deprecated! Use gimp_text_layer_set_hint_style()
+ * instead.
+ *
+ * Returns: TRUE on success.
+ *
+ * Since: GIMP 2.6
+ */
+gboolean
+gimp_text_layer_set_hinting (gint32   layer_ID,
+                             gboolean hinting,
+                             gboolean autohint)
+{
+  GimpParam *return_vals;
+  gint nreturn_vals;
+  gboolean success = TRUE;
+
+  return_vals = gimp_run_procedure ("gimp-text-layer-set-hinting",
+                                    &nreturn_vals,
+                                    GIMP_PDB_LAYER, layer_ID,
+                                    GIMP_PDB_INT32, hinting,
+                                    GIMP_PDB_INT32, autohint,
+                                    GIMP_PDB_END);
+
+  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
+
+  gimp_destroy_params (return_vals, nreturn_vals);
+
+  return success;
+}

Modified: trunk/libgimp/gimptextlayer_pdb.h
==============================================================================
--- trunk/libgimp/gimptextlayer_pdb.h	(original)
+++ trunk/libgimp/gimptextlayer_pdb.h	Mon Oct 27 07:59:32 2008
@@ -45,14 +45,12 @@
 gboolean              gimp_text_layer_set_font_size      (gint32                 layer_ID,
                                                           gdouble                font_size,
                                                           GimpUnit               unit);
-gboolean              gimp_text_layer_get_hinting        (gint32                 layer_ID,
-                                                          gboolean              *autohint);
-gboolean              gimp_text_layer_set_hinting        (gint32                 layer_ID,
-                                                          gboolean               hinting,
-                                                          gboolean               autohint);
 gboolean              gimp_text_layer_get_antialias      (gint32                 layer_ID);
 gboolean              gimp_text_layer_set_antialias      (gint32                 layer_ID,
                                                           gboolean               antialias);
+GimpTextHintStyle     gimp_text_layer_get_hint_style     (gint32                 layer_ID);
+gboolean              gimp_text_layer_set_hint_style     (gint32                 layer_ID,
+                                                          GimpTextHintStyle      style);
 gboolean              gimp_text_layer_get_kerning        (gint32                 layer_ID);
 gboolean              gimp_text_layer_set_kerning        (gint32                 layer_ID,
                                                           gboolean               kerning);
@@ -78,6 +76,13 @@
 gdouble               gimp_text_layer_get_letter_spacing (gint32                 layer_ID);
 gboolean              gimp_text_layer_set_letter_spacing (gint32                 layer_ID,
                                                           gdouble                letter_spacing);
+#ifndef GIMP_DISABLE_DEPRECATED
+gboolean              gimp_text_layer_get_hinting        (gint32                 layer_ID,
+                                                          gboolean              *autohint);
+gboolean              gimp_text_layer_set_hinting        (gint32                 layer_ID,
+                                                          gboolean               hinting,
+                                                          gboolean               autohint);
+#endif /* GIMP_DISABLE_DEPRECATED */
 
 
 G_END_DECLS

Modified: trunk/libgimpbase/gimpbaseenums.c
==============================================================================
--- trunk/libgimpbase/gimpbaseenums.c	(original)
+++ trunk/libgimpbase/gimpbaseenums.c	Mon Oct 27 07:59:32 2008
@@ -621,7 +621,7 @@
 
   static const GimpEnumDesc descs[] =
   {
-    { GIMP_REPEAT_NONE, N_("None"), NULL },
+    { GIMP_REPEAT_NONE, N_("repeat|None"), NULL },
     { GIMP_REPEAT_SAWTOOTH, N_("Sawtooth wave"), NULL },
     { GIMP_REPEAT_TRIANGULAR, N_("Triangular wave"), NULL },
     { 0, NULL, NULL }
@@ -1089,6 +1089,39 @@
 }
 
 GType
+gimp_text_hint_style_get_type (void)
+{
+  static const GEnumValue values[] =
+  {
+    { GIMP_TEXT_HINT_STYLE_NONE, "GIMP_TEXT_HINT_STYLE_NONE", "none" },
+    { GIMP_TEXT_HINT_STYLE_SLIGHT, "GIMP_TEXT_HINT_STYLE_SLIGHT", "slight" },
+    { GIMP_TEXT_HINT_STYLE_MEDIUM, "GIMP_TEXT_HINT_STYLE_MEDIUM", "medium" },
+    { GIMP_TEXT_HINT_STYLE_FULL, "GIMP_TEXT_HINT_STYLE_FULL", "full" },
+    { 0, NULL, NULL }
+  };
+
+  static const GimpEnumDesc descs[] =
+  {
+    { GIMP_TEXT_HINT_STYLE_NONE, N_("hinting|None"), NULL },
+    { GIMP_TEXT_HINT_STYLE_SLIGHT, N_("hinting|Slight"), NULL },
+    { GIMP_TEXT_HINT_STYLE_MEDIUM, N_("hinting|Medium"), NULL },
+    { GIMP_TEXT_HINT_STYLE_FULL, N_("hinting|Full"), NULL },
+    { 0, NULL, NULL }
+  };
+
+  static GType type = 0;
+
+  if (! type)
+    {
+      type = g_enum_register_static ("GimpTextHintStyle", values);
+      gimp_type_set_translation_domain (type, GETTEXT_PACKAGE "-libgimp");
+      gimp_enum_set_value_descriptions (type, descs);
+    }
+
+  return type;
+}
+
+GType
 gimp_text_justification_get_type (void)
 {
   static const GEnumValue values[] =

Modified: trunk/libgimpbase/gimpbaseenums.h
==============================================================================
--- trunk/libgimpbase/gimpbaseenums.h	(original)
+++ trunk/libgimpbase/gimpbaseenums.h	Mon Oct 27 07:59:32 2008
@@ -269,7 +269,7 @@
 
 typedef enum
 {
-  GIMP_REPEAT_NONE,       /*< desc="None"            >*/
+  GIMP_REPEAT_NONE,       /*< desc="repeat|None"     >*/
   GIMP_REPEAT_SAWTOOTH,   /*< desc="Sawtooth wave"   >*/
   GIMP_REPEAT_TRIANGULAR  /*< desc="Triangular wave" >*/
 } GimpRepeatMode;
@@ -473,6 +473,19 @@
 } GimpTextDirection;
 
 
+#define GIMP_TYPE_TEXT_HINT_STYLE (gimp_text_hint_style_get_type ())
+
+GType gimp_text_hint_style_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+  GIMP_TEXT_HINT_STYLE_NONE,     /*< desc="hinting|None"   >*/
+  GIMP_TEXT_HINT_STYLE_SLIGHT,   /*< desc="hinting|Slight" >*/
+  GIMP_TEXT_HINT_STYLE_MEDIUM,   /*< desc="hinting|Medium" >*/
+  GIMP_TEXT_HINT_STYLE_FULL,     /*< desc="hinting|Full"   >*/
+} GimpTextHintStyle;
+
+
 #define GIMP_TYPE_TEXT_JUSTIFICATION (gimp_text_justification_get_type ())
 
 GType gimp_text_justification_get_type (void) G_GNUC_CONST;

Modified: trunk/tools/pdbgen/enums.pl
==============================================================================
--- trunk/tools/pdbgen/enums.pl	(original)
+++ trunk/tools/pdbgen/enums.pl	Mon Oct 27 07:59:32 2008
@@ -364,6 +364,18 @@
 	  mapping => { GIMP_TEXT_DIRECTION_LTR => '0',
 		       GIMP_TEXT_DIRECTION_RTL => '1' }
 	},
+    GimpTextHintStyle =>
+	{ contig => 1,
+	  header => 'libgimpbase/gimpbaseenums.h',
+	  symbols => [ qw(GIMP_TEXT_HINT_STYLE_NONE
+			  GIMP_TEXT_HINT_STYLE_SLIGHT
+			  GIMP_TEXT_HINT_STYLE_MEDIUM
+			  GIMP_TEXT_HINT_STYLE_FULL) ],
+	  mapping => { GIMP_TEXT_HINT_STYLE_NONE => '0',
+		       GIMP_TEXT_HINT_STYLE_SLIGHT => '1',
+		       GIMP_TEXT_HINT_STYLE_MEDIUM => '2',
+		       GIMP_TEXT_HINT_STYLE_FULL => '3' }
+	},
     GimpTextJustification =>
 	{ contig => 1,
 	  header => 'libgimpbase/gimpbaseenums.h',

Modified: trunk/tools/pdbgen/pdb/text_layer.pdb
==============================================================================
--- trunk/tools/pdbgen/pdb/text_layer.pdb	(original)
+++ trunk/tools/pdbgen/pdb/text_layer.pdb	Mon Oct 27 07:59:32 2008
@@ -307,14 +307,7 @@
 }
 
 sub text_layer_get_hinting {
-    $blurb = 'Get information about hinting in the specified text layer.';
-
-    $help = <<'HELP';
-This procedure provides information about the hinting that is being
-used in a text layer.
-HELP
-
-    &marcus_pdb_misc('2008', '2.6');
+    &std_pdb_deprecated ('gimp-text-layer-get-hint-style');
 
     @inargs = (
         { name => 'layer', type => 'layer',
@@ -334,8 +327,7 @@
   if (gimp_pdb_layer_is_text_layer (layer, error))
     {
       g_object_get (gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)),
-                    "hinting",  &hinting,
-                    "autohint", &autohint,
+                    "hinting", &hinting,
                     NULL);
     }
   else
@@ -348,6 +340,8 @@
 }
 
 sub text_layer_set_hinting {
+    &std_pdb_deprecated ('gimp-text-layer-set-hint-style');
+
     $blurb = 'Enable/disable the use of hinting in a text layer.';
 
     $help = <<'HELP';
@@ -374,8 +368,7 @@
     {
       gimp_text_layer_set (GIMP_TEXT_LAYER (layer),
                            _("Set text layer attribute"),
-                           "hinting",  hinting,
-                           "autohint", autohint,
+                           "hinting", hinting,
                            NULL);
     }
   else
@@ -459,6 +452,82 @@
     );
 }
 
+sub text_layer_get_hint_style {
+    $blurb = 'Get information about hinting in the specified text layer.';
+
+    $help = <<'HELP';
+This procedure provides information about the hinting that is being
+used in a text layer. Hinting can be optimized for fidelity or contrast
+or it can be turned entirely off.
+HELP
+
+    &marcus_pdb_misc('2008', '2.8');
+
+    @inargs = (
+        { name => 'layer', type => 'layer',
+          desc => 'The text layer' }
+    );
+
+    @outargs = (
+        { name => 'style', type => 'enum GimpTextHintStyle',
+          desc => 'The hint style used for font outlines' }
+    );
+    
+    %invoke = (
+        code => <<'CODE'
+{
+  if (gimp_pdb_layer_is_text_layer (layer, error))
+    {
+      g_object_get (gimp_text_layer_get_text (GIMP_TEXT_LAYER (layer)),
+                    "hint-style", &style,
+                    NULL);
+    }
+  else
+    {
+      success = FALSE;
+    }
+}
+CODE
+    );
+}
+
+sub text_layer_set_hint_style {
+    $blurb = 'Control how font outlines are hinted in a text layer.';
+
+    $help = <<'HELP';
+This procedure sets the hint style for font outlines in a text
+layer. This controls whether to fit font outlines to the pixel grid,
+and if so, whether to optimize for fidelity or contrast.
+HELP
+
+    &neo_pdb_misc('2008', '2.8');
+
+    @inargs = (
+        { name => 'layer', type => 'layer',
+          desc => 'The text layer' },
+        { name => 'style', type => 'enum GimpTextHintStyle',
+          desc => 'The new hint style' }
+    );
+
+    %invoke = (
+        code => <<'CODE'
+{
+  if (gimp_pdb_layer_is_text_layer (layer, error))
+    {
+      gimp_text_layer_set (GIMP_TEXT_LAYER (layer),
+                           _("Set text layer attribute"),
+                           "hint-style", style,
+                           NULL);
+    }
+  else
+    {
+      success = FALSE;
+    }
+}
+CODE
+    );
+}
+
 sub text_layer_get_kerning {
     $blurb = 'Check if kerning is used in the text layer.';
 
@@ -1057,10 +1126,10 @@
             text_layer_set_font
             text_layer_get_font_size
             text_layer_set_font_size
-            text_layer_get_hinting
-            text_layer_set_hinting
             text_layer_get_antialias
             text_layer_set_antialias
+            text_layer_get_hint_style
+            text_layer_set_hint_style
             text_layer_get_kerning
             text_layer_set_kerning
             text_layer_get_language
@@ -1076,7 +1145,10 @@
             text_layer_get_line_spacing
             text_layer_set_line_spacing
             text_layer_get_letter_spacing
-            text_layer_set_letter_spacing);
+            text_layer_set_letter_spacing
+            text_layer_get_hinting
+            text_layer_set_hinting
+);
 
 %exports = (app => [ procs], lib => [ procs]);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]