… | |
… | |
60 | #if ENCODING_JP || ENCODING_JP_EXT |
60 | #if ENCODING_JP || ENCODING_JP_EXT |
61 | # if XFT |
61 | # if XFT |
62 | // prefer xft for complex scripts |
62 | // prefer xft for complex scripts |
63 | { CS_UNICODE, "xft:Kochi Gothic:antialias=false" }, |
63 | { CS_UNICODE, "xft:Kochi Gothic:antialias=false" }, |
64 | # endif |
64 | # endif |
|
|
65 | { CS_JIS0201_1976_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0201*-0" }, |
|
|
66 | { CS_JIS0208_1990_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0208*-0" }, |
|
|
67 | { CS_JIS0212_1990_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0212*-0" }, |
65 | { CS_JIS0201_1976_0, "-*-*-*-r-*--*-*-*-*-c-*-jisx0201*-0" }, |
68 | { CS_JIS0201_1976_0, "-*-*-*-r-*--*-*-*-*-c-*-jisx0201*-0" }, |
66 | { CS_JIS0208_1990_0, "-*-*-*-r-*--*-*-*-*-c-*-jisx0208*-0" }, |
69 | { CS_JIS0208_1990_0, "-*-*-*-r-*--*-*-*-*-c-*-jisx0208*-0" }, |
67 | { CS_JIS0212_1990_0, "-*-*-*-r-*--*-*-*-*-c-*-jisx0212*-0" }, |
70 | { CS_JIS0212_1990_0, "-*-*-*-r-*--*-*-*-*-c-*-jisx0212*-0" }, |
68 | #endif |
71 | #endif |
69 | |
72 | |
… | |
… | |
133 | { |
136 | { |
134 | if (len > enc_len) |
137 | if (len > enc_len) |
135 | { |
138 | { |
136 | free (enc_buf); |
139 | free (enc_buf); |
137 | enc_buf = malloc (len); |
140 | enc_buf = malloc (len); |
|
|
141 | enc_len = len; |
138 | } |
142 | } |
139 | |
143 | |
140 | return enc_buf; |
144 | return enc_buf; |
141 | } |
145 | } |
142 | |
146 | |
… | |
… | |
1159 | |
1163 | |
1160 | return true; |
1164 | return true; |
1161 | } |
1165 | } |
1162 | |
1166 | |
1163 | int |
1167 | int |
1164 | rxvt_fontset::find_font (unicode_t unicode) |
1168 | rxvt_fontset::find_font (unicode_t unicode, bool bold) |
1165 | { |
1169 | { |
1166 | for (unsigned int i = !!(0x20 <= unicode && unicode <= 0x7f); // skip pseudo-font for ascii |
1170 | for (unsigned int i = !!(0x20 <= unicode && unicode <= 0x7f); // skip pseudo-font for ascii |
1167 | i < fonts.size (); |
1171 | i < fonts.size (); |
1168 | i++) |
1172 | i++) |
1169 | { |
1173 | { |
… | |
… | |
1176 | |
1180 | |
1177 | if (!realize_font (i)) |
1181 | if (!realize_font (i)) |
1178 | goto next_font; |
1182 | goto next_font; |
1179 | } |
1183 | } |
1180 | |
1184 | |
|
|
1185 | if (f->cs == CS_UNKNOWN) |
|
|
1186 | goto next_font; |
|
|
1187 | |
|
|
1188 | if (bold && f->properties ().weight < rxvt_fontprop::bold) |
|
|
1189 | goto next_font; |
|
|
1190 | |
1181 | if (f->cs != CS_UNKNOWN && f->has_codepoint (unicode)) |
1191 | if (f->has_codepoint (unicode)) |
1182 | return i; |
1192 | return i; |
1183 | |
1193 | |
1184 | next_font: |
1194 | next_font: |
1185 | if (i == fonts.size () - 1 && fallback->name) |
1195 | if (i == fonts.size () - 1 && fallback->name) |
1186 | { |
1196 | { |
… | |
… | |
1188 | fallback++; |
1198 | fallback++; |
1189 | i = 0; |
1199 | i = 0; |
1190 | } |
1200 | } |
1191 | } |
1201 | } |
1192 | |
1202 | |
|
|
1203 | // if no bold font found, use a regular one |
|
|
1204 | if (bold) |
|
|
1205 | return find_font (unicode); |
|
|
1206 | |
1193 | return 0; /* we must return SOME font */ |
1207 | return 0; /* we must return SOME font */ |
1194 | } |
1208 | } |
1195 | |
1209 | |
1196 | |
1210 | |
1197 | |
1211 | |