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.93 by root, Tue Jan 31 00:25:16 2006 UTC vs.
Revision 1.94 by root, Thu Feb 2 18:04:46 2006 UTC

158 0x304c, 0x672c, // が本 158 0x304c, 0x672c, // が本
159}; 159};
160 160
161#define NUM_EXTENT_TEST_CHARS (sizeof (extent_test_chars) / sizeof (extent_test_chars[0])) 161#define NUM_EXTENT_TEST_CHARS (sizeof (extent_test_chars) / sizeof (extent_test_chars[0]))
162 162
163#define dTermDisplay Display *disp = term->xdisp 163#define dTermDisplay Display *disp = term->dpy
164#define dTermGC GC gc = term->gc 164#define dTermGC GC gc = term->gc
165 165
166///////////////////////////////////////////////////////////////////////////// 166/////////////////////////////////////////////////////////////////////////////
167 167
168#if XFT 168#if XFT
173} 173}
174 174
175rxvt_drawable::operator XftDraw *() 175rxvt_drawable::operator XftDraw *()
176{ 176{
177 if (!xftdrawable) 177 if (!xftdrawable)
178 xftdrawable = XftDrawCreate (screen->xdisp, drawable, screen->visual, screen->cmap); 178 xftdrawable = XftDrawCreate (screen->dpy, drawable, screen->visual, screen->cmap);
179 179
180 return xftdrawable; 180 return xftdrawable;
181} 181}
182#endif 182#endif
183 183
514rxvt_font_x11::get_property (XFontStruct *f, Atom property, const char *repl) const 514rxvt_font_x11::get_property (XFontStruct *f, Atom property, const char *repl) const
515{ 515{
516 unsigned long value; 516 unsigned long value;
517 517
518 if (XGetFontProperty (f, property, &value)) 518 if (XGetFontProperty (f, property, &value))
519 return XGetAtomName (term->xdisp, value); 519 return XGetAtomName (term->dpy, value);
520 else 520 else
521 return rxvt_strdup (repl); 521 return rxvt_strdup (repl);
522} 522}
523 523
524rxvt_fontprop 524rxvt_fontprop
547rxvt_font_x11::set_properties (rxvt_fontprop &p, XFontStruct *f) 547rxvt_font_x11::set_properties (rxvt_fontprop &p, XFontStruct *f)
548{ 548{
549 unsigned long height; 549 unsigned long height;
550 550
551#if 0 551#if 0
552 if (!XGetFontProperty (f, XInternAtom (term->xdisp, "PIXEL_SIZE", 0), &height)) 552 if (!XGetFontProperty (f, XInternAtom (term->dpy, "PIXEL_SIZE", 0), &height))
553 return false; 553 return false;
554#else 554#else
555 height = f->ascent + f->descent; 555 height = f->ascent + f->descent;
556#endif 556#endif
557 557
892void 892void
893rxvt_font_x11::clear () 893rxvt_font_x11::clear ()
894{ 894{
895 if (f) 895 if (f)
896 { 896 {
897 XFreeFont (term->xdisp, f); 897 XFreeFont (term->dpy, f);
898 f = 0; 898 f = 0;
899 } 899 }
900} 900}
901 901
902bool 902bool
1074void 1074void
1075rxvt_font_xft::clear () 1075rxvt_font_xft::clear ()
1076{ 1076{
1077 if (f) 1077 if (f)
1078 { 1078 {
1079 XftFontClose (term->xdisp, f); 1079 XftFontClose (term->dpy, f);
1080 f = 0; 1080 f = 0;
1081 } 1081 }
1082} 1082}
1083 1083
1084rxvt_fontprop 1084rxvt_fontprop
1251bool 1251bool
1252rxvt_font_xft::has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const 1252rxvt_font_xft::has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const
1253{ 1253{
1254 careful = false; 1254 careful = false;
1255 1255
1256 if (!XftCharExists (term->xdisp, f, unicode)) 1256 if (!XftCharExists (term->dpy, f, unicode))
1257 return false; 1257 return false;
1258 1258
1259 if (!prop || prop->width == rxvt_fontprop::unset) 1259 if (!prop || prop->width == rxvt_fontprop::unset)
1260 return true; 1260 return true;
1261 1261
1262 // check character against base font bounding box 1262 // check character against base font bounding box
1263 FcChar32 ch = unicode; 1263 FcChar32 ch = unicode;
1264 XGlyphInfo g; 1264 XGlyphInfo g;
1265 XftTextExtents32 (term->xdisp, f, &ch, 1, &g); 1265 XftTextExtents32 (term->dpy, f, &ch, 1, &g);
1266 1266
1267 int w = g.width - g.x; 1267 int w = g.width - g.x;
1268 int wcw = max (WCWIDTH (unicode), 1); 1268 int wcw = max (WCWIDTH (unicode), 1);
1269 1269
1270 careful = g.x > 0 || w > prop->width * wcw; 1270 careful = g.x > 0 || w > prop->width * wcw;
1576 FcPatternAddInteger (p, FC_SLANT, prop.slant); 1576 FcPatternAddInteger (p, FC_SLANT, prop.slant);
1577 FcPatternAddBool (p, FC_MINSPACE, 1); 1577 FcPatternAddBool (p, FC_MINSPACE, 1);
1578 //FcPatternAddBool (p, FC_ANTIALIAS, 1); 1578 //FcPatternAddBool (p, FC_ANTIALIAS, 1);
1579 1579
1580 XftResult result; 1580 XftResult result;
1581 FcPattern *match = XftFontMatch (term->xdisp, term->display->screen, p, &result); 1581 FcPattern *match = XftFontMatch (term->dpy, term->display->screen, p, &result);
1582 1582
1583 FcPatternDestroy (p); 1583 FcPatternDestroy (p);
1584 1584
1585 if (match) 1585 if (match)
1586 { 1586 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines