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.98 by root, Mon Feb 20 22:42:00 2006 UTC vs.
Revision 1.123 by ayin, Sat Nov 24 10:32:33 2007 UTC

43 const char *name; 43 const char *name;
44} fallback_fonts[] = { 44} fallback_fonts[] = {
45 { CS_ISO8859_1, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-1" }, 45 { CS_ISO8859_1, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-1" },
46 { CS_ISO8859_15, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-15" }, 46 { CS_ISO8859_15, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-15" },
47 { CS_ISO8859_15, "-*-*-*-r-*--*-*-*-*-c-*-fcd8859-15" }, 47 { CS_ISO8859_15, "-*-*-*-r-*--*-*-*-*-c-*-fcd8859-15" },
48 48
49#if ENCODING_EU 49#if ENCODING_EU
50 // cyrillic 50 // cyrillic
51 { CS_KOI8_R, "-*-*-*-r-*--*-*-*-*-c-*-koi8-r" }, 51 { CS_KOI8_R, "-*-*-*-r-*--*-*-*-*-c-*-koi8-r" },
52 { CS_KOI8_U, "-*-*-*-r-*--*-*-*-*-c-*-koi8-u" }, 52 { CS_KOI8_U, "-*-*-*-r-*--*-*-*-*-c-*-koi8-u" },
53 53
54 { CS_ISO8859_2, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-2" }, 54 { CS_ISO8859_2, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-2" },
55 { CS_ISO8859_3, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-3" }, 55 { CS_ISO8859_3, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-3" },
56 { CS_ISO8859_4, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-4" }, 56 { CS_ISO8859_4, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-4" },
57 { CS_ISO8859_5, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-5" }, 57 { CS_ISO8859_5, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-5" },
58 { CS_ISO8859_6, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-6" }, 58 { CS_ISO8859_6, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-6" },
65 { CS_ISO8859_14, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-14" }, 65 { CS_ISO8859_14, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-14" },
66 { CS_ISO8859_16, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-16" }, 66 { CS_ISO8859_16, "-*-*-*-r-*--*-*-*-*-c-*-iso8859-16" },
67 67
68# if XFT 68# if XFT
69 { CS_KOI8_U, "xft::lang=ru" }, 69 { CS_KOI8_U, "xft::lang=ru" },
70 70
71 { CS_ISO8859_5, "xft::lang=ru" }, 71 { CS_ISO8859_5, "xft::lang=ru" },
72 { CS_ISO8859_6, "xft::lang=ar" }, 72 { CS_ISO8859_6, "xft::lang=ar" },
73 { CS_ISO8859_7, "xft::lang=el" }, 73 { CS_ISO8859_7, "xft::lang=el" },
74 { CS_ISO8859_8, "xft::lang=he" }, 74 { CS_ISO8859_8, "xft::lang=he" },
75 { CS_ISO8859_9, "xft::lang=tr" }, 75 { CS_ISO8859_9, "xft::lang=tr" },
231void 231void
232rxvt_font::clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color) const 232rxvt_font::clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color) const
233{ 233{
234 dTermDisplay; 234 dTermDisplay;
235 dTermGC; 235 dTermGC;
236 236
237 if (color < 0 || color == Color_bg) 237 if (color == Color_bg || color == Color_transparent)
238 XClearArea (disp, d, x, y, w, h, false); 238 XClearArea (disp, d, x, y, w, h, false);
239 else 239 else if (color >= 0)
240 { 240 {
241#if XFT 241#if XFT
242 bool done = false;
243#ifdef HAVE_BG_PIXMAP
244 if (term->bgPixmap.pixmap && color >= 0 && term->pix_colors[color].c.color.alpha < 0x0ff00)
245 {
246 Picture dst = XftDrawPicture (d);
247 if (dst != 0)
248 {
249 XClearArea (disp, d, x, y, w, h, false);
250 Picture solid_color_pict = XftDrawSrcPicture (d, &term->pix_colors[color].c);
251 XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, x, y, w, h);
252 done = true;
253 }
254 }
255#endif
256 if (!done)
242 XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h); 257 XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h);
243#else 258#else
244 XSetForeground (disp, gc, term->pix_colors[color]); 259 XSetForeground (disp, gc, term->pix_colors[color]);
245 XFillRectangle (disp, d, gc, x, y, w, h); 260 XFillRectangle (disp, d, gc, x, y, w, h);
246#endif 261#endif
247 } 262 }
248} 263}
249 264
250///////////////////////////////////////////////////////////////////////////// 265/////////////////////////////////////////////////////////////////////////////
251
252#include "table/linedraw.h"
253 266
254struct rxvt_font_default : rxvt_font { 267struct rxvt_font_default : rxvt_font {
255 struct rxvt_fontset *fs; 268 struct rxvt_fontset *fs;
256 269
257 rxvt_font_default (rxvt_fontset *fs) 270 rxvt_font_default (rxvt_fontset *fs)
270 p.slant = rxvt_fontprop::roman; 283 p.slant = rxvt_fontprop::roman;
271 284
272 return p; 285 return p;
273 } 286 }
274 287
275 bool load (const rxvt_fontprop &prop) 288 bool load (const rxvt_fontprop &prop, bool force_prop)
276 { 289 {
277 width = 1; height = 1; 290 width = 1; height = 1;
278 ascent = 1; descent = 0; 291 ascent = 1; descent = 0;
279 292
280 set_name (strdup ("built-in support font")); 293 set_name (strdup ("built-in support font"));
341 ; 354 ;
342 355
343 int width = text - tp; 356 int width = text - tp;
344 int fwidth = term->fwidth * width; 357 int fwidth = term->fwidth * width;
345 358
359#ifdef BUILTIN_GLYPHS
346 if (0x2500 <= t && t <= 0x259f) 360 if (0x2500 <= t && t <= 0x259f)
347 { 361 {
362# include "table/linedraw.h"
348 uint16_t offs = linedraw_offs[t - 0x2500]; 363 uint16_t offs = linedraw_offs[t - 0x2500];
349 uint32_t *a = linedraw_command + (offs >> 4); 364 uint32_t *a = linedraw_command + (offs >> 4);
350 uint32_t *b = a + (offs & 15); 365 uint32_t *b = a + (offs & 15);
351 366
352 int W = fwidth; 367 int W = fwidth;
390 405
391 case 1: // rectangle, possibly stippled 406 case 1: // rectangle, possibly stippled
392 if (a) 407 if (a)
393 { 408 {
394 static char bm[] = { 0,0 , 3,1 , 1,2 , 1,0 }; 409 static char bm[] = { 0,0 , 3,1 , 1,2 , 1,0 };
395 410
396 gcv.fill_style = FillStippled; 411 gcv.fill_style = FillStippled;
397 gcv.stipple = XCreateBitmapFromData (disp, d, bm + a * 2, 2, 2); 412 gcv.stipple = XCreateBitmapFromData (disp, d, bm + a * 2, 2, 2);
398 gcv.ts_x_origin = x; 413 gcv.ts_x_origin = x;
399 gcv.ts_y_origin = y; 414 gcv.ts_y_origin = y;
400 415
419 (a - 1) * 90*64, (b - 1) * 90*64); 434 (a - 1) * 90*64, (b - 1) * 90*64);
420 break; 435 break;
421 } 436 }
422 } 437 }
423 } 438 }
439#else
440 if (0)
441 ;
442#endif
424#if ENABLE_COMBINING 443#if ENABLE_COMBINING
425 else if (IS_COMPOSE (t) && (cc = rxvt_composite[t])) 444 else if (IS_COMPOSE (t) && (cc = rxvt_composite[t]))
426 { 445 {
427 min_it (width, 2); // we only support wcwidth up to 2 446 min_it (width, 2); // we only support wcwidth up to 2
428 447
441 *chrs = cc->c2; 460 *chrs = cc->c2;
442 rxvt_font *f2 = (f1->has_char (cc->c2, 0, careful) && !careful) 461 rxvt_font *f2 = (f1->has_char (cc->c2, 0, careful) && !careful)
443 ? f1 462 ? f1
444 : (*fs)[fs->find_font (cc->c2)]; 463 : (*fs)[fs->find_font (cc->c2)];
445 464
446 f2->draw (d, x, y, chrs, width, fg, -1); 465 f2->draw (d, x, y, chrs, width, fg, Color_none);
447 } 466 }
448 } 467 }
449#endif 468#endif
450 else 469 else
451 switch (t) 470 switch (t)
471 490
472 void clear (); 491 void clear ();
473 492
474 rxvt_fontprop properties (); 493 rxvt_fontprop properties ();
475 494
476 bool load (const rxvt_fontprop &prop); 495 bool load (const rxvt_fontprop &prop, bool force_prop);
477 496
478 bool has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const; 497 bool has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const;
479 498
480 void draw (rxvt_drawable &d, int x, int y, 499 void draw (rxvt_drawable &d, int x, int y,
481 const text_t *text, int len, 500 const text_t *text, int len,
482 int fg, int bg); 501 int fg, int bg);
483 502
484 bool slow; // wether this is a proportional font or has other funny characteristics 503 bool slow; // wether this is a proportional font or has other funny characteristics
485 XFontStruct *f; 504 XFontStruct *f;
486 codeset cs;
487 bool enc2b, encm; 505 bool enc2b, encm;
488 506
489 char *get_property (XFontStruct *f, Atom property, const char *repl) const; 507 char *get_property (XFontStruct *f, Atom property, const char *repl) const;
490 bool set_properties (rxvt_fontprop &p, int height, const char *weight, const char *slant, int avgwidth); 508 bool set_properties (rxvt_fontprop &p, int height, const char *weight, const char *slant, int avgwidth);
491 bool set_properties (rxvt_fontprop &p, XFontStruct *f); 509 bool set_properties (rxvt_fontprop &p, XFontStruct *f);
498 unsigned long value; 516 unsigned long value;
499 517
500 if (XGetFontProperty (f, property, &value)) 518 if (XGetFontProperty (f, property, &value))
501 return XGetAtomName (term->dpy, value); 519 return XGetAtomName (term->dpy, value);
502 else 520 else
503 return rxvt_strdup (repl); 521 return repl ? strdup (repl) : 0;
504} 522}
505 523
506rxvt_fontprop 524rxvt_fontprop
507rxvt_font_x11::properties () 525rxvt_font_x11::properties ()
508{ 526{
627 return false; 645 return false;
628 } 646 }
629} 647}
630 648
631bool 649bool
632rxvt_font_x11::load (const rxvt_fontprop &prop) 650rxvt_font_x11::load (const rxvt_fontprop &prop, bool force_prop)
633{ 651{
634 dTermDisplay; 652 dTermDisplay;
635 653
636 clear (); 654 clear ();
637 655
638 char field_str[64]; // enough for 128 bits 656 char field_str[64]; // enough for 128 bits
639 657
640 // first morph the font if required 658 // first morph the font if required
641 if (prop.weight != rxvt_fontprop::unset 659 if (force_prop)
642 || prop.slant != rxvt_fontprop::unset)
643 { 660 {
644 char fname[1024]; 661 char fname[1024];
645 662
646 if (name[0] != '-') 663 if (name[0] != '-')
647 { 664 {
661 f = 0; 678 f = 0;
662 } 679 }
663 680
664 if (prop.weight != rxvt_fontprop::unset) 681 if (prop.weight != rxvt_fontprop::unset)
665 { 682 {
666 replace_field (fname, name, 2, 0, 683 replace_field (fname, name, 2, 0,
667 prop.weight < rxvt_fontprop::bold 684 prop.weight < rxvt_fontprop::bold
668 ? "medium" : "bold"); 685 ? "medium" : "bold");
669 set_name (strdup (fname)); 686 set_name (strdup (fname));
670 } 687 }
671 688
815 int N = f->max_char_or_byte2 - f->min_char_or_byte2; 832 int N = f->max_char_or_byte2 - f->min_char_or_byte2;
816 833
817 if (encm) 834 if (encm)
818 N += (f->max_byte1 - f->min_byte1) 835 N += (f->max_byte1 - f->min_byte1)
819 * (f->max_char_or_byte2 - f->min_char_or_byte2 + 1); 836 * (f->max_char_or_byte2 - f->min_char_or_byte2 + 1);
820 837
821 while (N) 838 while (N)
822 { 839 {
823 if (f->per_char[N].width > width) 840 if (f->per_char[N].width > width)
824 width = f->per_char[N].width; 841 width = f->per_char[N].width;
825 842
977 else 994 else
978 { 995 {
979 clear_rect (d, x, y, term->fwidth * len, term->fheight, bg); 996 clear_rect (d, x, y, term->fwidth * len, term->fheight, bg);
980 997
981 XChangeGC (disp, gc, GCForeground | GCFont, &v); 998 XChangeGC (disp, gc, GCForeground | GCFont, &v);
982 999
983 if (slow) 1000 if (slow)
984 { 1001 {
985 do 1002 do
986 { 1003 {
987 if (xc->byte1 || xc->byte2) 1004 if (xc->byte1 || xc->byte2)
1009 else 1026 else
1010 { 1027 {
1011 clear_rect (d, x, y, term->fwidth * len, term->fheight, bg); 1028 clear_rect (d, x, y, term->fwidth * len, term->fheight, bg);
1012 1029
1013 XChangeGC (disp, gc, GCForeground | GCFont, &v); 1030 XChangeGC (disp, gc, GCForeground | GCFont, &v);
1014 1031
1015 if (slow) 1032 if (slow)
1016 { 1033 {
1017 do 1034 do
1018 { 1035 {
1019 if (*xc) 1036 if (*xc)
1039 1056
1040 void clear (); 1057 void clear ();
1041 1058
1042 rxvt_fontprop properties (); 1059 rxvt_fontprop properties ();
1043 1060
1044 bool load (const rxvt_fontprop &prop); 1061 bool load (const rxvt_fontprop &prop, bool force_prop);
1045 1062
1046 void draw (rxvt_drawable &d, int x, int y, 1063 void draw (rxvt_drawable &d, int x, int y,
1047 const text_t *text, int len, 1064 const text_t *text, int len,
1048 int fg, int bg); 1065 int fg, int bg);
1049 1066
1050 bool has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &carefull) const; 1067 bool has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const;
1051 1068
1052protected: 1069protected:
1053 XftFont *f; 1070 XftFont *f;
1054}; 1071};
1055 1072
1082 1099
1083 return p; 1100 return p;
1084} 1101}
1085 1102
1086bool 1103bool
1087rxvt_font_xft::load (const rxvt_fontprop &prop) 1104rxvt_font_xft::load (const rxvt_fontprop &prop, bool force_prop)
1088{ 1105{
1089 dTermDisplay; 1106 dTermDisplay;
1090 1107
1091 clear (); 1108 clear ();
1092 1109
1101 && (FcPatternGet (p, FC_PIXEL_SIZE, 0, &v) != FcResultMatch 1118 && (FcPatternGet (p, FC_PIXEL_SIZE, 0, &v) != FcResultMatch
1102 && FcPatternGet (p, FC_SIZE, 0, &v) != FcResultMatch)) 1119 && FcPatternGet (p, FC_SIZE, 0, &v) != FcResultMatch))
1103 FcPatternAddInteger (p, FC_PIXEL_SIZE, prop.height); 1120 FcPatternAddInteger (p, FC_PIXEL_SIZE, prop.height);
1104 1121
1105 if (prop.weight != rxvt_fontprop::unset 1122 if (prop.weight != rxvt_fontprop::unset
1106 && FcPatternGet (p, FC_WEIGHT, 0, &v) != FcResultMatch) 1123 && (force_prop || FcPatternGet (p, FC_WEIGHT, 0, &v) != FcResultMatch))
1107 FcPatternAddInteger (p, FC_WEIGHT, prop.weight); 1124 FcPatternAddInteger (p, FC_WEIGHT, prop.weight);
1108 1125
1109 if (prop.slant != rxvt_fontprop::unset 1126 if (prop.slant != rxvt_fontprop::unset
1110 && FcPatternGet (p, FC_SLANT, 0, &v) != FcResultMatch) 1127 && (force_prop || FcPatternGet (p, FC_SLANT, 0, &v) != FcResultMatch))
1111 FcPatternAddInteger (p, FC_SLANT, prop.slant); 1128 FcPatternAddInteger (p, FC_SLANT, prop.slant);
1112 1129
1113#if 0 // clipping unfortunately destroys our precious double-width-characters 1130#if 0 // clipping unfortunately destroys our precious double-width-characters
1114 // clip width, we can't do better, or can we? 1131 // clip width, we can't do better, or can we?
1115 if (FcPatternGet (p, FC_CHAR_WIDTH, 0, &v) != FcResultMatch) 1132 if (FcPatternGet (p, FC_CHAR_WIDTH, 0, &v) != FcResultMatch)
1274 dTermGC; 1291 dTermGC;
1275 1292
1276 int w = term->fwidth * len; 1293 int w = term->fwidth * len;
1277 int h = term->fheight; 1294 int h = term->fheight;
1278 1295
1296 /* TODO: this logic needs some more thinking, since we no longer do pseudo-transparency.
1297 * Maybe make buffering into a resource flag? Compile time option doesn't seems like a
1298 * good idea from the perspective of packaging for wide variety of user configs.
1299 */
1279 bool buffered = 0 1300 bool buffered = true
1280#if defined(XPM_BACKGROUND) || defined(TRANSPARENT) 1301#ifdef FORCE_UNBUFFERED_XFT
1281 || !term->am_transparent // we aren't transparent 1302 && bg >= 0
1282 || term->am_pixmap_trans // we have a pixmap
1283#endif 1303#endif
1284 || bg >= 0; // we don't use a transparent bg 1304 ;
1285
1286 // cut trailing spaces 1305 // cut trailing spaces
1287 while (len && text [len - 1] == ' ') 1306 while (len && text [len - 1] == ' ')
1288 len--; 1307 len--;
1289 1308
1290 int x_ = buffered ? 0 : x; 1309 int x_ = buffered ? 0 : x;
1295 int cwidth = term->fwidth; 1314 int cwidth = term->fwidth;
1296 FcChar32 fc = *text++; len--; 1315 FcChar32 fc = *text++; len--;
1297 1316
1298 while (len && *text == NOCHAR) 1317 while (len && *text == NOCHAR)
1299 text++, len--, cwidth += term->fwidth; 1318 text++, len--, cwidth += term->fwidth;
1300 1319
1301 if (fc != ' ') // skip spaces 1320 if (fc != ' ') // skip spaces
1302 { 1321 {
1303 FT_UInt glyph = XftCharIndex (disp, f, fc); 1322 FT_UInt glyph = XftCharIndex (disp, f, fc);
1304 XftGlyphExtents (disp, f, &glyph, 1, &extents); 1323 XftGlyphExtents (disp, f, &glyph, 1, &extents);
1305 1324
1316 x_ += cwidth; 1335 x_ += cwidth;
1317 } 1336 }
1318 1337
1319 if (buffered) 1338 if (buffered)
1320 { 1339 {
1340 bool back_rendered = false;
1321 if (ep != enc) 1341 if (ep != enc)
1322 { 1342 {
1323 rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); 1343 rxvt_drawable &d2 = d.screen->scratch_drawable (w, h);
1324 1344
1325#if defined(XPM_BACKGROUND) || defined(TRANSPARENT) 1345#ifdef HAVE_BG_PIXMAP
1326 if (bg < 0 && term->am_pixmap_trans)
1327 XCopyArea (disp, term->pixmap, d2, gc, x, y, w, h, 0, 0);
1328 else if (bg < 0 && term->bgPixmap.pixmap) 1346 if (term->bgPixmap.pixmap)
1329 { 1347 {
1348 Picture dst = 0;
1349
1350 if (bg >= 0 && term->pix_colors[bg].c.color.alpha < 0x0ff00)
1351 dst = XftDrawPicture (d2);
1352
1353 if (bg < 0 || dst != 0)
1354 {
1355 int src_x = x, src_y = y ;
1356
1357 if (term->bgPixmap.is_parentOrigin ())
1358 {
1359 src_x += term->window_vt_x;
1360 src_y += term->window_vt_y;
1361 }
1362
1363 if (term->bgPixmap.pmap_width >= src_x+w
1364 && term->bgPixmap.pmap_height >= src_y+h)
1365 {
1366 XCopyArea (disp, term->bgPixmap.pixmap, d2, gc,
1367 src_x, src_y, w, h, 0, 0);
1368 }
1369 else
1370 {
1330 XGCValues gcv; 1371 XGCValues gcv;
1331 1372
1332 gcv.fill_style = FillTiled; 1373 gcv.fill_style = FillTiled;
1333 gcv.tile = term->pixmap; 1374 gcv.tile = term->bgPixmap.pixmap;
1334 gcv.ts_x_origin = -x; 1375 gcv.ts_x_origin = -src_x;
1335 gcv.ts_y_origin = -y; 1376 gcv.ts_y_origin = -src_y;
1336 1377
1337 GC gc2 = XCreateGC (disp, d2, 1378 XChangeGC (disp, gc,
1338 GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, 1379 GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle,
1339 &gcv); 1380 &gcv);
1340 1381
1341 XFillRectangle (disp, d2, gc2, 0, 0, w, h); 1382 XFillRectangle (disp, d2, gc, 0, 0, w, h);
1342 1383
1343 XFreeGC (disp, gc2); 1384 gcv.fill_style = FillSolid;
1385 XChangeGC (disp, gc, GCFillStyle, &gcv);
1386 }
1387
1388 if (bg >= 0)
1389 {
1390 Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c);
1391 XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h);
1392 }
1393
1394 back_rendered = true;
1395 }
1344 } 1396 }
1345 else
1346#endif 1397#endif
1398
1399 if (bg >= 0 && !back_rendered)
1347 XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); 1400 XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h);
1348 1401
1349 XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); 1402 XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc);
1350 XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); 1403 XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y);
1351 } 1404 }
1377void 1430void
1378rxvt_fontset::clear () 1431rxvt_fontset::clear ()
1379{ 1432{
1380 prop.width = prop.height = prop.ascent = prop.weight = prop.slant 1433 prop.width = prop.height = prop.ascent = prop.weight = prop.slant
1381 = rxvt_fontprop::unset; 1434 = rxvt_fontprop::unset;
1435 force_prop = false;
1382 1436
1383 for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++) 1437 for (rxvt_font **i = fonts.begin (); i != fonts.end (); i++)
1384 FONT_UNREF (*i); 1438 FONT_UNREF (*i);
1385 1439
1386 for (pagemap **p = fmap.begin (); p != fmap.end (); p++) 1440 for (pagemap **p = fmap.begin (); p != fmap.end (); p++)
1395 1449
1396rxvt_font * 1450rxvt_font *
1397rxvt_fontset::new_font (const char *name, codeset cs) 1451rxvt_fontset::new_font (const char *name, codeset cs)
1398{ 1452{
1399 rxvt_font *f; 1453 rxvt_font *f;
1400 1454
1401 if (!name || !*name) 1455 if (!name || !*name)
1402 { 1456 {
1403 name = ""; 1457 name = "";
1404 f = new rxvt_font_default (this); 1458 f = new rxvt_font_default (this);
1405 } 1459 }
1498 if (fonts[i]->loaded) 1552 if (fonts[i]->loaded)
1499 return true; 1553 return true;
1500 1554
1501 fonts[i]->loaded = true; 1555 fonts[i]->loaded = true;
1502 1556
1503 if (!fonts[i]->load (prop)) 1557 if (!fonts[i]->load (prop, force_prop))
1504 { 1558 {
1505 fonts[i]->cs = CS_UNKNOWN; 1559 fonts[i]->cs = CS_UNKNOWN;
1506 return false; 1560 return false;
1507 } 1561 }
1508 1562
1624 if (find_font (font) < 0) 1678 if (find_font (font) < 0)
1625 { 1679 {
1626 char fontname[4096]; 1680 char fontname[4096];
1627 sprintf (fontname, "xft:%-.4090s", font); 1681 sprintf (fontname, "xft:%-.4090s", font);
1628 1682
1629 fonts.push_back (new_font (fontname, CS_UNICODE)); 1683 fonts.push_back (new_font (fontname, CS_UNICODE));
1630 } 1684 }
1631 1685
1632 free (font); 1686 free (font);
1633 } 1687 }
1634#endif 1688#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines