… | |
… | |
428 | |
428 | |
429 | XFontStruct *f = XLoadQueryFont (DISPLAY, name); |
429 | XFontStruct *f = XLoadQueryFont (DISPLAY, name); |
430 | |
430 | |
431 | if (f) |
431 | if (f) |
432 | { |
432 | { |
433 | // the font should really exists now. if not, we have a problem |
433 | // the font should really exist now. if not, we have a problem |
434 | // (e.g. if the user did xset fp rehash just when we were searching fonts). |
434 | // (e.g. if the user did xset fp rehash just when we were searching fonts). |
435 | // in that case, just return garbage. |
435 | // in that case, just return garbage. |
436 | bool ret = set_properties (p, f); |
436 | bool ret = set_properties (p, f); |
437 | XFreeFont (DISPLAY, f); |
437 | XFreeFont (DISPLAY, f); |
438 | return ret; |
438 | return ret; |
… | |
… | |
942 | #endif |
942 | #endif |
943 | |
943 | |
944 | ///////////////////////////////////////////////////////////////////////////// |
944 | ///////////////////////////////////////////////////////////////////////////// |
945 | |
945 | |
946 | rxvt_fontset::rxvt_fontset (rxvt_t r) |
946 | rxvt_fontset::rxvt_fontset (rxvt_t r) |
947 | : r(r) |
947 | : r (r) |
948 | { |
948 | { |
949 | clear (); |
949 | clear (); |
950 | } |
950 | } |
951 | |
951 | |
952 | rxvt_fontset::~rxvt_fontset () |
952 | rxvt_fontset::~rxvt_fontset () |
… | |
… | |
955 | } |
955 | } |
956 | |
956 | |
957 | void |
957 | void |
958 | rxvt_fontset::clear () |
958 | rxvt_fontset::clear () |
959 | { |
959 | { |
960 | for (rxvt_font **i = fonts.begin (); i != fonts.end(); i++) |
960 | for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++) |
961 | FONT_UNREF (*i); |
961 | FONT_UNREF (*i); |
962 | |
962 | |
963 | fonts.clear (); |
963 | fonts.clear (); |
964 | base_id = 0; |
964 | base_id = 0; |
965 | base_prop.height = 0x7fffffff; |
965 | base_prop.height = 0x7fffffff; |
… | |
… | |
1084 | base_id = 1; |
1084 | base_id = 1; |
1085 | |
1085 | |
1086 | // we currently need a base-font, no matter what |
1086 | // we currently need a base-font, no matter what |
1087 | if ((int)fonts.size () <= base_id || !realize_font (base_id)) |
1087 | if ((int)fonts.size () <= base_id || !realize_font (base_id)) |
1088 | { |
1088 | { |
1089 | puts ("unable to load specified font(s), falling back to 'fixed'\n"); |
1089 | puts ("unable to load specified font (s), falling back to 'fixed'\n"); |
1090 | add_fonts ("fixed"); |
1090 | add_fonts ("fixed"); |
1091 | base_id = fonts.size () - 1; |
1091 | base_id = fonts.size () - 1; |
1092 | } |
1092 | } |
1093 | |
1093 | |
1094 | if ((int)fonts.size () <= base_id || !realize_font (base_id)) |
1094 | if ((int)fonts.size () <= base_id || !realize_font (base_id)) |