Skip to content

Commit

Permalink
Fix "Fl::get_font_name() with Pango is inconsistent"-cont'd (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManoloFLTK committed Jun 6, 2023
1 parent fcca08d commit 11c38c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,10 @@ Fl_Font Fl_Cairo_Graphics_Driver::set_fonts(const char* /*pattern_name*/)
// Force LANG=C to prevent pango_font_face_get_face_name() below from returning
// translated versions of Bold, Italic, etc… (see issue #732).
// Unfortunately, using setlocale() doesn't do the job.
saved_lang = strdup(saved_lang);
char *p = saved_lang;
saved_lang = (char*)malloc(strlen(p) + 6);
memcpy(saved_lang, "LANG=", 5);
strcpy(saved_lang + 5, p);
fl_putenv(Clang);
} else saved_lang = NULL;
static PangoFontMap *pfmap_ = pango_cairo_font_map_get_default(); // 1.10
Expand Down
5 changes: 4 additions & 1 deletion src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,10 @@ Fl_Font Fl_Xlib_Graphics_Driver::set_fonts(const char* pattern_name)
// Force LANG=C to prevent pango_font_face_get_face_name() below from returning
// translated versions of Bold, Italic, etc… (see issue #732).
// Unfortunately, using setlocale() doesn't do the job.
saved_lang = strdup(saved_lang);
char *p = saved_lang;
saved_lang = (char*)malloc(strlen(p) + 6);
memcpy(saved_lang, "LANG=", 5);
strcpy(saved_lang + 5, p);
fl_putenv(Clang);
} else saved_lang = NULL;
for (int fam = 0; fam < n_families; fam++) {
Expand Down

0 comments on commit 11c38c3

Please sign in to comment.