comparison 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
comparison
equal deleted inserted replaced
705:27d351f251eb 706:8a7666a78f83
102 int j; 102 int j;
103 int xsize=-vo_font->charspace; 103 int xsize=-vo_font->charspace;
104 int x=0; 104 int x=0;
105 105
106 for(j=0;j<len;j++){ 106 for(j=0;j<len;j++){
107 int w=vo_font->width[text[j]]; 107 int c=text[j];
108 if(w>100) printf("gazvan: %d (%d=%c)\n",w,text[j],text[j]); 108 int w = vo_font->width[(c<0x80)?c:(c<<8)+text[++j]];
109 if(w>100) printf("gazvan: %d (%d=%c)\n",w,c,c);
109 xsize+=w+vo_font->charspace; 110 xsize+=w+vo_font->charspace;
110 } 111 }
111 //printf("text width = %d\n",xsize); 112 //printf("text width = %d\n",xsize);
112 113
113 if(xsize>dxs) printf("Warning! SUB too wide!!! (%d>%d)\n",xsize,dxs); 114 //if(xsize>dxs) printf("Warning! SUB too wide!!! (%d>%d)\n",xsize,dxs);
114 115
115 x=dxs/2-xsize/2; 116 x=dxs/2-xsize/2;
116 117
117 for(j=0;j<len;j++){ 118 for(j=0;j<len;j++){
118 int c=text[j]; 119 int c=text[j];
119 int font=vo_font->font[c]; 120 int font;
121 if (c>=0x80) c=(c<<8)+text[++j];
122 font = vo_font->font[c];
120 if(x>=0 && x+vo_font->width[c]<dxs) 123 if(x>=0 && x+vo_font->width[c]<dxs)
121 if(font>=0) 124 if(font>=0)
122 draw_alpha(x,y, 125 draw_alpha(x,y,
123 vo_font->width[c], 126 vo_font->width[c],
124 vo_font->pic_a[font]->h, 127 vo_font->pic_a[font]->h,