… | |
… | |
1162 | |
1162 | |
1163 | return true; |
1163 | return true; |
1164 | } |
1164 | } |
1165 | |
1165 | |
1166 | int |
1166 | int |
1167 | rxvt_fontset::find_font (unicode_t unicode) |
1167 | rxvt_fontset::find_font (unicode_t unicode, bool bold) |
1168 | { |
1168 | { |
1169 | for (unsigned int i = !!(0x20 <= unicode && unicode <= 0x7f); // skip pseudo-font for ascii |
1169 | for (unsigned int i = !!(0x20 <= unicode && unicode <= 0x7f); // skip pseudo-font for ascii |
1170 | i < fonts.size (); |
1170 | i < fonts.size (); |
1171 | i++) |
1171 | i++) |
1172 | { |
1172 | { |
… | |
… | |
1179 | |
1179 | |
1180 | if (!realize_font (i)) |
1180 | if (!realize_font (i)) |
1181 | goto next_font; |
1181 | goto next_font; |
1182 | } |
1182 | } |
1183 | |
1183 | |
|
|
1184 | if (f->cs == CS_UNKNOWN) |
|
|
1185 | goto next_font; |
|
|
1186 | |
|
|
1187 | if (bold && f->properties ().weight < rxvt_fontprop::bold) |
|
|
1188 | goto next_font; |
|
|
1189 | |
1184 | if (f->cs != CS_UNKNOWN && f->has_codepoint (unicode)) |
1190 | if (f->has_codepoint (unicode)) |
1185 | return i; |
1191 | return i; |
1186 | |
1192 | |
1187 | next_font: |
1193 | next_font: |
1188 | if (i == fonts.size () - 1 && fallback->name) |
1194 | if (i == fonts.size () - 1 && fallback->name) |
1189 | { |
1195 | { |
… | |
… | |
1191 | fallback++; |
1197 | fallback++; |
1192 | i = 0; |
1198 | i = 0; |
1193 | } |
1199 | } |
1194 | } |
1200 | } |
1195 | |
1201 | |
|
|
1202 | // if no bold font found, use a regular one |
|
|
1203 | if (bold) |
|
|
1204 | return find_font (unicode); |
|
|
1205 | |
1196 | return 0; /* we must return SOME font */ |
1206 | return 0; /* we must return SOME font */ |
1197 | } |
1207 | } |
1198 | |
1208 | |
1199 | |
1209 | |
1200 | |
1210 | |