[MPlayer-dev-eng] [PATCH]breakline properly with subtitles using Chinese

Rich Felker dalias at aerifal.cx
Thu Nov 24 19:05:15 CET 2005


On Thu, Nov 24, 2005 at 11:10:36PM +0800, ?????? wrote:
> Hi,
> 
> MPlayer treat characters without whitespace as a single word and try to render 
> it in one line, if the length is too long then the word will be truncated, 
> however in Chinese and many asia languages there is no whitespace to seperate 
> word, so MPlayer usually treat a sentence as a word, and usually the sentence 
> will be truncate if it cannot be rendered in one line. This patch detect if 
> the character is some asia char, (I assume char > 0x800 is a asia char), and 
> try to break the sentence when it cannot be rendered as a word. Please test 
> it, thx.

definitely not correct; not all asian languages or all languages using
characters past 0x800 are splittable at any point! you'll have to
special-case it much more if you want a patch like this to be
accepted. i don't know the correct splitting algorithms so you'll have
to do it yourself but i imagine it involves a database of all words
for chinese and japanese. for tibetan the lines can only be broken at
syllable boundaries (which are marked by punctuation) and i imagine
this is the case for many south-asian languages as well.

anyway why can't you just write your subtitle files properly? i doubt
anyone actually shares files without the proper line breaks since i
doubt windows players will break the lines for you..

rich





More information about the MPlayer-dev-eng mailing list