Q: text and ... still text

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#16 Post by PyTom »

oyster wrote: look at the attached pic( sorry, it is a big one).
Okay, let me see if I have this straight, so I can figure out where we stand as of now:

When saving as utf-8, the default font selection code does not work if you give it Chinese characters for the font name. It does work if you give it ascii font filenames, like "simsun.ttf".

The characters that are displayed on the screen are correct when saved as UTF-8, assuming that the font is correctly selected. (This is the part that's confusing to me... your example shows 3 characters before the comma in the "right one" example, but only 2 in the corresponding picture. The characters also look very different, at least to my eyes, which are not familiar at all with hanzi characters Is the correct text being displayed?)

oyster
Newbie
Posts: 15
Joined: Sun Jul 31, 2005 4:28 am
Contact:

#17 Post by oyster »

PyTom wrote:When saving as utf-8, the default font selection code does not work if you give it Chinese characters for the font name. It does work if you give it ascii font filenames, like "simsun.ttf".
yes
PyTom wrote: The characters that are displayed on the screen are correct when saved as UTF-8, assuming that the font is correctly selected.
yes, again.
PyTom wrote: (This is the part that's confusing to me... your example shows 3 characters before the comma in the "right one" example, but only 2 in the corresponding picture. The characters also look very different, at least to my eyes, which are not familiar at all with hanzi characters Is the correct text being displayed?)
I am confused too :shock: ,so I attached another pic.
Attachments
meaning.jpg
meaning.jpg (34.55 KiB) Viewed 1101 times

oyster
Newbie
Posts: 15
Joined: Sun Jul 31, 2005 4:28 am
Contact:

#18 Post by oyster »

Well, I understand what your mean by asking
(This is the part that's confusing to me... your example shows 3 characters before the comma in the "right one" example, but only 2 in the corresponding picture. The characters also look very different, at least to my eyes, which are not familiar at all with hanzi characters Is the correct text being displayed?)
In a ansi text file, one Chinese Characters needs 2 chars. But for a utf_8 text file, I donno. I think it should be 4 chars, but it is (perhaps) 1.5( my god! ) chars when saved in SciTE.
Attachments
I C.jpg
I C.jpg (44.92 KiB) Viewed 1099 times

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#19 Post by PyTom »

oyster wrote:e, one Chinese Characters needs 2 chars. But for a utf_8 text file, I donno. I think it should be 4 chars, but it is (perhaps) 1.5( my god! ) chars when saved in SciTE.
utf-8 takes 3 bytes to encode most 2-byte characters. So you're seeing 6 bytes which your mbcs is rendering as 3 characters.

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

#20 Post by DaFool »

I was thinking of doing dual text subtitle-style kind of like authentic Hong Kong movies, with the Chinese (or Japanese) on top of the English.

I haven't really read this thread in-depth, but I take it I just need to have that east asian .rpy and it should be good to go?

Now the next task is finding a translator...

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

#21 Post by PyTom »

You also need to change style.default.font, to pick a C or J font, as appropriate.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users