summaryrefslogtreecommitdiff
path: root/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-08-25 15:33:05 +0000
committerManolo Gouy <Manolo>2017-08-25 15:33:05 +0000
commit9eeac9c73777e0ffb1c7b5703d1c05fca1d703f0 (patch)
treec9058d436f23a804f35b4d1b7d9d60de8928c377 /src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
parent475d2504bd954d51cefaaf112b316638dbb04ebc (diff)
X11+xft-pango: have Fl::set_fonts() show fonts with black, light, medium, demi bold, oblique styles.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12398 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx')
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
index b2225a956..2f9ca8b4c 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
@@ -248,10 +248,21 @@ static void make_raw_name(char *raw, char *pretty)
case 'B':
if (strncasecmp(style, "Bold", 4) == 0)
{
- mods |= BOLD;
+ if (!strstr(raw, " Demi Bold")) mods |= BOLD;
}
+ else if (strncasecmp(style, "Black", 5) == 0)
+ {
+ if (!strstr(raw, " Black")) strcat(raw, " Black");
+ }
goto NEXT_STYLE;
+ case 'D':
+ if (strncasecmp(style, "Demi Bold", 7) == 0)
+ {
+ if (!strstr(raw, " Demi Bold")) strcat(raw, " Demi Bold");
+ }
+ goto NEXT_STYLE;
+
case 'O':
if (strncasecmp(style, "Oblique", 7) == 0)
{
@@ -265,6 +276,20 @@ static void make_raw_name(char *raw, char *pretty)
mods |= BOLD;
}
goto NEXT_STYLE;
+
+ case 'L':
+ if (strncasecmp(style, "Light", 5) == 0)
+ {
+ if (!strstr(raw, " Light")) strcat(raw, " Light");
+ }
+ goto NEXT_STYLE;
+
+ case 'M':
+ if (strncasecmp(style, "Medium", 6) == 0)
+ {
+ if (!strstr(raw, " Medium")) strcat(raw, " Medium");
+ }
+ goto NEXT_STYLE;
default: // find the next gap
goto NEXT_STYLE;