Debian Codegraph @

pTk/mTk/unix/tkUnixXft.c

raw symbols SCIP
1 /*
2 * tkUnixRFont.c --
3 *
4 * Alternate implementation of tkUnixFont.c using Xft.
5 *
6 * Copyright (c) 2002-2003 Keith Packard
7 *
8 * See the file "license.terms" for information on usage and redistribution of
9 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 *
11 * RCS: @(#) $Id: tkUnixRFont.c,v 1.13 2006/03/23 22:08:51 rmax Exp $
12 */
13
14 #include "tkUnixInt.h"
15 #include "tkFont.h"
16
17 #ifdef USE_XFT_FONTS
18
19 #ifdef NEED_FT2BUILD_H
20 #include <ft2build.h>
21 #endif
22 #include <X11/Xft/Xft.h>
23 #include <ctype.h>
24
25 typedef struct {
26 XftFont *ftFont;
27 FcPattern *source;
28 FcCharSet *charset;
29 } UnixFtFace;
30
31 typedef struct {
32 TkFont font; /* Stuff used by generic font package. Must be
33 * first in structure. */
34 UnixFtFace *faces;
35 int nfaces;
36 FcCharSet *charset;
37 FcPattern *pattern;
38 FcFontSet *set;
39
40 Display *display;
41 int screen;
42 XftDraw *ftDraw;
43 Drawable drawable;
44 XftColor color;
45 } UnixFtFont;
46
47 /*
48 * Forward declarations...
49 */
50
51 static void FinishedWithFont(UnixFtFont *fontPtr);
52 static XftFont * GetFont(UnixFtFont *fontPtr, FcChar32 ucs4);
53 static UnixFtFont * InitFont(Tk_Window tkwin, FcPattern *pattern,
54 UnixFtFont *fontPtr);
55
56 /*
57 * Package initialization:
58 * Nothing to do here except register the fact that we're using Xft in
59 * the TIP 59 configuration database.
60 */
61
62 #ifndef TCL_CFGVAL_ENCODING
63 #define TCL_CFGVAL_ENCODING "ascii"
64 #endif
65
66 void
67 TkpFontPkgInit(
68 TkMainInfo *mainPtr) /* The application being created. */
69 {
70 #if 0
71 static Tcl_Config cfg[] = {
72 { "fontsystem", "xft" },
73 { 0,0 }
74 };
75
76 Tcl_RegisterConfig(mainPtr->interp, "tk", cfg, TCL_CFGVAL_ENCODING);
77 #endif
78 }
79
80 static XftFont *
81 GetFont(
82 UnixFtFont *fontPtr,
83 FcChar32 ucs4)
84 {
85 int i;
86
87 if (ucs4) {
88 for (i = 0; i < fontPtr->nfaces; i++) {
89 FcCharSet *charset = fontPtr->faces[i].charset;
90 if (charset && FcCharSetHasChar(charset, ucs4)) {
91 break;
92 }
93 }
94 if (i == fontPtr->nfaces) {
95 i = 0;
96 }
97 } else {
98 i = 0;
99 }
100 if (!fontPtr->faces[i].ftFont) {
101 FcPattern *pat = FcFontRenderPrepare(0, fontPtr->pattern,
102 fontPtr->faces[i].source);
103
104 fontPtr->faces[i].ftFont = XftFontOpenPattern(fontPtr->display, pat);
105 }
106 return fontPtr->faces[i].ftFont;
107 }
108
109 /*
110 *---------------------------------------------------------------------------
111 *
112 * InitFont --
113 *
114 * Initializes the fields of a UnixFtFont structure. If fontPtr is NULL,
115 * also allocates a new UnixFtFont.
116 *
117 * Results:
118 * On error, frees fontPtr and returns NULL, otherwise returns fontPtr.
119 *
120 *---------------------------------------------------------------------------
121 */
122
123 static UnixFtFont *
124 InitFont(
125 Tk_Window tkwin,
126 FcPattern *pattern,
127 UnixFtFont *fontPtr)
128 {
129 TkFontAttributes *faPtr;
130 TkFontMetrics *fmPtr;
131 char *family;
132 int weight, slant, spacing, i;
133 int size;
134 double dSize;
135 FcFontSet *set;
136 FcCharSet *charset;
137 FcResult result;
138 XftFont *ftFont;
139
140 if (!fontPtr) {
141 fontPtr = (UnixFtFont *) ckalloc(sizeof(UnixFtFont));
142 }
143
144 FcConfigSubstitute(0, pattern, FcMatchPattern);
145 XftDefaultSubstitute(Tk_Display(tkwin), Tk_ScreenNumber(tkwin), pattern);
146
147 /*
148 * Generate the list of fonts
149 */
150
151 set = FcFontSort(0, pattern, FcTrue, &charset, &result);
152 if (!set) {
153 FcPatternDestroy(pattern);
154 ckfree((char *) fontPtr);
155 return NULL;
156 }
157
158 fontPtr->charset = charset;
159 fontPtr->pattern = pattern;
160 fontPtr->faces = (UnixFtFace *) ckalloc(set->nfont * sizeof(UnixFtFace));
161 fontPtr->nfaces = set->nfont;
162 fontPtr->set = set;
163
164 /*
165 * Fill in information about each returned font
166 */
167
168 for (i = 0; i < set->nfont; i++) {
169 fontPtr->faces[i].ftFont = 0;
170 fontPtr->faces[i].source = set->fonts[i];
171 if (FcPatternGetCharSet(set->fonts[i], FC_CHARSET, 0,
172 &charset) == FcResultMatch) {
173 fontPtr->faces[i].charset = FcCharSetCopy(charset);
174 } else {
175 fontPtr->faces[i].charset = 0;
176 }
177 }
178
179 fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed");
180 fontPtr->display = Tk_Display(tkwin);
181 fontPtr->screen = Tk_ScreenNumber(tkwin);
182 fontPtr->ftDraw = 0;
183 fontPtr->drawable = 0;
184 fontPtr->color.color.red = 0;
185 fontPtr->color.color.green = 0;
186 fontPtr->color.color.blue = 0;
187 fontPtr->color.color.alpha = 0xffff;
188 fontPtr->color.pixel = 0xffffffff;
189
190 ftFont = GetFont(fontPtr, 0);
191
192 /*
193 * Build the Tk font structure
194 */
195
196 if (XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0,
197 &family) != XftResultMatch) {
198 family = "Unknown";
199 }
200
201 if (XftPatternGetInteger(ftFont->pattern, XFT_WEIGHT, 0,
202 &weight) != XftResultMatch) {
203 weight = XFT_WEIGHT_MEDIUM;
204 }
205 if (weight <= XFT_WEIGHT_MEDIUM) {
206 weight = TK_FW_NORMAL;
207 } else {
208 weight = TK_FW_BOLD;
209 }
210
211 if (XftPatternGetInteger(ftFont->pattern, XFT_SLANT, 0,
212 &slant) != XftResultMatch) {
213 slant = XFT_SLANT_ROMAN;
214 }
215 if (slant <= XFT_SLANT_ROMAN) {
216 slant = TK_FS_ROMAN;
217 } else {
218 slant = TK_FS_ITALIC;
219 }
220
221 /* Different font size handling in Tcl/Tk and Perl/Tk */
222 if (XftPatternGetDouble(pattern, XFT_PIXEL_SIZE, 0,
223 &dSize) != XftResultMatch) {
224 if (XftPatternGetDouble(pattern, XFT_SIZE, 0, &dSize)
225 != XftResultMatch) {
226 size = -12;
227 } else {
228 size = (int)(dSize+0.5);
229 }
230 } else {
231 size = -(int)(dSize+0.5);
232 }
233
234 if (XftPatternGetInteger(ftFont->pattern, XFT_SPACING, 0,
235 &spacing) != XftResultMatch) {
236 spacing = XFT_PROPORTIONAL;
237 }
238 if (spacing == XFT_PROPORTIONAL) {
239 spacing = 0;
240 } else {
241 spacing = 1;
242 }
243 #if DEBUG_FONTSEL
244 printf("family %s size %g weight %d slant %d\n",
245 family, size, weight, slant);
246 #endif /* DEBUG_FONTSEL */
247
248 faPtr = &fontPtr->font.fa;
249 faPtr->family = family;
250 faPtr->size = size;
251 faPtr->weight = weight;
252 faPtr->slant = slant;
253 faPtr->underline = 0;
254 faPtr->overstrike = 0;
255
256 fmPtr = &fontPtr->font.fm;
257 fmPtr->ascent = ftFont->ascent;
258 fmPtr->descent = ftFont->descent;
259 fmPtr->maxWidth = ftFont->max_advance_width;
260 fmPtr->fixed = spacing;
261
262 return fontPtr;
263 }
264
265 static void
266 FinishedWithFont(
267 UnixFtFont *fontPtr)
268 {
269 Display *display = fontPtr->display;
270 Tk_ErrorHandler handler;
271 int i;
272
273 handler = Tk_CreateErrorHandler(display, -1, -1, -1, NULL,
274 (ClientData) NULL);
275 for (i = 0; i < fontPtr->nfaces; i++) {
276 if (fontPtr->faces[i].ftFont) {
277 XftFontClose(fontPtr->display, fontPtr->faces[i].ftFont);
278 }
279 if (fontPtr->faces[i].charset) {
280 FcCharSetDestroy(fontPtr->faces[i].charset);
281 }
282 }
283 free(fontPtr->faces);
284 FcFontSetDestroy(fontPtr->set);
285 FcPatternDestroy(fontPtr->pattern);
286 FcCharSetDestroy(fontPtr->charset);
287 if (fontPtr->ftDraw) {
288 XftDrawDestroy(fontPtr->ftDraw);
289 }
290 if (fontPtr->font.fid) {
291 XUnloadFont(fontPtr->display, fontPtr->font.fid);
292 }
293 Tk_DeleteErrorHandler(handler);
294 }
295
296 TkFont *
297 TkpGetNativeFont(
298 Tk_Window tkwin, /* For display where font will be used. */
299 CONST char *name) /* Platform-specific font name. */
300 {
301 UnixFtFont *fontPtr;
302 FcPattern *pattern;
303 #if DEBUG_FONTSEL
304 printf("TkpGetNativeFont %s\n", name);
305 #endif /* DEBUG_FONTSEL */
306
307 /*
308 * The font handling in Perl/Tk differs here:
309 * TkFontParseXLFD and FcNameParse are used before trying XftXlfdParse
310 */
311 if (*name == '-') {
312 TkFontAttributes fa;
313 TkXLFDAttributes xa;
314 if (TkFontParseXLFD(name, &fa, &xa) != TCL_OK) {
315 return NULL;
316 } else {
317 return TkpGetFontFromAttributes(NULL, tkwin, &fa);
318 }
319 } else if (strpbrk(name,":,=") || !strpbrk(name," {")) {
320 pattern = FcNameParse (name);
321 } else {
322 /* Tcl/Tk version */
323 pattern = XftXlfdParse(name, FcFalse, FcFalse);
324 }
325 if (!pattern) {
326 return NULL;
327 }
328
329 /*
330 * Should also try: pattern = FcNameParse(name); but generic/tkFont.c
331 * expects TkpGetNativeFont() to only work on XLFD names under Unix.
332 */
333
334 fontPtr = InitFont(tkwin, pattern, NULL);
335 if (!fontPtr) {
336 return NULL;
337 }
338 return &fontPtr->font;
339 }
340
341 TkFont *
342 TkpGetFontFromAttributes(
343 TkFont *tkFontPtr, /* If non-NULL, store the information in this
344 * existing TkFont structure, rather than
345 * allocating a new structure to hold the
346 * font; the existing contents of the font
347 * will be released. If NULL, a new TkFont
348 * structure is allocated. */
349 Tk_Window tkwin, /* For display where font will be used. */
350 CONST TkFontAttributes *faPtr)
351 /* Set of attributes to match. */
352 {
353 XftPattern *pattern;
354 int weight, slant;
355 UnixFtFont *fontPtr;
356
357 #if DEBUG_FONTSEL
358 printf("TkpGetFontFromAttributes %s-%d %d %d\n", faPtr->family,
359 faPtr->size, faPtr->weight, faPtr->slant);
360 #endif /* DEBUG_FONTSEL */
361 pattern = XftPatternCreate();
362 if (faPtr->family) {
363 XftPatternAddString(pattern, XFT_FAMILY, faPtr->family);
364 }
365 if (faPtr->size > 0) {
366 XftPatternAddInteger(pattern, XFT_SIZE, faPtr->size);
367 } else if (faPtr->size < 0) {
368 XftPatternAddInteger(pattern, XFT_PIXEL_SIZE, -faPtr->size);
369 } else {
370 XftPatternAddInteger(pattern, XFT_SIZE, 12);
371 }
372 switch (faPtr->weight) {
373 case TK_FW_NORMAL:
374 default:
375 weight = XFT_WEIGHT_MEDIUM;
376 break;
377 case TK_FW_BOLD:
378 weight = XFT_WEIGHT_BOLD;
379 break;
380 }
381 XftPatternAddInteger(pattern, XFT_WEIGHT, weight);
382 switch (faPtr->slant) {
383 case TK_FS_ROMAN:
384 default:
385 slant = XFT_SLANT_ROMAN;
386 break;
387 case TK_FS_ITALIC:
388 slant = XFT_SLANT_ITALIC;
389 break;
390 case TK_FS_OBLIQUE:
391 slant = XFT_SLANT_OBLIQUE;
392 break;
393 }
394 XftPatternAddInteger(pattern, XFT_SLANT, slant);
395
396 fontPtr = (UnixFtFont *) tkFontPtr;
397 if (fontPtr != NULL) {
398 FinishedWithFont(fontPtr);
399 }
400 fontPtr = InitFont(tkwin, pattern, fontPtr);
401 if (!fontPtr) {
402 return NULL;
403 }
404 return &fontPtr->font;
405 }
406
407 void
408 TkpDeleteFont(
409 TkFont *tkFontPtr) /* Token of font to be deleted. */
410 {
411 UnixFtFont *fontPtr = (UnixFtFont *) tkFontPtr;
412
413 FinishedWithFont(fontPtr);
414 /* XXX tkUnixFont.c doesn't free tkFontPtr... */
415 }
416
417 /*
418 *---------------------------------------------------------------------------
419 *
420 * TkpGetFontFamilies --
421 *
422 * Return information about the font families that are available on the
423 * display of the given window.
424 *
425 * Results:
426 * Modifies interp's result object to hold a list of all the available
427 * font families.
428 *
429 *---------------------------------------------------------------------------
430 */
431
432 void
433 TkpGetFontFamilies(
434 Tcl_Interp *interp, /* Interp to hold result. */
435 Tk_Window tkwin) /* For display to query. */
436 {
437 Tcl_Obj *resultPtr, *strPtr;
438 XftFontSet *list;
439 int i;
440 char *family;
441
442 resultPtr = Tcl_NewListObj(0, NULL);
443
444 list = XftListFonts(Tk_Display(tkwin), Tk_ScreenNumber(tkwin), 0,
445 XFT_FAMILY, 0);
446 for (i = 0; i < list->nfont; i++) {
447 if (XftPatternGetString(list->fonts[i], XFT_FAMILY, 0,
448 &family) == XftResultMatch) {
449 strPtr = Tcl_NewStringObj(Tk_GetUid(family), -1);
450 Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
451 }
452 }
453 XftFontSetDestroy(list);
454
455 Tcl_SetObjResult(interp, resultPtr);
456 }
457
458 /*
459 *-------------------------------------------------------------------------
460 *
461 * TkpGetSubFonts --
462 *
463 * Called by [testfont subfonts] in the Tk testing package.
464 *
465 * Results:
466 * Sets interp's result to a list of the faces used by tkfont
467 *
468 *-------------------------------------------------------------------------
469 */
470
471 void
472 TkpGetSubFonts(
473 Tcl_Interp *interp,
474 Tk_Font tkfont)
475 {
476 Tcl_Obj *objv[5], *listPtr, *resultPtr;
477 UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
478 FcPattern *pattern;
479 char *family, *foundry, *encoding, *file;
480 int i;
481
482 resultPtr = Tcl_NewListObj(0, NULL);
483
484 for (i = 0; i < fontPtr->nfaces ; ++i) {
485 pattern = FcFontRenderPrepare(0, fontPtr->pattern,
486 fontPtr->faces[i].source);
487
488 if (XftPatternGetString(pattern, XFT_FAMILY, 0,
489 &family) != XftResultMatch) {
490 family = "Unknown";
491 }
492 if (XftPatternGetString(pattern, XFT_FOUNDRY, 0,
493 &foundry) != XftResultMatch) {
494 foundry = "Unknown";
495 }
496 if (XftPatternGetString(pattern, XFT_ENCODING, 0,
497 &encoding) != XftResultMatch) {
498 encoding = "Unknown";
499 }
500 if (XftPatternGetString(pattern, XFT_FILE, 0,
501 &file) != XftResultMatch) {
502 encoding = "Unknown";
503 }
504 objv[0] = Tcl_NewStringObj(family, -1);
505 objv[1] = Tcl_NewStringObj(foundry, -1);
506 objv[2] = Tcl_NewStringObj(encoding, -1);
507 objv[3] = Tcl_NewIntObj(-1); /* trigger (?), NYI, added in Perl/Tk */
508 objv[4] = Tcl_NewStringObj(file, -1); /* added in Perl/Tk */
509 listPtr = Tcl_NewListObj(5, objv);
510 Tcl_ListObjAppendElement(NULL, resultPtr, listPtr);
511 }
512 Tcl_SetObjResult(interp, resultPtr);
513 }
514
515 int
516 Tk_MeasureChars(
517 Tk_Font tkfont, /* Font in which characters will be drawn. */
518 CONST char *source, /* UTF-8 string to be displayed. Need not be
519 * '\0' terminated. */
520 int numBytes, /* Maximum number of bytes to consider from
521 * source string. */
522 int maxLength, /* If >= 0, maxLength specifies the longest
523 * permissible line length in pixels; don't
524 * consider any character that would cross
525 * this x-position. If < 0, then line length
526 * is unbounded and the flags argument is
527 * ignored. */
528 int flags, /* Various flag bits OR-ed together:
529 * TK_PARTIAL_OK means include the last char
530 * which only partially fit on this line.
531 * TK_WHOLE_WORDS means stop on a word
532 * boundary, if possible. TK_AT_LEAST_ONE
533 * means return at least one character even if
534 * no characters fit. */
535 int *lengthPtr) /* Filled with x-location just after the
536 * terminating character. */
537 {
538 UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
539 XftFont *ftFont;
540 FcChar32 c;
541 int clen;
542 XGlyphInfo extents;
543 int curX, newX;
544 int termByte = 0, termX = 0;
545 int curByte, newByte, sawNonSpace;
546 #if DEBUG_FONTSEL
547 char string[256];
548 int len = 0;
549 #endif /* DEBUG_FONTSEL */
550
551 curX = 0;
552 curByte = 0;
553 sawNonSpace = 0;
554 while (numBytes > 0) {
555 Tcl_UniChar unichar;
556
557 clen = Tcl_UtfToUniChar(source, &unichar);
558 c = (FcChar32)unichar;
559
560 if (clen <= 0) {
561 /*
562 * This can't happen (but see #1185640)
563 */
564
565 *lengthPtr = curX;
566 return curByte;
567 }
568
569 source += clen;
570 numBytes -= clen;
571 if (c < 256 && isspace(c)) { /* I18N: ??? */
572 if (sawNonSpace) {
573 termByte = curByte;
574 termX = curX;
575 sawNonSpace = 0;
576 }
577 } else {
578 sawNonSpace = 1;
579 }
580
581 #if DEBUG_FONTSEL
582 string[len++] = (char) c;
583 #endif /* DEBUG_FONTSEL */
584 ftFont = GetFont(fontPtr, c);
585
586 XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
587
588 newX = curX + extents.xOff;
589 newByte = curByte + clen;
590 if (maxLength >= 0 && newX > maxLength) {
591 if (flags & TK_PARTIAL_OK ||
592 (flags & TK_AT_LEAST_ONE && curByte == 0)) {
593 curX = newX;
594 curByte = newByte;
595 } else if (flags & TK_WHOLE_WORDS && termX != 0) {
596 curX = termX;
597 curByte = termByte;
598 }
599 break;
600 }
601
602 curX = newX;
603 curByte = newByte;
604 }
605 #if DEBUG_FONTSEL
606 string[len] = '\0';
607 printf("MeasureChars %s length %d bytes %d\n", string, curX, curByte);
608 #endif /* DEBUG_FONTSEL */
609 *lengthPtr = curX;
610 return curByte;
611 }
612
613 int
614 TkpMeasureCharsInContext(Tk_Font tkfont, CONST char * source, int numBytes,
615 int rangeStart, int rangeLength, int maxLength,
616 int flags, int * lengthPtr)
617 {
618 (void) numBytes; /*unused*/
619 return Tk_MeasureChars(tkfont, source + rangeStart, rangeLength,
620 maxLength, flags, lengthPtr);
621 }
622
623 #define NUM_SPEC 1024
624
625 void
626 Tk_DrawChars(
627 Display *display, /* Display on which to draw. */
628 Drawable drawable, /* Window or pixmap in which to draw. */
629 GC gc, /* Graphics context for drawing characters. */
630 Tk_Font tkfont, /* Font in which characters will be drawn;
631 * must be the same as font used in GC. */
632 CONST char *source, /* UTF-8 string to be displayed. Need not be
633 * '\0' terminated. All Tk meta-characters
634 * (tabs, control characters, and newlines)
635 * should be stripped out of the string that
636 * is passed to this function. If they are not
637 * stripped out, they will be displayed as
638 * regular printing characters. */
639 int numBytes, /* Number of bytes in string. */
640 int x, int y) /* Coordinates at which to place origin of
641 * string when drawing. */
642 {
643 const int maxCoord = 0x7FFF; /* Xft coordinates are 16 bit values */
644 UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
645 XGCValues values;
646 XColor xcolor;
647 int clen;
648 XftGlyphFontSpec specs[NUM_SPEC];
649 int nspec;
650 XGlyphInfo metrics;
651
652 if (fontPtr->ftDraw == 0) {
653 #if DEBUG_FONTSEL
654 printf("Switch to drawable 0x%x\n", drawable);
655 #endif /* DEBUG_FONTSEL */
656 fontPtr->ftDraw = XftDrawCreate(display, drawable,
657 DefaultVisual(display, fontPtr->screen),
658 DefaultColormap(display, fontPtr->screen));
659 fontPtr->drawable = drawable;
660 } else {
661 Tk_ErrorHandler handler;
662
663 handler = Tk_CreateErrorHandler(display, -1, -1, -1, NULL,
664 (ClientData) NULL);
665 XftDrawChange(fontPtr->ftDraw, drawable);
666 fontPtr->drawable = drawable;
667 Tk_DeleteErrorHandler(handler);
668 }
669 XGetGCValues(display, gc, GCForeground, &values);
670 if (values.foreground != fontPtr->color.pixel) {
671 xcolor.pixel = values.foreground;
672 XQueryColor(display, DefaultColormap(display, fontPtr->screen),
673 &xcolor);
674 fontPtr->color.color.red = xcolor.red;
675 fontPtr->color.color.green = xcolor.green;
676 fontPtr->color.color.blue = xcolor.blue;
677 fontPtr->color.color.alpha = 0xffff;
678 fontPtr->color.pixel = values.foreground;
679 }
680 nspec = 0;
681 while (numBytes > 0 && x <= maxCoord && y <= maxCoord) {
682 XftFont *ftFont;
683 FcChar32 c;
684
685 clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
686 if (clen <= 0) {
687 /*
688 * This should not happen, but it can.
689 */
690
691 return;
692 }
693 source += clen;
694 numBytes -= clen;
695
696 ftFont = GetFont(fontPtr, c);
697 if (ftFont) {
698 specs[nspec].font = ftFont;
699 specs[nspec].glyph = XftCharIndex(fontPtr->display, ftFont, c);
700 specs[nspec].x = x;
701 specs[nspec].y = y;
702 XftGlyphExtents(fontPtr->display, ftFont, &specs[nspec].glyph, 1,
703 &metrics);
704 x += metrics.xOff;
705 y += metrics.yOff;
706 nspec++;
707 if (nspec == NUM_SPEC) {
708 XftDrawGlyphFontSpec(fontPtr->ftDraw, &fontPtr->color,
709 specs, nspec);
710 nspec = 0;
711 }
712 }
713 }
714 if (nspec) {
715 XftDrawGlyphFontSpec(fontPtr->ftDraw, &fontPtr->color, specs, nspec);
716 }
717 }
718
719 #endif
720
721 /*
722 * Local Variables:
723 * mode: c
724 * c-basic-offset: 4
725 * fill-column: 78
726 * End:
727 */