diff options
| author | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 18:12:40 +0500 |
|---|---|---|
| committer | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 18:12:40 +0500 |
| commit | b4995f979d127cea667b4e2b71c91e9db4ab52ef (patch) | |
| tree | fbebc775e10932bace8d6a7c3481b1ba200c64db /src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx | |
| parent | 9575eb0a1ffa8150f70f88b5f6b55f342c3c0088 (diff) | |
wip
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.cxx | 15 |
1 files changed, 10 insertions, 5 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 a7537a184..92b0e0ef6 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx @@ -489,7 +489,8 @@ static XftFont* fontopen(const char* name, /*Fl_Fontsize*/double size, bool core int comma_count = 0; unsigned len = strlen(name); if (len > 512) len = 512; // ensure we are not passed an unbounded font name - for(unsigned idx = 0; idx < len; idx++) { + unsigned idx; + for (idx = 0; idx < len; idx++) { if(name[idx] == '-') hyphen_count++; // check for XLFD hyphens if(name[idx] == ',') comma_count++; // are there multiple names? } @@ -897,7 +898,8 @@ int Fl_Xlib_Graphics_Driver::get_font_sizes(Fl_Font fnum, int*& sizep) { array = new int[array_size = fs->nfont+1]; } array[0] = 0; int j = 1; // claim all fonts are scalable - for (int i = 0; i < fs->nfont; i++) { + int i; + for (i = 0; i < fs->nfont; i++) { double v; if (XftPatternGetDouble(fs->fonts[i], XFT_PIXEL_SIZE, 0, &v) == XftResultMatch) { array[j++] = int(v); @@ -1309,7 +1311,8 @@ double Fl_Xlib_Graphics_Driver::width_unscaled(unsigned int utf32) { } if (!desc->width[r]) { desc->width[r] = (int*)new int[0x0400]; - for (int i = 0; i < 0x0400; i++) desc->width[r][i] = -1; + int i; + for (i = 0; i < 0x0400; i++) desc->width[r][i] = -1; } else { if ( desc->width[r][utf32&0x03FF] >= 0 ) { // already cached return double(desc->width[r][utf32 & 0x03FF]); @@ -1412,13 +1415,15 @@ Fl_Font Fl_Xlib_Graphics_Driver::set_fonts(const char* pattern_name) Fl_Xlib_Graphics_Driver::context(); Fl_Xlib_Graphics_Driver::init_built_in_fonts(); pango_font_map_list_families(Fl_Xlib_Graphics_Driver::pfmap_, &families, &n_families); - for (int fam = 0; fam < n_families; fam++) { + int fam; + for (fam = 0; fam < n_families; fam++) { PangoFontFace **faces; int n_faces; const char *fam_name = pango_font_family_get_name (families[fam]); int lfam = strlen(fam_name); pango_font_family_list_faces(families[fam], &faces, &n_faces); - for (int j = 0; j < n_faces; j++) { + int j; + for (j = 0; j < n_faces; j++) { const char *p = pango_font_face_get_face_name(faces[j]); // Remove " Regular" suffix from font names if (!strcasecmp(p, "regular")) p = NULL; |
