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.68 by root, Mon Feb 14 20:46:47 2005 UTC vs.
Revision 1.71 by root, Sat Jun 18 10:02:35 2005 UTC

14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details. 15 * GNU General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU General Public License 17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 *---------------------------------------------------------------------*/ 20 *---------------------------------------------------------------------*/
21 21
22#include "../config.h" 22#include "../config.h"
23#include "rxvt.h" 23#include "rxvt.h"
24#include "rxvtutil.h" 24#include "rxvtutil.h"
130 { CS_UNICODE, "-*-lucidatypewriter-*-*-*-*-*-*-*-*-m-*-iso10646-1" }, 130 { CS_UNICODE, "-*-lucidatypewriter-*-*-*-*-*-*-*-*-m-*-iso10646-1" },
131 { CS_UNICODE, "-*-unifont-*-*-*-*-*-*-*-*-c-*-iso10646-1" }, 131 { CS_UNICODE, "-*-unifont-*-*-*-*-*-*-*-*-c-*-iso10646-1" },
132 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" }, 132 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-c-*-iso10646-1" },
133 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" }, 133 { CS_UNICODE, "-*-*-*-r-*-*-*-*-*-*-m-*-iso10646-1" },
134#if XFT 134#if XFT
135 { CS_UNICODE, "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true"}, 135 { CS_UNICODE, "xft:Bitstream Vera Sans Mono:antialias=false:autohint=true" },
136 { CS_UNICODE, "xft:Courier New:antialias=false:autohint=true" }, 136 { CS_UNICODE, "xft:Courier New:antialias=false:autohint=true" },
137 { CS_UNICODE, "xft:Andale Mono:antialias=false" }, 137 { CS_UNICODE, "xft:Andale Mono:antialias=false:autohint=false" },
138 { CS_UNICODE, "xft:Arial Unicode MS:antialias=false" }, 138 { CS_UNICODE, "xft:Arial Unicode MS:antialias=false:autohint=false" },
139 139
140 // FreeMono is usually uglier than x fonts, so try last only. 140 // FreeMono is usually uglier than x fonts, so try last only.
141 { CS_UNICODE, "xft:FreeMono:autohint=true" }, 141 { CS_UNICODE, "xft:FreeMono:autohint=true" },
142#endif 142#endif
143 143
1254 1254
1255 XGlyphInfo extents; 1255 XGlyphInfo extents;
1256 FcChar32 *enc = (FcChar32 *) get_enc_buf (len * sizeof (FcChar32)); 1256 FcChar32 *enc = (FcChar32 *) get_enc_buf (len * sizeof (FcChar32));
1257 FcChar32 *ep = enc; 1257 FcChar32 *ep = enc;
1258 int ewidth = 0; 1258 int ewidth = 0;
1259 int xoff = 0;
1260 1259
1261 while (len) 1260 while (len)
1262 { 1261 {
1263 int cwidth = r->TermWin.fwidth; 1262 int cwidth = r->TermWin.fwidth;
1264 FcChar32 fc = *text++; len--; 1263 FcChar32 fc = *text++; len--;
1265 FT_UInt gl;
1266 1264
1267 while (len && *text == NOCHAR) 1265 while (len && *text == NOCHAR)
1268 text++, len--, cwidth += r->TermWin.fwidth; 1266 text++, len--, cwidth += r->TermWin.fwidth;
1269 1267
1270 gl = XftCharIndex (d.display->display, f, fc);
1271 XftGlyphExtents (d.display->display, f, &gl, 1, &extents);
1272
1273 if (extents.xOff != cwidth && ep != enc)
1274 {
1275 if (xoff > ewidth) xoff = ewidth;
1276 XftDrawGlyphs (d, &r->pix_colors[fg].c, f,
1277 x + (ewidth - xoff >> 1),
1278 y + base, enc, ep - enc);
1279 x += ewidth;
1280
1281 ep = enc;
1282 ewidth = 0;
1283 xoff = 0;
1284 }
1285
1286 if (fc == ' ' && ep == enc) // skip leading spaces 1268 if (fc == ' ' && ep == enc) // skip leading spaces
1287 {
1288 x += cwidth; 1269 x += cwidth;
1289 continue;
1290 }
1291
1292 else 1270 else
1293 { 1271 {
1272 FT_UInt gl = XftCharIndex (d.display->display, f, fc);
1273 XftGlyphExtents (d.display->display, f, &gl, 1, &extents);
1274
1275 if (extents.xOff != cwidth)
1276 {
1277 if (ewidth)
1278 {
1279 XftDrawGlyphs (d, &r->pix_colors[fg].c, f,
1280 x, y + base, enc, ep - enc);
1281 x += ewidth;
1282
1283 ep = enc;
1284 ewidth = 0;
1285 }
1286
1287 if (extents.xOff > cwidth)
1288 extents.xOff = cwidth;
1289
1290 XftDrawGlyphs (d, &r->pix_colors[fg].c, f,
1291 x + (cwidth - extents.xOff >> 1),
1292 y + base, &gl, 1);
1293 x += cwidth;
1294 }
1295 else
1296 {
1294 *ep++ = gl; 1297 *ep++ = gl;
1295 ewidth += cwidth; 1298 ewidth += cwidth;
1296 xoff += extents.xOff; 1299 }
1297 } 1300 }
1298 } 1301 }
1299 1302
1300 if (ep != enc) 1303 if (ep != enc)
1301 {
1302 if (xoff > ewidth) xoff = ewidth;
1303 XftDrawGlyphs (d, &r->pix_colors[fg].c, f, 1304 XftDrawGlyphs (d, &r->pix_colors[fg].c, f,
1304 x + (ewidth - xoff >> 1),
1305 y + base, enc, ep - enc); 1305 x, y + base, enc, ep - enc);
1306 }
1307} 1306}
1308#endif 1307#endif
1309 1308
1310///////////////////////////////////////////////////////////////////////////// 1309/////////////////////////////////////////////////////////////////////////////
1311 1310

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines