From: Frantisek D. <va...@us...> - 2003-09-18 18:17:16
|
Update of /cvsroot/xine/xine-lib/src/libsputext In directory sc8-pr-cvs1:/tmp/cvs-serv25678/src/libsputext Modified Files: xine_decoder.c Log Message: Adjust size of subtitle font ONLY according to get_text_size(), which right handles multibyte strings. (current xine CVS adjusted size also before computing text size) Possibility to select the smallest font too. Index: xine_decoder.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libsputext/xine_decoder.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- xine_decoder.c 18 Sep 2003 18:14:50 -0000 1.62 +++ xine_decoder.c 18 Sep 2003 18:17:12 -0000 1.63 @@ -45,7 +45,8 @@ typedef enum { - SUBTITLE_SIZE_SMALL = 0, + SUBTITLE_SIZE_TINY = 0, + SUBTITLE_SIZE_SMALL, SUBTITLE_SIZE_NORMAL, SUBTITLE_SIZE_LARGE, @@ -100,23 +101,11 @@ static void update_font_size (sputext_decoder_t *this) { - static int sizes[SUBTITLE_SIZE_NUM][4] = { - { 16, 16, 16, 20 }, /* SUBTITLE_SIZE_SMALL */ - { 16, 16, 20, 24 }, /* SUBTITLE_SIZE_NORMAL */ - { 16, 20, 24, 32 }, /* SUBTITLE_SIZE_LARGE */ - }; + static int sizes[SUBTITLE_SIZE_NUM] = { 16, 20, 24, 32 }; - int *vec = sizes[this->class->subtitle_size]; int y; - if( this->width >= 512 ) - this->font_size = vec[3]; - else if( this->width >= 384 ) - this->font_size = vec[2]; - else if( this->width >= 320 ) - this->font_size = vec[1]; - else - this->font_size = vec[0]; + this->font_size = sizes[this->class->subtitle_size]; this->line_height = this->font_size + 10; @@ -452,7 +441,9 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) { - static char *subtitle_size_strings[] = { "small", "normal", "large", NULL }; + static char *subtitle_size_strings[] = { + "tiny", "small", "normal", "large", NULL + }; sputext_class_t *this ; #ifdef LOG |