DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2215
Version: 1.3-current
Fix Version: 1.1.10 (r6871)
Link: http://www.fltk.org/str.php?L2215
Version: 1.3-current
Fix Version: 1.1.10 (r6871)
Index: fl_font_xft.cxx
===================================================================
--- fl_font_xft.cxx (revision 7555)
+++ fl_font_xft.cxx (working copy)
@@ -399,20 +399,56 @@
int size = fl_size_;
const char *wt_med = "medium";
const char *wt_bold = "bold";
- char *weight = (char *)wt_med; // no specifc weight requested - accept any
+ const char *weight = wt_med; // no specifc weight requested - accept any
char slant = 'r'; // regular non-italic by default
char xlfd[128]; // we will put our synthetic XLFD in here
char *pc = strdup(fl_fonts[fl_font_].name); // what font were we asked for?
- char *name = pc; // keep a handle to the original name for freeing later
+ const char *name = pc; // keep a handle to the original name for freeing
later
// Parse the "fltk-name" of the font
switch (*name++) {
case 'I': slant = 'i'; break; // italic
case 'P': slant = 'i'; // bold-italic (falls-through)
- case 'B': weight = (char*)wt_bold; break; // bold
+ case 'B': weight = wt_bold; break; // bold
case ' ': break; // regular
default: name--; // no prefix, restore name
}
+ if (fl_fonts == built_in_table) {
+ // use typical core font names per fl_font_x.cxx
+ switch (fl_font_) {
+ case FL_HELVETICA:
+ case FL_HELVETICA_BOLD:
+ case FL_HELVETICA_ITALIC:
+ case FL_HELVETICA_BOLD_ITALIC:
+ name = "helvetica";
+ break;
+ case FL_COURIER:
+ case FL_COURIER_BOLD:
+ case FL_COURIER_ITALIC:
+ case FL_COURIER_BOLD_ITALIC:
+ name = "courier";
+ break;
+ case FL_TIMES:
+ case FL_TIMES_BOLD:
+ case FL_TIMES_ITALIC:
+ case FL_TIMES_BOLD_ITALIC:
+ name = "times";
+ break;
+ case FL_SYMBOL:
+ name = "symbol";
+ break;
+ case FL_SCREEN:
+ case FL_SCREEN_BOLD:
+ name = "lucidatypewriter";
+ break;
+ case FL_ZAPF_DINGBATS:
+ name = "zapf dingbats";
+ break;
+ default:
+ break;
+ }
+ }
+
// first, we do a query with no prefered size, to see if the font exists at
all
snprintf(xlfd, 128, "-*-*%s*-%s-%c-*--*-*-*-*-*-*-*-*", name, weight,
slant); // make up xlfd style name
xgl_font = XLoadQueryFont(fl_display, xlfd);
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs