DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2701
Version: 1.3-current


I am testing FLTK with Ubuntu 11.04.

I have an application, that uses Microsoft Core Fonts (installed with the
ttf-mscorefonts-installer package) and noticed, that ttf fonts with
modifiers (bold, italic) are not detected correctly e.g. are displayed as
regular font.

This seems to arise from the current implementation in
fl_set_fonts_xft.cxx, which only searches for the first style string in
the font description. Unfortunately the first style reported in my case is
in german (e.g. "Verdana: style=Fett Kursiv,...") whereas the FLTK code
looks for "Bold", "Italic".

The patch submitted fixes this (it now searches the whole style string),
but I can't judge if will not have a side effect elsewhere.

chris


Link: http://www.fltk.org/str.php?L2701
Version: 1.3-current
Index: src/fl_set_fonts_xft.cxx
===================================================================
--- src/fl_set_fonts_xft.cxx    (Revision 8989)
+++ src/fl_set_fonts_xft.cxx    (Arbeitskopie)
@@ -108,6 +108,7 @@
   if(nm2) *nm2 = 0; // terminate name after first entry
   raw[0] = ' '; raw[1] = 0; // Default start of "raw name" text
   strncat(raw, pretty, LOCAL_RAW_NAME_MAX-1);
+       if (strstr(pretty, "Verdana" ) )
 #endif
   // At this point, the name is "marked" as regular...
   if (style)
@@ -122,7 +123,7 @@
     while ((style) && (style < last))
     {
       int type;
-      while ((*style == '=') || (*style == ' ') || (*style == '\t'))
+      while ((*style == '=') || (*style == ' ') || (*style == '\t') || (*style 
== ',') )
       {
         style++; // Start of Style string
         if ((style >= last) || (*style == 0)) continue;
@@ -165,7 +166,7 @@
         goto NEXT_STYLE;
       } // switch end
 NEXT_STYLE:
-      while ((*style != ' ') && (*style != '\t'))
+      while ((*style != ' ') && (*style != '\t') && (*style != ','))
       {
         style++;
         if ((style >= last) || (*style == 0)) goto STYLE_DONE;
@@ -278,7 +279,7 @@
       // Truncate the name after the (english) modifiers description
       if (stop)
       {
-        *stop = 0; // Terminate the string at the first comma, if there is one
+//        *stop = 0; // Terminate the string at the first comma, if there is 
one
       }
 
       // Copy the font description into our list
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to