summaryrefslogtreecommitdiff
path: root/misc/xine-fontconv.c
diff options
context:
space:
mode:
authorFrantišek Dvořák <valtri@users.sourceforge.net>2003-09-18 18:14:50 +0000
committerFrantišek Dvořák <valtri@users.sourceforge.net>2003-09-18 18:14:50 +0000
commit43ed8e88c49089b9bc6cabbba528fc9b7eb6cf5e (patch)
treee6a3402ce996d4313c0cbd8d8fe80d3dec059a8c /misc/xine-fontconv.c
parent02c325dc9e6584c71fb67449aeb505373141724a (diff)
downloadxine-lib-43ed8e88c49089b9bc6cabbba528fc9b7eb6cf5e.tar.gz
xine-lib-43ed8e88c49089b9bc6cabbba528fc9b7eb6cf5e.tar.bz2
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: #, _ CVS patchset: 5402 CVS date: 2003/09/18 18:14:50
Diffstat (limited to 'misc/xine-fontconv.c')
-rw-r--r--misc/xine-fontconv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/xine-fontconv.c b/misc/xine-fontconv.c
index 46d7626a5..7a92417db 100644
--- a/misc/xine-fontconv.c
+++ b/misc/xine-fontconv.c
@@ -165,7 +165,7 @@ void list_free(item_t *list) {
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 @@ uint16_t generate_unicodes_list(item_t **list, char **pages, int number) {
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 @@ void render_font (FT_Face face, char *fontname, int size, int thickness,
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);
}