diff options
author | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-05-06 02:26:17 +0000 |
---|---|---|
committer | arpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-05-06 02:26:17 +0000 |
commit | e3d4468a24a4e7371ebb6d026ca3c02e394d1cf8 (patch) | |
tree | 1ee58f8671ddfce63f1839a124f935bdb9333c71 /libvo | |
parent | d087b3eb2a0ea680b2ab821ed27883df76bb34a6 (diff) | |
download | mpv-e3d4468a24a4e7371ebb6d026ca3c02e394d1cf8.tar.bz2 mpv-e3d4468a24a4e7371ebb6d026ca3c02e394d1cf8.tar.xz |
better .smi support and display two-byte characters- patch by Sunjin Yang
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@707 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/font_load.c | 3 | ||||
-rw-r--r-- | libvo/font_load.h | 6 | ||||
-rw-r--r-- | libvo/sub.c | 11 |
3 files changed, 12 insertions, 8 deletions
diff --git a/libvo/font_load.c b/libvo/font_load.c index c6f009ce37..02e9a918a1 100644 --- a/libvo/font_load.c +++ b/libvo/font_load.c @@ -174,7 +174,8 @@ while(fgets(sor,1020,f)){ int chr=p[0][0]; int start=atoi(p[1]); int end=atoi(p[2]); - if(strlen(p[0])!=1) chr=strtol(p[0],NULL,0); + if(chr>=0x80) chr=(chr<<8)+p[0][1]; + else if(strlen(p[0])!=1) chr=strtol(p[0],NULL,0); if(end<start) { printf("error in font desc: end<start for char '%c'\n",chr); } else { diff --git a/libvo/font_load.h b/libvo/font_load.h index e4d8c56383..1b425ffc1e 100644 --- a/libvo/font_load.h +++ b/libvo/font_load.h @@ -14,9 +14,9 @@ typedef struct { // char *fname_b; raw_file* pic_a[16]; raw_file* pic_b[16]; - short font[512]; - short start[512]; - short width[512]; + short font[65536]; + short start[65536]; + short width[65536]; } font_desc_t; raw_file* load_raw(char *name,int verbose); diff --git a/libvo/sub.c b/libvo/sub.c index 29eb488cc4..d983324eb5 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -104,19 +104,22 @@ void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,in int x=0; for(j=0;j<len;j++){ - int w=vo_font->width[text[j]]; - if(w>100) printf("gazvan: %d (%d=%c)\n",w,text[j],text[j]); + int c=text[j]; + int w = vo_font->width[(c<0x80)?c:(c<<8)+text[++j]]; + if(w>100) printf("gazvan: %d (%d=%c)\n",w,c,c); xsize+=w+vo_font->charspace; } //printf("text width = %d\n",xsize); - if(xsize>dxs) printf("Warning! SUB too wide!!! (%d>%d)\n",xsize,dxs); + //if(xsize>dxs) printf("Warning! SUB too wide!!! (%d>%d)\n",xsize,dxs); x=dxs/2-xsize/2; for(j=0;j<len;j++){ int c=text[j]; - int font=vo_font->font[c]; + int font; + if (c>=0x80) c=(c<<8)+text[++j]; + font = vo_font->font[c]; if(x>=0 && x+vo_font->width[c]<dxs) if(font>=0) draw_alpha(x,y, |