*** empty log message ***
[m17n/m17n-lib.git] / example / mdump.c
index 087f117..2159f90 100644 (file)
@@ -1,5 +1,5 @@
 /* mdump.c -- Dump text image                          -*- coding: euc-jp; -*-
-   Copyright (C) 2003, 2004, 2005
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
@@ -17,7 +17,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the m17n library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    02111-1307, USA.  */
 
 /***en
 
     <li> -fg FOREGROUND
 
-    Speicify the text color.
+    Specify the text color.  The supported color names are those of
+    HTML 4.0 and "#RRGGBB" notation.
 
     <li> -bg BACKGROUND
 
-    Speicify the background color.  If "transparent" is specified,
+    Specify the background color.  The supported color names are the
+    same as FOREGROUND, except that if "transparent" is specified,
     make the background transparent.
 
     <li> -r
 
     <li> -fg FOREGROUND
 
-    ¥Æ¥­¥¹¥È¤Î¿§¤ò»ØÄꤹ¤ë¡£
+    ¥Æ¥­¥¹¥È¤Î¿§¤ò»ØÄꤹ¤ë¡£HTML 4.0 ¤Î¿§¤Î̾Á°¤ª¤è¤Ó "#RRGGBB" µ­Ë¡¤ò
+    ¥µ¥Ý¡¼¥È¡£
 
     <li> -bg BACKGROUND
 
-    Çطʤ理ò»ØÄꤹ¤ë¡£¤â¤· "transparent" ¤¬»ØÄꤵ¤ì¤¿¤éÇطʤòÆ©ÌÀ¤Ë¤¹¤ë¡£
+    Çطʤ理ò»ØÄꤹ¤ë¡£¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¿§¤Î̾Á°¤Ï FOREGROUND Æ±¤¸¡£
+    ¤¿¤À¤·¡¢¤â¤· "transparent" ¤¬»ØÄꤵ¤ì¤¿¤éÇطʤòÆ©ÌÀ¤Ë¤¹¤ë¡£
 
     <li> -r
 
 #include <m17n-gui.h>
 #include <m17n-misc.h>
 
-#define PROGRAM_VERSION "1.1"
-
 /* Enumuration of the supported paper types.  */
 enum paper_type
   {
@@ -324,7 +326,7 @@ help_exit (char *prog, int exit_code)
   printf ("  %-13s %s", "-r", 
          "Specify that the orientation of the text is right-to-left.\n");
   printf ("  %-13s %s", "-fg FOREGROUND",
-         "Specify the text color.\n");
+         "Specify the text color (HTML 4.0 color names or \"#RRGGBB\").\n");
   printf ("  %-13s %s", "-bg BACKGROUND",
          "Specify the background color (\"transparent\" for transparent)\n");
   printf ("  %-13s %s", "-q", "Quiet mode.  Don't print any messages.\n");
@@ -484,7 +486,7 @@ main (int argc, char **argv)
   MDrawMetric rect;
   char *filename = "output";
   int len, from;
-  char *fontset_name = "truetype";
+  char *fontset_name = "generic";
 
 
   /* Parse the command line arguments.  */
@@ -496,8 +498,8 @@ main (int argc, char **argv)
        help_exit (argv[0], 0);
       else if (! strcmp (argv[i], "--version"))
        {
-         printf ("m17n-dump (m17n library) %s\n", PROGRAM_VERSION);
-         printf ("Copyright (C) 2003, 2004 AIST, JAPAN\n");
+         printf ("m17n-dump (m17n library) %s\n", M17NLIB_VERSION_NAME);
+         printf ("Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 AIST, JAPAN\n");
          exit (0);
        }
       else if (! strcmp (argv[i], "-s") && i + 1< argc)
@@ -741,7 +743,9 @@ main (int argc, char **argv)
       else
        bg_rgb = gdImageColorAllocate (image, 255, 255, 255);
       gdImageColorTransparent (image, bg_rgb);
+#if HAVE_GD > 1
       gdImageAlphaBlending (image, 0);
+#endif
     }
   else
     {