… | |
… | |
56 | static char curlocale[128], savelocale[128]; |
56 | static char curlocale[128], savelocale[128]; |
57 | |
57 | |
58 | bool |
58 | bool |
59 | rxvt_set_locale (const char *locale) NOTHROW |
59 | rxvt_set_locale (const char *locale) NOTHROW |
60 | { |
60 | { |
61 | int len = strlen (locale) + 1; |
61 | int size = strlen (locale) + 1; |
62 | |
62 | |
63 | if (len > sizeof (curlocale)) |
63 | if (size > sizeof (curlocale)) |
64 | rxvt_fatal ("locale string too long, aborting.\n"); |
64 | rxvt_fatal ("locale string too long, aborting.\n"); |
65 | |
65 | |
66 | if (!locale || !memcmp (locale, curlocale, len)) |
66 | if (!locale || !memcmp (locale, curlocale, size)) |
67 | return false; |
67 | return false; |
68 | |
68 | |
69 | memcpy (curlocale, locale, len); |
69 | memcpy (curlocale, locale, size); |
70 | setlocale (LC_CTYPE, curlocale); |
70 | setlocale (LC_CTYPE, curlocale); |
71 | return true; |
71 | return true; |
72 | } |
72 | } |
73 | |
73 | |
74 | void |
74 | void |
… | |
… | |
270 | } |
270 | } |
271 | |
271 | |
272 | clear (); |
272 | clear (); |
273 | } |
273 | } |
274 | |
274 | |
275 | delete pix_colors_focused; |
275 | delete [] pix_colors_focused; |
276 | #if OFF_FOCUS_FADING |
276 | #if OFF_FOCUS_FADING |
277 | delete pix_colors_unfocused; |
277 | delete [] pix_colors_unfocused; |
278 | #endif |
278 | #endif |
279 | |
279 | |
280 | displays.put (display); |
280 | displays.put (display); |
281 | |
281 | |
282 | scr_release (); |
282 | scr_release (); |
… | |
… | |
812 | delete fontset[0]; |
812 | delete fontset[0]; |
813 | fontset[0] = fs; |
813 | fontset[0] = fs; |
814 | |
814 | |
815 | prop = (*fs)[1]->properties (); |
815 | prop = (*fs)[1]->properties (); |
816 | prop.height += lineSpace; |
816 | prop.height += lineSpace; |
|
|
817 | |
817 | fs->set_prop (prop); |
818 | fs->set_prop (prop, false); |
818 | |
819 | |
819 | fwidth = prop.width; |
820 | fwidth = prop.width; |
820 | fheight = prop.height; |
821 | fheight = prop.height; |
821 | fbase = prop.ascent; |
822 | fbase = prop.ascent; |
822 | |
823 | |
… | |
… | |
831 | { |
832 | { |
832 | fontset[style] = fs = new rxvt_fontset (this); |
833 | fontset[style] = fs = new rxvt_fontset (this); |
833 | rxvt_fontprop prop2 = prop; |
834 | rxvt_fontprop prop2 = prop; |
834 | |
835 | |
835 | if (res) |
836 | if (res) |
836 | prop2.weight = prop2.slant = rxvt_fontprop::unset; |
837 | { |
|
|
838 | fs->populate (res); |
|
|
839 | fs->set_prop (prop2, false); |
|
|
840 | } |
837 | else |
841 | else |
838 | { |
842 | { |
839 | res = fontset[0]->fontdesc; |
843 | fs->populate (fontset[0]->fontdesc); |
840 | |
844 | |
841 | if (SET_STYLE (0, style) & RS_Bold) prop2.weight = rxvt_fontprop::bold; |
845 | if (SET_STYLE (0, style) & RS_Bold) prop2.weight = rxvt_fontprop::bold; |
842 | if (SET_STYLE (0, style) & RS_Italic) prop2.slant = rxvt_fontprop::italic; |
846 | if (SET_STYLE (0, style) & RS_Italic) prop2.slant = rxvt_fontprop::italic; |
|
|
847 | |
|
|
848 | fs->set_prop (prop2, true); |
843 | } |
849 | } |
844 | |
850 | |
845 | fs->populate (res); |
|
|
846 | fs->set_prop (prop2); |
|
|
847 | } |
851 | } |
848 | #else |
852 | #else |
849 | fontset[style] = fontset[0]; |
853 | fontset[style] = fontset[0]; |
850 | #endif |
854 | #endif |
851 | } |
855 | } |