fontname completion?

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

 



Hi,

"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Gimp.Org/*"
seems to call gimp-text-fontname with short font name
such as "helvetica" and failed to find font. How it
should be handled?

1. complete them if fontname doesn't mach xlfd like following patch.
2. never complete, fix these scripts.

regards,

--
SHIRASAKI Yasuhiro : Experimental Particle Physics, JLC Team
Graduate School of Science, TOHOKU University 980-8578 Japan.
--- app/text_tool_cmds.c.orig	Fri Feb 18 15:48:13 2000
+++ app/text_tool_cmds.c	Thu Mar 16 20:10:50 2000
@@ -53,6 +53,7 @@
 		       gboolean  antialias)
 {
   gchar *newfont, *workfont;
+  gchar *completed = NULL;
   gchar size_buffer[16];
   gchar xres_buffer[16];
   gchar yres_buffer[16];
@@ -110,6 +111,10 @@
   sprintf (xres_buffer, "%d", (int) xresolution);
   sprintf (yres_buffer, "%d", (int) yresolution);
 
+  if (strchr(fontname, '-') == NULL)
+    fontname = completed = g_strdup_printf("-*-%s-*-r-*-*-*-*-*-*-p-*-*-*",
+                                           fontname);
+
   newfont = workfont = g_new (char, strlen (fontname) + 32);
 
   while (*fontname)
@@ -151,6 +156,9 @@
     }
 
    *workfont = '\0';
+   if (completed)
+     g_free(completed);
+
    return newfont;
 }
 

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux