… | |
… | |
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" }, |
65 | { CS_JIS0201_1976_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0201*-0" }, |
66 | { CS_JIS0208_1983_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0208*-0" }, |
66 | { CS_JIS0208_1990_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0208*-0" }, |
67 | { CS_JIS0212_1990_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0212*-0" }, |
67 | { CS_JIS0212_1990_0, "-*-mincho-*-r-*--*-*-*-*-c-*-jisx0212*-0" }, |
68 | #endif |
68 | #endif |
69 | |
69 | |
70 | #if ENCODING_CN || ENCODING_CN_EXT |
70 | #if ENCODING_CN || ENCODING_CN_EXT |
71 | # if XFT |
71 | # if XFT |
… | |
… | |
268 | bool load (const rxvt_fontprop &prop) |
268 | bool load (const rxvt_fontprop &prop) |
269 | { |
269 | { |
270 | width = 1; height = 1; |
270 | width = 1; height = 1; |
271 | ascent = 1; descent = 0; |
271 | ascent = 1; descent = 0; |
272 | |
272 | |
|
|
273 | set_name ("built-in pseudofont"); |
|
|
274 | |
273 | return true; |
275 | return true; |
274 | } |
276 | } |
275 | |
277 | |
276 | bool has_codepoint (uint32_t unicode) |
278 | bool has_codepoint (unicode_t unicode) |
277 | { |
279 | { |
278 | if (unicode <= 0x001f) |
280 | if (unicode <= 0x001f) |
279 | return true; |
281 | return true; |
280 | |
282 | |
281 | if (unicode >= 0x0080 && unicode <= 0x009f) |
283 | if (unicode >= 0x0080 && unicode <= 0x009f) |
… | |
… | |
311 | |
313 | |
312 | XSetForeground (d.display->display, GC, r->PixColors[fg]); |
314 | XSetForeground (d.display->display, GC, r->PixColors[fg]); |
313 | |
315 | |
314 | while (len--) |
316 | while (len--) |
315 | { |
317 | { |
|
|
318 | #if ENABLE_COMBINING |
316 | compose_char *cc; |
319 | compose_char *cc; |
|
|
320 | #endif |
317 | text_t t = *text++; |
321 | text_t t = *text++; |
318 | |
322 | |
319 | // is it in our linedrawing table? |
323 | // is it in our linedrawing table? |
320 | if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) |
324 | if (t >= 0x2500 & t <= 0x2580 && linedraw_cmds[t - 0x2500]) |
321 | { |
325 | { |
… | |
… | |
350 | } |
354 | } |
351 | |
355 | |
352 | gcv.line_width = 0; |
356 | gcv.line_width = 0; |
353 | XChangeGC (d.display->display, GC, GCLineWidth, &gcv); |
357 | XChangeGC (d.display->display, GC, GCLineWidth, &gcv); |
354 | } |
358 | } |
|
|
359 | #if ENABLE_COMBINING |
355 | else if (IS_COMPOSE (t) && (cc = rxvt_composite[t])) |
360 | else if (IS_COMPOSE (t) && (cc = rxvt_composite[t])) |
356 | { |
361 | { |
357 | rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)]; |
362 | rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)]; |
358 | f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg); |
363 | f1->draw (d, x, y, &(t = cc->c1), 1, fg, bg); |
359 | if (cc->c2 != NOCHAR) |
364 | if (cc->c2 != NOCHAR) |
… | |
… | |
364 | : (*fs)[fs->find_font (cc->c2)]; |
369 | : (*fs)[fs->find_font (cc->c2)]; |
365 | |
370 | |
366 | f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1); |
371 | f2->draw (d, x, y, &(t = cc->c2), 1, fg, -1); |
367 | } |
372 | } |
368 | } |
373 | } |
|
|
374 | #endif |
369 | else |
375 | else |
370 | switch (t) |
376 | switch (t) |
371 | { |
377 | { |
372 | case ZERO_WIDTH_CHAR: |
378 | case ZERO_WIDTH_CHAR: |
373 | break; |
379 | break; |
… | |
… | |
398 | |
404 | |
399 | rxvt_fontprop properties (); |
405 | rxvt_fontprop properties (); |
400 | |
406 | |
401 | bool load (const rxvt_fontprop &prop); |
407 | bool load (const rxvt_fontprop &prop); |
402 | |
408 | |
403 | bool has_codepoint (uint32_t unicode); |
409 | bool has_codepoint (unicode_t unicode); |
404 | |
410 | |
405 | void draw (rxvt_drawable &d, int x, int y, |
411 | void draw (rxvt_drawable &d, int x, int y, |
406 | const text_t *text, int len, |
412 | const text_t *text, int len, |
407 | int fg, int bg); |
413 | int fg, int bg); |
408 | |
414 | |
… | |
… | |
655 | f = 0; |
661 | f = 0; |
656 | } |
662 | } |
657 | } |
663 | } |
658 | |
664 | |
659 | bool |
665 | bool |
660 | rxvt_font_x11::has_codepoint (uint32_t unicode) |
666 | rxvt_font_x11::has_codepoint (unicode_t unicode) |
661 | { |
667 | { |
662 | uint32_t ch = FROM_UNICODE (cs, unicode); |
668 | uint32_t ch = FROM_UNICODE (cs, unicode); |
663 | |
669 | |
664 | if (ch == NOCHAR) |
670 | if (ch == NOCHAR) |
665 | return false; |
671 | return false; |
… | |
… | |
807 | |
813 | |
808 | void draw (rxvt_drawable &d, int x, int y, |
814 | void draw (rxvt_drawable &d, int x, int y, |
809 | const text_t *text, int len, |
815 | const text_t *text, int len, |
810 | int fg, int bg); |
816 | int fg, int bg); |
811 | |
817 | |
812 | bool has_codepoint (uint32_t unicode); |
818 | bool has_codepoint (unicode_t unicode); |
813 | |
819 | |
814 | protected: |
820 | protected: |
815 | XftFont *f; |
821 | XftFont *f; |
816 | }; |
822 | }; |
817 | |
823 | |
… | |
… | |
930 | |
936 | |
931 | return true; |
937 | return true; |
932 | } |
938 | } |
933 | |
939 | |
934 | bool |
940 | bool |
935 | rxvt_font_xft::has_codepoint (uint32_t unicode) |
941 | rxvt_font_xft::has_codepoint (unicode_t unicode) |
936 | { |
942 | { |
937 | return XftCharExists (DISPLAY, f, unicode); |
943 | return XftCharExists (DISPLAY, f, unicode); |
938 | } |
944 | } |
939 | |
945 | |
940 | void |
946 | void |
… | |
… | |
1143 | |
1149 | |
1144 | return true; |
1150 | return true; |
1145 | } |
1151 | } |
1146 | |
1152 | |
1147 | int |
1153 | int |
1148 | rxvt_fontset::find_font (uint32_t unicode) |
1154 | rxvt_fontset::find_font (unicode_t unicode) |
1149 | { |
1155 | { |
1150 | for (unsigned int i = 0; i < fonts.size (); i++) |
1156 | for (unsigned int i = 0; i < fonts.size (); i++) |
1151 | { |
1157 | { |
1152 | rxvt_font *f = fonts[i]; |
1158 | rxvt_font *f = fonts[i]; |
1153 | |
1159 | |