aboutsummaryrefslogtreecommitdiff
path: root/generic/Image.c
diff options
context:
space:
mode:
authorlecoanet2003-11-28 13:27:34 +0000
committerlecoanet2003-11-28 13:27:34 +0000
commit907061f73d930906f884c710bcac576cb9b6fa7d (patch)
tree5a960d97576abfd2409ecd037c93577a833e203f /generic/Image.c
parent68876549f5e9c930831f3290295168934778eba6 (diff)
downloadtkzinc-907061f73d930906f884c710bcac576cb9b6fa7d.zip
tkzinc-907061f73d930906f884c710bcac576cb9b6fa7d.tar.gz
tkzinc-907061f73d930906f884c710bcac576cb9b6fa7d.tar.bz2
tkzinc-907061f73d930906f884c710bcac576cb9b6fa7d.tar.xz
* (ZnGetTexFont): Patch to enable all 256 glyphs of a fonts
minus the 32 first.
Diffstat (limited to 'generic/Image.c')
-rw-r--r--generic/Image.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/generic/Image.c b/generic/Image.c
index 2a2385a..a7498fd 100644
--- a/generic/Image.c
+++ b/generic/Image.c
@@ -964,8 +964,8 @@ ZnImageTex(ZnImage image,
alpha_off = block.offset[3] - block.offset[0];
#endif
/*printf("width %d, height: %d redoff: %d, greenoff: %d, blueoff: %d, alphaoff: %d\n",
- block.width, block.height, block.offset[0], block.offset[1], block.offset[2],
- block.offset[3]);*/
+ block.width, block.height, block.offset[0], green_off,
+ blue_off, alpha_off);*/
pixels = block.pixelPtr;
bptr = bits->t_bits;
@@ -1360,7 +1360,6 @@ ZnGetTexFont(ZnWInfo *wi,
static int inited = 0;
Tcl_HashEntry *entry;
int new;
- unsigned char *glisto = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_abcdefghijmklmnopqrstuvwxyz{|}~°ÀÂÇÈÉÊËÎÏÔÙÛÜàâçèéêëîïôùûü~`";
unsigned char *glist=NULL, *glist2=NULL;
TexGlyphInfo *tgi;
unsigned int i, j;
@@ -1402,7 +1401,11 @@ ZnGetTexFont(ZnWInfo *wi,
}
txf->ascent = fontinfo->ascent;
txf->descent = fontinfo->descent;
- txf->num_glyphs = strlen(glisto);
+ /*
+ * Try to use all glyphs in a font except the first 32
+ * control chars.
+ */
+ txf->num_glyphs = MAX_CHAR-MIN_CHAR+1;
/*
* Initial size of texture.
@@ -1439,7 +1442,10 @@ ZnGetTexFont(ZnWInfo *wi,
}
glist = ZnMalloc((txf->num_glyphs+1) * sizeof(unsigned char));
- strcpy(glist, glisto);
+ for (i = 0; i < txf->num_glyphs; i++) {
+ glist[i] = i+MIN_CHAR;
+ }
+ glist[txf->num_glyphs] = 0;
qsort(glist, txf->num_glyphs, sizeof(unsigned char), glyphCompare);
/*
* Keep a cache a the sorted list in case we need to