diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-03-01 03:17:33 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-03-01 03:17:33 +0100 |
commit | 813c609ea30c3201eec34d4bba185566ad48c998 (patch) | |
tree | f93ff7fd2604bf9396d5f1712d3eaa2f6d044178 /src/spu_dec/sputext_decoder.c | |
parent | e728b8f587ee41ff483e46fe50a4cb538c5df9e2 (diff) | |
parent | a1508e2f58d2c4b32d032d798f6f137262717e7f (diff) | |
download | xine-lib-813c609ea30c3201eec34d4bba185566ad48c998.tar.gz xine-lib-813c609ea30c3201eec34d4bba185566ad48c998.tar.bz2 |
Merge from 1.2 tip.
--HG--
rename : src/combined/ffmpeg/ff_dvaudio_decoder.c => src/audio_dec/ff_dvaudio_decoder.c
Diffstat (limited to 'src/spu_dec/sputext_decoder.c')
-rw-r--r-- | src/spu_dec/sputext_decoder.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/src/spu_dec/sputext_decoder.c b/src/spu_dec/sputext_decoder.c index 093fca1e7..0cc0ee21b 100644 --- a/src/spu_dec/sputext_decoder.c +++ b/src/spu_dec/sputext_decoder.c @@ -507,11 +507,52 @@ static void read_ssa_tag(sputext_decoder_t *this, const char* text, (*sub_x), (*sub_y), (*max_width), (*alignment)); } +static int is_cjk_encoding(const char *enc) { + /* CJK charset strings defined in iconvdata/gconv-modules of glibc */ + static const char cjk_encoding_strings[][16] = { + "SJIS", + "CP932", + "EUC-KR", + "UHC", + "JOHAB", + "BIG5", + "BIG5HKSCS", + "EUC-JP-MS", + "EUC-JP", + "EUC-CN", + "GBBIG5", + "GBK", + "GBGBK", + "EUC-TW", + "ISO-2022-JP", + "ISO-2022-JP-2", + "ISO-2022-JP-3", + "ISO-2022-KR", + "ISO-2022-CN", + "ISO-2022-CN-EXT", + "GB18030", + "EUC-JISX0213", + "SHIFT_JISX0213", + }; + + int pstr; + + /* return 1 if encoding string is one of the CJK(Chinese,Jananese,Korean) + * character set strings. */ + for (pstr = 0; pstr < sizeof (cjk_encoding_strings) / sizeof (cjk_encoding_strings[0]); pstr++) + if (strcasecmp (enc, cjk_encoding_strings[pstr]) == 0) + return 1; + + return 0; +} + static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t sub_end ) { int line, y; int font_size; char *font; + const char *encoding = (this->buf_encoding)?this->buf_encoding: + this->class->src_encoding; int sub_x, sub_y, max_width; int alignment; int rebuild_all; @@ -720,7 +761,12 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su } } - ogm_render_line(this, x, y + line*this->line_height, this->text[line]); + if( is_cjk_encoding(encoding) ) { + this->renderer->render_text (this->osd, x, y + line * this->line_height, + this->text[line], OSD_TEXT1); + } else { + ogm_render_line(this, x, y + line*this->line_height, this->text[line]); + } } if( font_size != this->font_size ) |