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.171 by sf-exg, Thu Dec 30 17:28:29 2010 UTC vs.
Revision 1.178 by root, Mon Feb 21 07:41:03 2011 UTC

1/*----------------------------------------------------------------------* 1/*----------------------------------------------------------------------*
2 * File: rxvtfont.C 2 * File: rxvtfont.C
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * Copyright (c) 2003-2008 Marc Lehmann <pcg@goof.com> 4 * Copyright (c) 2003-2008 Marc Lehmann <schmorp@schmorp.de>
5 * - original version. 5 * - original version.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or 9 * the Free Software Foundation; either version 2 of the License, or
241 { 241 {
242#if XFT 242#if XFT
243 Picture dst; 243 Picture dst;
244 244
245# ifdef HAVE_BG_PIXMAP 245# ifdef HAVE_BG_PIXMAP
246 if (term->bgPixmap.pixmap 246 if (term->bg_pixmap
247 && !term->pix_colors[color].is_opaque () 247 && !term->pix_colors[color].is_opaque ()
248 && ((dst = XftDrawPicture (d)))) 248 && ((dst = XftDrawPicture (d))))
249 { 249 {
250 XClearArea (disp, d, x, y, w, h, false); 250 XClearArea (disp, d, x, y, w, h, false);
251 251
718 f = XLoadQueryFont (disp, name); 718 f = XLoadQueryFont (disp, name);
719 719
720 if (!f) 720 if (!f)
721 return false; 721 return false;
722 722
723 char *new_name = get_property (f, XA_FONT, name); 723 char *new_name = get_property (f, XA_FONT, 0);
724 724
725 if (new_name) 725 if (new_name)
726 set_name (new_name); 726 set_name (new_name);
727 else 727 else
728 rxvt_warn ("font '%s' has no FONT property, continuing without.", name); 728 rxvt_warn ("font '%s' has no FONT property, continuing without.\n", name);
729 729
730 XFreeFont (disp, f); 730 XFreeFont (disp, f);
731 f = 0; 731 f = 0;
732 } 732 }
733 733
967} 967}
968 968
969bool 969bool
970rxvt_font_x11::has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const 970rxvt_font_x11::has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const
971{ 971{
972 careful = false;
973
972 uint32_t ch = FROM_UNICODE (cs, unicode); 974 uint32_t ch = FROM_UNICODE (cs, unicode);
973 975
974 if (ch == NOCHAR) 976 if (ch == NOCHAR)
975 return false; 977 return false;
976 978
1218 int ftheight = 0; 1220 int ftheight = 0;
1219 bool success = true; 1221 bool success = true;
1220 1222
1221 for (;;) 1223 for (;;)
1222 { 1224 {
1225 p = FcPatternDuplicate (match);
1223 f = XftFontOpenPattern (disp, FcPatternDuplicate (match)); 1226 f = XftFontOpenPattern (disp, p);
1224 1227
1225 if (!f) 1228 if (!f)
1226 { 1229 {
1230 FcPatternDestroy (p);
1227 success = false; 1231 success = false;
1228 break; 1232 break;
1229 } 1233 }
1230 1234
1231 FT_Face face = XftLockFace (f); 1235 FT_Face face = XftLockFace (f);
1404 rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); 1408 rxvt_drawable &d2 = d.screen->scratch_drawable (w, h);
1405 1409
1406#ifdef HAVE_BG_PIXMAP 1410#ifdef HAVE_BG_PIXMAP
1407 Picture dst = 0; // the only assignment is done conditionally in the following if condition 1411 Picture dst = 0; // the only assignment is done conditionally in the following if condition
1408 1412
1409 if (term->bgPixmap.pixmap 1413 if (term->bg_pixmap
1410 && (bg == Color_transparent || bg == Color_bg 1414 && (bg == Color_transparent || bg == Color_bg
1411 || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) 1415 || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2))))))
1412 { 1416 {
1413 int src_x = x, src_y = y; 1417 int src_x = x, src_y = y;
1414 1418
1415 if (term->bgPixmap.flags & bgPixmap_t::isTransparent) 1419 if (term->bg_flags & rxvt_term::BG_IS_TRANSPARENT)
1416 { 1420 {
1417 src_x += term->window_vt_x; 1421 src_x += term->window_vt_x;
1418 src_y += term->window_vt_y; 1422 src_y += term->window_vt_y;
1419 } 1423 }
1420 1424
1421 if (term->bgPixmap.pmap_width >= src_x + w 1425 if (term->bg_pmap_width >= src_x + w
1422 && term->bgPixmap.pmap_height >= src_y + h) 1426 && term->bg_pmap_height >= src_y + h)
1423 { 1427 {
1424 XCopyArea (disp, term->bgPixmap.pixmap, d2, gc, 1428 XCopyArea (disp, term->bg_pixmap, d2, gc,
1425 src_x, src_y, w, h, 0, 0); 1429 src_x, src_y, w, h, 0, 0);
1426 } 1430 }
1427 else 1431 else
1428 { 1432 {
1429 XGCValues gcv; 1433 XGCValues gcv;
1430 1434
1431 gcv.fill_style = FillTiled; 1435 gcv.fill_style = FillTiled;
1432 gcv.tile = term->bgPixmap.pixmap; 1436 gcv.tile = term->bg_pixmap;
1433 gcv.ts_x_origin = -src_x; 1437 gcv.ts_x_origin = -src_x;
1434 gcv.ts_y_origin = -src_y; 1438 gcv.ts_y_origin = -src_y;
1435 1439
1436 XChangeGC (disp, gc, 1440 XChangeGC (disp, gc,
1437 GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, 1441 GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle,
1612 buf[end - desc] = 0; 1616 buf[end - desc] = 0;
1613 1617
1614 push_font (new_font (buf, cs)); 1618 push_font (new_font (buf, cs));
1615 } 1619 }
1616 else 1620 else
1617 rxvt_warn ("fontset element too long (>511 bytes), ignored."); 1621 rxvt_warn ("fontset element too long (>511 bytes), ignored.\n");
1618 1622
1619 desc = end + 1; 1623 desc = end + 1;
1620 } 1624 }
1621 while (*end); 1625 while (*end);
1622 } 1626 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines