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

Comparing rxvt-unicode/src/rxvtfont.C (file contents):
Revision 1.91 by root, Mon Jan 30 04:27:17 2006 UTC vs.
Revision 1.92 by root, Mon Jan 30 04:53:30 2006 UTC

129 { CS_KSC5601_1987_0, "xft:Baekmuk Gulim:antialias=false" }, 129 { CS_KSC5601_1987_0, "xft:Baekmuk Gulim:antialias=false" },
130 { CS_KSC5601_1987_0, "xft::lang=ko:antialias=false" }, 130 { CS_KSC5601_1987_0, "xft::lang=ko:antialias=false" },
131# endif 131# endif
132#endif 132#endif
133 133
134 // generic font fallback
135 { CS_UNICODE, "-*-lucidatypewriter-*-*-*-*-*-*-*-*-m-*-iso10646-1" }, 134 { CS_UNICODE, "-*-lucidatypewriter-*-*-*-*-*-*-*-*-m-*-iso10646-1" },
136 { CS_UNICODE, "-*-unifont-*-*-*-*-*-*-*-*-c-*-iso10646-1" }, 135 //{ CS_UNICODE, "-*-unifont-*-*-*-*-*-*-*-*-c-*-iso10646-1" }, // this gem of a font has actual dotted circles within the combining character glyphs.
137 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" },
138 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" },
139#if XFT 136#if XFT
140 { CS_UNICODE, "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true" }, 137 { CS_UNICODE, "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true" },
141 { CS_UNICODE, "xft:Courier New:antialias=false:autohint=true" }, 138 { CS_UNICODE, "xft:Courier New:antialias=false:autohint=true" },
142 { CS_UNICODE, "xft:Andale Mono:antialias=false:autohint=false" }, 139 { CS_UNICODE, "xft:Andale Mono:antialias=false:autohint=false" },
143 { CS_UNICODE, "xft:Arial Unicode MS:antialias=false:autohint=false" }, 140 { CS_UNICODE, "xft:Arial Unicode MS:antialias=false:autohint=false" },
144 141
145 // FreeMono is usually uglier than x fonts, so try last only. 142 // FreeMono is usually uglier than x fonts, so try after the others
146 { CS_UNICODE, "xft:FreeMono:autohint=true" }, 143 { CS_UNICODE, "xft:FreeMono:autohint=true" },
147#endif 144#endif
148 145
146 // generic font fallback, put this last, as many iso10646 fonts have extents
147 // specified for all glyphs in the range they cover, but most are simply empty
148 //{ CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" },
149 //{ CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" },
149 { CS_UNKNOWN, 0 } 150 { CS_UNKNOWN, 0 }
150}; 151};
151 152
152// these characters are used to guess the font height and width 153// these characters are used to guess the font height and width
153// pango uses a similar algorithm and doesn't trust the font either. 154// pango uses a similar algorithm and doesn't trust the font either.
861 862
862 XCharStruct g; 863 XCharStruct g;
863 int dir_ret, asc_ret, des_ret; 864 int dir_ret, asc_ret, des_ret;
864 XTextExtents16 (f, &ch, 1, &dir_ret, &asc_ret, &des_ret, &g); 865 XTextExtents16 (f, &ch, 1, &dir_ret, &asc_ret, &des_ret, &g);
865 866
867 int wcw = WCWIDTH (*t);
866 int wcw = WCWIDTH (*t); if (wcw > 0) g.width = (g.width + wcw - 1) / wcw; 868 if (wcw > 0) g.width = (g.width + wcw - 1) / wcw;
867 869
868 if (width < g.width) width = g.width; 870 if (width < g.width) width = g.width;
869 } 871 }
870 872
871 if (cs == CS_UNKNOWN) 873 if (cs == CS_UNKNOWN)
945 if (!prop || prop->width == rxvt_fontprop::unset) 947 if (!prop || prop->width == rxvt_fontprop::unset)
946 return true; 948 return true;
947 949
948 // check wether character overlaps previous/next character 950 // check wether character overlaps previous/next character
949 int w = xcs->rbearing - xcs->lbearing; 951 int w = xcs->rbearing - xcs->lbearing;
950 int wcw = WCWIDTH (unicode); 952 int wcw = max (WCWIDTH (unicode), 1);
951 953
952 careful = xcs->lbearing < 0 || xcs->rbearing > prop->width * wcw; 954 careful = xcs->lbearing < 0 || xcs->rbearing > prop->width * wcw;
953 955
954 if (careful && !OVERLAP_OK (w, wcw, prop)) 956 if (careful && !OVERLAP_OK (w, wcw, prop))
955 return false; 957 return false;
1261 FcChar32 ch = unicode; 1263 FcChar32 ch = unicode;
1262 XGlyphInfo g; 1264 XGlyphInfo g;
1263 XftTextExtents32 (term->xdisp, f, &ch, 1, &g); 1265 XftTextExtents32 (term->xdisp, f, &ch, 1, &g);
1264 1266
1265 int w = g.width - g.x; 1267 int w = g.width - g.x;
1266 int wcw = WCWIDTH (unicode); 1268 int wcw = max (WCWIDTH (unicode), 1);
1267 1269
1268 careful = g.x > 0 || w > prop->width * wcw; 1270 careful = g.x > 0 || w > prop->width * wcw;
1269 1271
1270 if (careful && !OVERLAP_OK (w, wcw, prop)) 1272 if (careful && !OVERLAP_OK (w, wcw, prop))
1271 return false; 1273 return false;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines