YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
22 stars 8 forks source link

Request for a function equivalent to draw_text_ext that supports Japanese. #4126

Open iampremo opened 1 year ago

iampremo commented 1 year ago

Ticket #203203

Feature Type: feat_addition_ingame Description: I request a function equivalent to draw_text_ext that supports Japanese.

draw_text_ext() correctly wordwraps English and other languages, but does not support Japanese and other languages (which may include Chinese and Korean) at all.

I would like to see support for Japanese. I am a Japanese user, so this request is about Japanese language support.

Very simply, there are no spaces in Japanese text. The word wrap process in Japanese breaks lines even in the middle of a word when the sentence reaches the width of the line.

Japanese sentences also include English words and numbers. These will be processed in the same way as in English. In other words, no line breaks are made in the middle of a word.

The Japanese hyphenation process is then applied. There are characters forbidden at the beginning of a line, characters forbidden at the end of a line and strings of characters forbidden to break line in the middle of a line. These must be word-wrapped correctly.

I cannot explain Japanese hyphenation in detail in English, so please refer to the wiki document. Please refer to this. https://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages

A demo of wordwrap by html(css). This should make it clear. https://www.dropbox.com/s/3idju8syakyk450/wordwrap.html?dl=1

(Translated using DeepL) Benefit: It will enable you to develop games that deal with Japanese text. It will benefit all Japanese language users. Japanese language users will have a reason to choose GameMaker. (Currently, from the point of view of Japanese language users, GameMaker appears to be a game engine that makes it difficult to create games in Japanese.) Link: https://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages

nickavv commented 11 months ago

Plus-oneing this. draw_text_ext should break if a line exceeds w, whether it encounters a space character or not. Or at the very least, there should be an optional parameter to enable this behavior.

I've just had to implement a function for my CJK localization which goes through a string and adds space characters at the appropriate places to get draw_text_ext to render it properly. Would be nice to be able to skip that step and just use draw_text_ext

arrosev commented 3 weeks ago

There are alternatives, but I really wish I could reach this functionality directly through the official api.