3 ms·
> SDL_TTF doesn't break lines on Chinese punctuation characters (.,;:!?) Those aren't Chinese punctuation characters. Chinese punctuation characters are full-w
by thaumasiotes 7y ago
> SDL_TTF doesn't break lines on Chinese punctuation characters (.,;:!?)
Those aren't Chinese punctuation characters. Chinese punctuation characters are full-width, including the spacing that should follow them (or in the case of "(", precede) within the glyph itself: (。,;:!?). (You may also notice that the period is radically different.) Chinese text should almost never include space characters.
Chinese applications seem happy to break lines anywhere including in the middle of a word, but punctuation seems like an especially good place for a line break, so I'm confused why SDL_TTF would go out of its way to avoid breaking there.
- simonask 7y agoIt sounds more like a bug in SDL_TTF than a deliberate attempt to not break the line on Chinese punctuation marks. I wonder if SDL_TTF works with Unicode Zero-Width Space (U+200B). If so, that would probably be the right choice.
- babuskov 7y ago> Those aren't Chinese punctuation characters. I know, I meant the actual ones you wrote above. > I'm confused why SDL_TTF would go out of its way to avoid breaking there. SDL_TTF doesn't break at all. If you have a long Chinese text which uses proper punctuation characters, it would never break, because it only breaks on ASCII whitespace. I wanted to avoid breaking lines in the middle of a word, so I added extra "regular" space characters to force breaking the line.
- buntsai 7y agoYou don't really need to only break on punctuation. There is no convention to do so and so long as you so not break any logograms in half, the resulting text reads perfectly fine. In fact, the convention is to have left and right justified text with equal numbers of monospaced logograms, including punctuation, on each line (on the equivalent for vertical text). Classical Chinese before the 20 th century was seldom punctuated.
- babuskov 7y agoI wasn't aware of this. Thanks.