ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/defaultfont.C
(Generate patch)

Comparing rxvt-unicode/src/defaultfont.C (file contents):
Revision 1.12 by pcg, Fri Dec 26 07:42:23 2003 UTC vs.
Revision 1.14 by pcg, Thu Jan 29 00:27:16 2004 UTC

73 { CS_BIG5_EXT, "xft:AR PL Mingti2L Big5" }, 73 { CS_BIG5_EXT, "xft:AR PL Mingti2L Big5" },
74 { CS_BIG5_EXT, "xft:AR PL KaitiM Big5" }, 74 { CS_BIG5_EXT, "xft:AR PL KaitiM Big5" },
75 { CS_GB2312_1980_0, "xft:AR PL KaitiM GB" }, 75 { CS_GB2312_1980_0, "xft:AR PL KaitiM GB" },
76 { CS_GB2312_1980_0, "xft:AR PL SungtiL GB" }, 76 { CS_GB2312_1980_0, "xft:AR PL SungtiL GB" },
77# endif 77# endif
78 { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-gb2312*-0 },
78 { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643.1992-1" }, 79 { CS_CNS11643_1992_1, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-1" },
79 { CS_CNS11643_1992_2, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643.1992-2" }, 80 { CS_CNS11643_1992_2, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-2" },
80 { CS_CNS11643_1992_3, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643.1992-3" }, 81 { CS_CNS11643_1992_3, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-3" },
81 { CS_CNS11643_1992_4, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643.1992-4" }, 82 { CS_CNS11643_1992_4, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-4" },
82 { CS_CNS11643_1992_5, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643.1992-5" }, 83 { CS_CNS11643_1992_5, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-5" },
83 { CS_CNS11643_1992_6, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643.1992-6" }, 84 { CS_CNS11643_1992_6, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-6" },
84 { CS_CNS11643_1992_7, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643.1992-7" }, 85 { CS_CNS11643_1992_7, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-7" },
85 { CS_CNS11643_1992_F, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643.1992-f" }, 86 { CS_CNS11643_1992_F, "-*-*-*-*-*-*-*-*-*-*-c-*-cns11643*-f" },
86#endif 87#endif
87 88
88#if XFT 89#if XFT
89 { CS_UNICODE, "xft:Andale Mono" }, 90 { CS_UNICODE, "xft:Andale Mono" },
90 { CS_UNICODE, "xft:Arial Unicode MS" }, 91 { CS_UNICODE, "xft:Arial Unicode MS" },
915 { 916 {
916 while (len) 917 while (len)
917 { 918 {
918 if (*text != NOCHAR && *text != ' ') 919 if (*text != NOCHAR && *text != ' ')
919 { 920 {
921 int fwidth = r->TermWin.fwidth;
922 if (len >= 2 && text[1] == NOCHAR)
923 fwidth *= 2;
924
920 XGlyphInfo extents; 925 XGlyphInfo extents;
921 if (sizeof (text_t) == sizeof (FcChar16)) 926 if (sizeof (text_t) == sizeof (FcChar16))
922 { 927 {
923 XftTextExtents16 (DISPLAY, f, (const FcChar16 *)text, 1, &extents); 928 XftTextExtents16 (DISPLAY, f, (const FcChar16 *)text, 1, &extents);
924 XftDrawString16 (d, &r->PixColors[fg].c, f, x + extents.x + (r->TermWin.fwidth - extents.width) / 2, 929 XftDrawString16 (d, &r->PixColors[fg].c, f, x + extents.x + (fwidth - extents.width) / 2,
925 y + r->TermWin.fbase, (const FcChar16 *)text, 1); 930 y + r->TermWin.fbase, (const FcChar16 *)text, 1);
926 } 931 }
927 else 932 else
928 { 933 {
929 XGlyphInfo extents; 934 XGlyphInfo extents;
930 XftTextExtents32 (DISPLAY, f, (const FcChar32 *)text, 1, &extents); 935 XftTextExtents32 (DISPLAY, f, (const FcChar32 *)text, 1, &extents);
931 XftDrawString32 (d, &r->PixColors[fg].c, f, x + extents.x + (r->TermWin.fwidth - extents.width) / 2, 936 XftDrawString32 (d, &r->PixColors[fg].c, f, x + extents.x + (fwidth - extents.width) / 2,
932 y + r->TermWin.fbase, (const FcChar32 *)text, 1); 937 y + r->TermWin.fbase, (const FcChar32 *)text, 1);
933 } 938 }
934 } 939 }
935 940
936 x += r->TermWin.fwidth; 941 x += r->TermWin.fwidth;
1086 base_id = 1; 1091 base_id = 1;
1087 1092
1088 // we currently need a base-font, no matter what 1093 // we currently need a base-font, no matter what
1089 if (fonts.size () <= base_id || !realize_font (base_id)) 1094 if (fonts.size () <= base_id || !realize_font (base_id))
1090 { 1095 {
1096 puts ("unable to load specified font(s), falling back to 'fixed'\n");
1091 add_fonts ("fixed"); 1097 add_fonts ("fixed");
1092 base_id = fonts.size () - 1; 1098 base_id = fonts.size () - 1;
1093 } 1099 }
1094 1100
1095 if (fonts.size () <= base_id || !realize_font (base_id)) 1101 if (fonts.size () <= base_id || !realize_font (base_id))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines