/* font-ximage.c --- renders text to an XImage for use with OpenGL.
- * xscreensaver, Copyright (c) 2001, 2003 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 2001-2013 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
This XImage will be 32 bits per pixel, 8 each per R, G, and B, with the
extra byte set to 0xFF.
- Foregroune and background are GL-style color specifiers: 4 floats from
+ Foreground and background are GL-style color specifiers: 4 floats from
0.0-1.0.
*/
XImage *
XCharStruct o2;
int ascent, descent, direction;
token = 0;
- XTextExtents (f, line, strlen(line),
+ XTextExtents (f, line, (int) strlen(line),
&direction, &ascent, &descent, &o2);
overall.lbearing = MAX(overall.lbearing, o2.lbearing);
overall.rbearing = MAX(overall.rbearing, o2.rbearing);
lines++;
}
+ free (text);
+ text = 0;
width = overall.lbearing + overall.rbearing + margin + margin + 1;
height = ((f->ascent + f->descent) * lines) + margin + margin;
int ascent, descent, direction;
token = 0;
- XTextExtents(f, line, strlen(line),
+ XTextExtents(f, line, (int)strlen(line),
&direction, &ascent, &descent, &o2);
XDrawString(dpy, bitmap, gc,
overall.lbearing + margin + xoff,
(f->descent * lines) +
margin +
yoff),
- line, strlen(line));
+ line, (int) strlen(line));
lines++;
}
free(text2);