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.191 by sf-exg, Sun Jun 10 13:07:56 2012 UTC vs.
Revision 1.196 by sf-exg, Thu Jul 14 05:33:26 2016 UTC

4 * Copyright (c) 2003-2008 Marc Lehmann <schmorp@schmorp.de> 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 3 of the License, or
10 * (at your option) any later version. 10 * (at your option) any later version.
11 * 11 *
12 * This program is distributed in the hope that it will be useful, 12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
239 else if (color >= 0) 239 else if (color >= 0)
240 { 240 {
241#if XFT 241#if XFT
242 Picture dst; 242 Picture dst;
243 243
244# ifdef HAVE_BG_PIXMAP 244# ifdef HAVE_IMG
245 if (term->bg_img 245 if (term->bg_img
246 && !term->pix_colors[color].is_opaque () 246 && !term->pix_colors[color].is_opaque ()
247 && ((dst = XftDrawPicture (d)))) 247 && ((dst = XftDrawPicture (d))))
248 { 248 {
249 XClearArea (disp, d, x, y, w, h, false); 249 XClearArea (disp, d, x, y, w, h, false);
934 // ignore characters we wouldn't use anyways 934 // ignore characters we wouldn't use anyways
935 bool careful; 935 bool careful;
936 if (!has_char (*t, &prop, careful)) 936 if (!has_char (*t, &prop, careful))
937 continue; 937 continue;
938 938
939 XChar2b ch = { *t >> 8, *t }; 939 // the casts are needed in C++11 (see 8.5.1)
940 XChar2b ch = { (unsigned char)(*t >> 8), (unsigned char)*t };
940 941
941 XCharStruct g; 942 XCharStruct g;
942 int dir_ret, asc_ret, des_ret; 943 int dir_ret, asc_ret, des_ret;
943 XTextExtents16 (f, &ch, 1, &dir_ret, &asc_ret, &des_ret, &g); 944 XTextExtents16 (f, &ch, 1, &dir_ret, &asc_ret, &des_ret, &g);
944 945
1044 dTermDisplay; 1045 dTermDisplay;
1045 dTermGC; 1046 dTermGC;
1046 1047
1047 bool slow = this->slow 1048 bool slow = this->slow
1048 || width != term->fwidth 1049 || width != term->fwidth
1049 || height != term->fheight; 1050 || height != term->fheight
1051 || ascent != f->ascent;
1050 1052
1051 int base = ascent; // sorry, incorrect: term->fbase; 1053 int base = ascent; // sorry, incorrect: term->fbase;
1052 1054
1053 XGCValues v; 1055 XGCValues v;
1054 v.foreground = term->pix_colors[fg]; 1056 v.foreground = term->pix_colors[fg];
1408 { 1410 {
1409 if (ep != enc) 1411 if (ep != enc)
1410 { 1412 {
1411 rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); 1413 rxvt_drawable &d2 = d.screen->scratch_drawable (w, h);
1412 1414
1413#ifdef HAVE_BG_PIXMAP 1415#ifdef HAVE_IMG
1414 Picture dst = 0; // the only assignment is done conditionally in the following if condition 1416 Picture dst = 0; // the only assignment is done conditionally in the following if condition
1415 1417
1416 if (term->bg_img 1418 if (term->bg_img
1417 && (bg == Color_transparent || bg == Color_bg 1419 && (bg == Color_transparent || bg == Color_bg
1418 || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) 1420 || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2))))))
1604 cs = codeset_from_name (spec + sizeof ("codeset=") - 1); 1606 cs = codeset_from_name (spec + sizeof ("codeset=") - 1);
1605 else 1607 else
1606 rxvt_warn ("unknown parameter '%s' in font specification, skipping.\n", spec); 1608 rxvt_warn ("unknown parameter '%s' in font specification, skipping.\n", spec);
1607 1609
1608 desc++; 1610 desc++;
1609 while (*desc <= ' ') desc++; 1611 while (*desc <= ' ' && *desc) desc++;
1610 } 1612 }
1611 1613
1612 end = strchr (desc, ','); 1614 end = strchr (desc, ',');
1613 if (!end) 1615 if (!end)
1614 end = desc + strlen (desc); 1616 end = desc + strlen (desc);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines