Japanese and English 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.
Post Reply
Message
Author
Sumire76Joker
Newbie
Posts: 8
Joined: Fri May 06, 2016 4:06 pm
Deviantart: Sumire56
Contact:

Japanese and English Text

#1 Post by Sumire76Joker » Fri May 06, 2016 4:16 pm

I know this subject has been discussed in other threads, but none of the solutions have worked in my case. I want to use both Japanese and English text in my game, and I tried to take a font, msmicho.ttc, that I already had on my computer and use it for the japanese. The code I have for it right now is:

Code: Select all

# You can place the script of your game in this file.

# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"

image black = "#000000"
image bg classroom = "underC2.jpg"
image keiko idles = "keiko_idle2.png"
image keiko wink = "keiko_wink2.png"
image keiko happy = "keiko_happy2.png"
image keiko dis = "keiko_dis2.png"
image keiko sit = "keiko_sit2.png"

init python:

    style.default.font = "msmicho.ttc"
    style.default.language = "eastasian"

# Declare characters used by this game.
define e = Character('Keiko', color="#c8ffc8")


# The game starts here.
label start:
    
    # scene black
    # show bg classroom at truecenter
    scene bg classroom
    show keiko idles

    e "おはいようございます"

    e "Once you add a story, pictures, and music, you can release it to the world!"

    return
The file is in the game directory, but running the program throws an error saying it can't find the file.
In addition, is it even possible to use both English and Japanese in the same game? The other threads seemed to suggest that it was only Japanese they were using.
If someone has a .ttf file or link for Japanese text that would be helpful as well, in case it is a problem with the file.

Thanks!

EDIT: I was missing the n, sorry about that.

Edit 2: The change has allowed me to have both Japanese and English text; however the character names do not appear in either English or Japanese, above or in the text box.

Code: Select all

    e = Character(u'keiko', color="#c8ffc8", show_two_window=True)
    w = Character(u'じっこう', color="#c8ffc8", show_two_window=True)
I also tried without the u'name'.
Last edited by Sumire76Joker on Fri May 06, 2016 5:11 pm, edited 2 times in total.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Japanese and English Text

#2 Post by xela » Fri May 06, 2016 4:36 pm

I think you're misspelling the name of your font... leaving "n" out. .ttc should be ok for Ren'Py and you can translate to as many languages in Ren'Py as you like.
Like what we're doing? Support us at:
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]