- fixed a bug in draw-image-text.

This commit is contained in:
frese 2002-02-04 12:44:08 +00:00
parent 40fcb8e61d
commit b6a026853a
2 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,6 @@
#include "xlib.h"
#include "scheme48.h"
#include <stdio.h>
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;

View File

@ -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)