Mercurial > hg > xemacs-beta
comparison src/redisplay-x.c @ 251:677f6a0ee643 r20-5b24
Import from CVS: tag r20-5b24
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:19:59 +0200 |
parents | e70b3a057e12 |
children | 11cf20601dec |
comparison
equal
deleted
inserted
replaced
250:f385a461c9aa | 251:677f6a0ee643 |
---|---|
257 Given a string and a face, return the string's length in pixels when | 257 Given a string and a face, return the string's length in pixels when |
258 displayed in the font associated with the face. | 258 displayed in the font associated with the face. |
259 */ | 259 */ |
260 | 260 |
261 static int | 261 static int |
262 x_text_width (struct face_cachel *cachel, CONST Emchar *str, | 262 x_text_width (struct frame *f, struct face_cachel *cachel, CONST Emchar *str, |
263 Charcount len) | 263 Charcount len) |
264 { | 264 { |
265 int width_so_far = 0; | 265 int width_so_far = 0; |
266 unsigned char *text_storage = (unsigned char *) alloca (2 * len); | 266 unsigned char *text_storage = (unsigned char *) alloca (2 * len); |
267 struct textual_run *runs = alloca_array (struct textual_run, len); | 267 struct textual_run *runs = alloca_array (struct textual_run, len); |
812 | 812 |
813 XSETDEVICE (device, d); | 813 XSETDEVICE (device, d); |
814 XSETWINDOW (window, w); | 814 XSETWINDOW (window, w); |
815 | 815 |
816 if (width < 0) | 816 if (width < 0) |
817 width = x_text_width (cachel, Dynarr_atp (buf, 0), Dynarr_length (buf)); | 817 width = x_text_width (f, cachel, Dynarr_atp (buf, 0), Dynarr_length (buf)); |
818 height = dl->ascent + dl->descent - dl->clip; | 818 height = dl->ascent + dl->descent - dl->clip; |
819 | 819 |
820 /* Regularize the variables passed in. */ | 820 /* Regularize the variables passed in. */ |
821 | 821 |
822 if (clip_start < xpos) | 822 if (clip_start < xpos) |