diff libvo/sub.c @ 706:8a7666a78f83

better .smi support and display two-byte characters- patch by Sunjin Yang
author arpi_esp
date Sun, 06 May 2001 02:26:17 +0000
parents 41d6eec69b60
children 2cbe922e2f3c
line wrap: on
line diff
--- a/libvo/sub.c	Sat May 05 21:38:33 2001 +0000
+++ b/libvo/sub.c	Sun May 06 02:26:17 2001 +0000
@@ -104,19 +104,22 @@
         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,