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/sub.c | |
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/sub.c')
-rw-r--r-- | libvo/sub.c | 11 |
1 files changed, 7 insertions, 4 deletions
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, |