mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
Deal with unicode subs (-unicode -nounicode).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@727 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
d53a450b5e
commit
b1d77e6840
@ -89,6 +89,7 @@ void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int
|
||||
}
|
||||
|
||||
subtitle* vo_sub=NULL;
|
||||
int sub_unicode=0;
|
||||
|
||||
void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
|
||||
int i;
|
||||
@ -105,7 +106,7 @@ void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,in
|
||||
|
||||
for(j=0;j<len;j++){
|
||||
int c=text[j];
|
||||
int w = vo_font->width[(c<0x80)?c:(c<<8)+text[++j]];
|
||||
int w = vo_font->width[sub_unicode?((c<0x80)?c:(c<<8)+text[++j]):c];
|
||||
if(w>100) printf("gazvan: %d (%d=%c)\n",w,c,c);
|
||||
xsize+=w+vo_font->charspace;
|
||||
}
|
||||
@ -118,7 +119,7 @@ void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,in
|
||||
for(j=0;j<len;j++){
|
||||
int c=text[j];
|
||||
int font;
|
||||
if (c>=0x80) c=(c<<8)+text[++j];
|
||||
if (sub_unicode && (c>=0x80)) c=(c<<8)+text[++j];
|
||||
font = vo_font->font[c];
|
||||
if(x>=0 && x+vo_font->width[c]<dxs)
|
||||
if(font>=0)
|
||||
|
Loading…
Reference in New Issue
Block a user