Print debug information to mdebug__output instead of stderr.
[m17n/m17n-lib.git] / src / font.c
index 5ebdaa0..7643712 100644 (file)
@@ -1446,9 +1446,9 @@ mdebug_dump_font_list (MFontList *font_list)
 
   for (i = 0; i < font_list->nfonts; i++)
     {
-      fprintf (stderr, "%04X - ", font_list->fonts[i].score);
+      fprintf (mdebug__output, "%04X - ", font_list->fonts[i].score);
       mdebug_dump_font (font_list->fonts[i].font);
-      fprintf (stderr, "\n");
+      fprintf (mdebug__output, "\n");
     }
 }
 
@@ -3184,16 +3184,18 @@ mfont_close (MFont *font)
 /***en
     @brief Dump a font.
 
-    The mdebug_dump_font () function prints font $FONT in a human readable
-    way to the stderr.
+    The mdebug_dump_font () function prints font $FONT in a human
+    readable way to the stderr or to what specified by the environment
+    variable MDEBUG_OUTPUT_FILE.
 
     @return
     This function returns $FONT.  */
 /***ja
     @brief ¥Õ¥©¥ó¥È¤ò¥À¥ó¥×¤¹¤ë.
 
-    ´Ø¿ô mdebug_dump_font () ¤Ï¥Õ¥©¥ó¥È $FONT ¤ò stderr 
-    ¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç°õºþ¤¹¤ë¡£
+    ´Ø¿ô mdebug_dump_font () ¤Ï¥Õ¥©¥ó¥È $FONT ¤òɸ½à¥¨¥é¡¼½ÐÎϤ⤷¤¯¤Ï
+    ´Ä¶­ÊÑ¿ô MDEBUG_DUMP_FONT ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç½Ð
+    ÎϤ¹¤ë¡£
 
     @return
     ¤³¤Î´Ø¿ô¤Ï $FONT ¤òÊÖ¤¹¡£  */
@@ -3206,7 +3208,7 @@ mdebug_dump_font (MFont *font)
   name = xlfd_unparse_name (font, 0);
   if (name)
     {
-      fprintf (stderr, "%s", name);
+      fprintf (mdebug__output, "%s", name);
       free (name);
     }
   if (font->file != Mnil)
@@ -3218,11 +3220,11 @@ mdebug_dump_font (MFont *font)
        if (*p == '/')
          lastslash = p;
       if (name)
-       fprintf (stderr, ",");
-      fprintf (stderr, "%s", lastslash + 1);
+       fprintf (mdebug__output, ",");
+      fprintf (mdebug__output, "%s", lastslash + 1);
     }
   if (font->capability != Mnil)
-    fprintf (stderr, "%s", MSYMBOL_NAME (font->capability));
+    fprintf (mdebug__output, "%s", MSYMBOL_NAME (font->capability));
   return font;
 }