summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-08-13 13:51:14 +0000
committerManolo Gouy <Manolo>2017-08-13 13:51:14 +0000
commit01a885f911f4f16a10031c474fe427760d2f74f9 (patch)
tree649d54b88741458810506e9de55b8ad3f1a9adc0
parent67a63d40e03b41337c50a21b8e6bd05f47347438 (diff)
Fl_Xlib_Graphics_Driver::set_fonts() with Pango: handle case when 'Regular' is not alone in face name.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12378 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx4
1 files changed, 3 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 184eff1f7..b2225a956 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
@@ -1347,7 +1347,9 @@ Fl_Font Fl_Xlib_Graphics_Driver::set_fonts(const char* pattern_name)
char *p = strdup(pango_font_face_get_face_name(faces[j]));
int lp = strlen(p);
// build the font's FLTK name
- if (strcmp(p, "Regular") == 0) *p = 0;
+ if (strcmp(p + lp - 7, "Regular") == 0 ) {
+ *(p+lp-7) = 0;
+ }
else if (strcmp(p + lp - 12, "Bold Oblique") == 0 ) {
*(p+lp-12) = 0; prefix = 'P';
}