# HG changeset patch # User arpi # Date 1020304588 0 # Node ID 48e91dc9534b1cd14c1c84745c92ece4ee1fa6d1 # Parent cffef9cc01bba33878e885d03ae234b02c2d272f .raw width>=65536 support by Georgi Georgiev diff -r cffef9cc01bb -r 48e91dc9534b TOOLS/subfont-c/subfont.c --- a/TOOLS/subfont-c/subfont.c Wed May 01 22:37:59 2002 +0000 +++ b/TOOLS/subfont-c/subfont.c Thu May 02 01:56:28 2002 +0000 @@ -111,7 +111,15 @@ static unsigned char header[800] = "mhwanh"; int i; header[7] = 4; + if (width < 0x10000) { // are two bytes enough for the width? header[8] = width>>8; header[9] = (unsigned char)width; + } else { // store width using 4 bytes at the end of the header + header[8] = header[9] = 0; + header[28] = (width >> 030) & 0xFF; + header[29] = (width >> 020) & 0xFF; + header[30] = (width >> 010) & 0xFF; + header[31] = (width ) & 0xFF; + } header[10] = height>>8; header[11] = (unsigned char)height; header[12] = colors>>8; header[13] = (unsigned char)colors; for (i = 32; i<800; ++i) header[i] = (i-32)/3; diff -r cffef9cc01bb -r 48e91dc9534b libvo/font_load.c --- a/libvo/font_load.c Wed May 01 22:37:59 2002 +0000 +++ b/libvo/font_load.c Thu May 02 01:56:28 2002 +0000 @@ -22,6 +22,8 @@ raw->w=head[8]*256+head[9]; raw->h=head[10]*256+head[11]; raw->c=head[12]*256+head[13]; + if(raw->w == 0) // 2 bytes were not enough for the width... read 4 bytes from the end of the header + raw->w = ((head[28]*0x100 + head[29])*0x100 + head[30])*0x100 + head[31]; if(raw->c>256) return NULL; // too many colors!? if(verbose) printf("RAW: %s %d x %d, %d colors\n",name,raw->w,raw->h,raw->c); if(raw->c){ diff -r cffef9cc01bb -r 48e91dc9534b libvo/font_load.h --- a/libvo/font_load.h Wed May 01 22:37:59 2002 +0000 +++ b/libvo/font_load.h Thu May 02 01:56:28 2002 +0000 @@ -16,7 +16,7 @@ raw_file* pic_a[16]; raw_file* pic_b[16]; short font[65536]; - short start[65536]; + int start[65536]; // short is not enough for unicode fonts short width[65536]; } font_desc_t;