From b6a026853a7500cd68a7a00b4ef15a6dec7882dc Mon Sep 17 00:00:00 2001 From: frese Date: Mon, 4 Feb 2002 12:44:08 +0000 Subject: [PATCH] - fixed a bug in draw-image-text. --- c/xlib/text.c | 8 +++++--- scheme/xlib/text.scm | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/c/xlib/text.c b/c/xlib/text.c index 1ef05d8..3e8d8df 100644 --- a/c/xlib/text.c +++ b/c/xlib/text.c @@ -1,5 +1,6 @@ #include "xlib.h" #include "scheme48.h" +#include extern XDrawText(), XDrawText16(); @@ -10,12 +11,13 @@ extern XDrawText(), XDrawText16(); */ -s48_value scx_Text_Width(s48_value Xfontstruct, s48_value text, s48_value format){ +s48_value scx_Text_Width(s48_value Xfontstruct, s48_value text, + s48_value format){ char* s; XChar2b* s2; XFontStruct* font = SCX_EXTRACT_FONTSTRUCT(Xfontstruct); int len = (int)S48_VECTOR_LENGTH(text), i, tmp; - if (s48_extract_integer(format) == 2){ + if (s48_extract_integer(format) == 1){ for (i = 0; i < len; i++){ tmp = (int)s48_extract_integer(S48_VECTOR_REF(text, i)); s2[i].byte1 = (tmp >> 8) & 0xff; @@ -40,7 +42,7 @@ s48_value scx_Extents_Text (s48_value Xfontstruct, s48_value text, XFontStruct* font = SCX_EXTRACT_FONTSTRUCT(Xfontstruct); XCharStruct CI; int len = (int)S48_VECTOR_LENGTH(text), i, tmp, dir, fasc, fdesc; - if (s48_extract_integer(format) == 2){ + if (s48_extract_integer(format) == 1){ for (i = 0; i < len; i++){ tmp = (int)s48_extract_integer(S48_VECTOR_REF(text, i)); s2[i].byte1 = (tmp >> 8) & 0xff; diff --git a/scheme/xlib/text.scm b/scheme/xlib/text.scm index b96a883..a6325e7 100644 --- a/scheme/xlib/text.scm +++ b/scheme/xlib/text.scm @@ -101,6 +101,7 @@ (define (extents-intern id) (lambda (font text . format) + (display "-----------------\n") (let ((format (if (null? format) '1-byte (car format)))) (%extents-text (font-Xfontstruct font) (text->internal-text text format)