|
From: Frantisek D. <va...@us...> - 2003-09-18 18:15:12
|
Update of /cvsroot/xine/xine-lib/misc
In directory sc8-pr-cvs1:/tmp/cvs-serv25246/misc
Modified Files:
xine-fontconv.c
Log Message:
Generating codepages with more than 256 characters (max. 16-bit).
Right computing text size of multibyte texts in OSD.
Different alias character for missing character in the conversion
and in the font: #, _
Index: xine-fontconv.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/misc/xine-fontconv.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- xine-fontconv.c 21 May 2003 22:54:57 -0000 1.9
+++ xine-fontconv.c 18 Sep 2003 18:14:50 -0000 1.10
@@ -165,7 +165,7 @@
uint16_t generate_unicodes_list(item_t **list, char **pages, int number) {
int page;
uint16_t codes_count = 0; /* unicode counter */
- unsigned char z; /* index in codepage */
+ int32_t z; /* index in the codepage */
iconv_t cd; /* iconv conversion descriptor */
*list = NULL;
@@ -180,17 +180,17 @@
printf("Used encoding \"%s\"\n", pages[page]);
/* add new unicodes into list */
- for (z = 32; z < 0xff; z++) {
+ for (z = 32; z < 0xFFFF; z++) {
uint16_t unicode;
char *inbuf = (char *)&z;
char *outbuf = (char *)&unicode;
- size_t inbytesleft = 1;
+ size_t inbytesleft = z <= 0xFF ? 1 : 2;
size_t outbytesleft = 2;
size_t count;
/* get unicode value from index 'z' in this codepage 'pages[i]' */
count = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
- if (count == (size_t)-1) {
+ if (count == (size_t)-1 || inbytesleft != 0) {
/* unused index 'z' in this codepage */
continue;
}
@@ -510,7 +510,7 @@
printf("\n");
list_free(error_unicodes);
}
- printf ("generated %s (%d)\n", filename, font.num_fontchars);
+ printf ("generated %s (%d characters)\n", filename, font.num_fontchars);
}
|