Trouble using different fonts

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
Guest

Trouble using different fonts

#1 Post by Guest »

I've put the fonts into the game directory, and I've tried using two methods to display fonts. First I tried to just replace the font for one bit of dialogue in the game (For one short conversation, the text needs to be displayed in Japanese), but I got an error. (More below). I also tried this method to replace the font for the whole game in hopes it would give the game Japanese text support, but that also gave me an error like this:

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

Exception: Could not find font: (u'AppleMyungjo.ttf', 22, False, False, False)

While running game code:
 - script at line 332 of /Users/Elena/4 Days in Amsterdam/game/script.rpy

-- Full Traceback ------------------------------------------------------------

  File "/Users/Elena/renpy-6.9.3/renpy/bootstrap.py", line 260, in bootstrap
  File "/Users/Elena/renpy-6.9.3/renpy/main.py", line 308, in main
  File "/Users/Elena/renpy-6.9.3/renpy/main.py", line 92, in run
  File "/Users/Elena/renpy-6.9.3/renpy/execution.py", line 230, in run
  File "/Users/Elena/renpy-6.9.3/renpy/ast.py", line 341, in execute
  File "/Users/Elena/renpy-6.9.3/renpy/exports.py", line 507, in say
  File "/Users/Elena/renpy-6.9.3/renpy/character.py", line 546, in __call__
  File "/Users/Elena/renpy-6.9.3/renpy/character.py", line 505, in do_display
  File "/Users/Elena/renpy-6.9.3/renpy/character.py", line 320, in display_say
  File "/Users/Elena/renpy-6.9.3/renpy/ui.py", line 69, in interact
  File "/Users/Elena/renpy-6.9.3/renpy/display/core.py", line 1364, in interact
  File "/Users/Elena/renpy-6.9.3/renpy/display/core.py", line 1663, in interact_core
  File "/Users/Elena/renpy-6.9.3/renpy/display/core.py", line 983, in show
  File "/Users/Elena/renpy-6.9.3/renpy/display/render.py", line 711, in render_screen
  File "/Users/Elena/renpy-6.9.3/renpy/display/render.py", line 142, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/layout.py", line 485, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/render.py", line 142, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/layout.py", line 485, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/render.py", line 142, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/layout.py", line 485, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/render.py", line 142, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/layout.py", line 744, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/render.py", line 142, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/layout.py", line 581, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/render.py", line 142, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/text.py", line 1368, in render
  File "/Users/Elena/renpy-6.9.3/renpy/display/text.py", line 1030, in layout
  File "/Users/Elena/renpy-6.9.3/renpy/display/text.py", line 108, in update
  File "/Users/Elena/renpy-6.9.3/renpy/display/font.py", line 437, in get_font
Exception: Could not find font: (u'AppleMyungjo.ttf', 22, False, False, False)

While running game code:
 - script at line 332 of /Users/Elena/4 Days in Amsterdam/game/script.rpy

Ren'Py Version: Ren'Py 6.9.3c
This is the area that is giving me trouble: (when I remove it, the game works fine)

Code: Select all

        
    label japan:
        sf "{font=AppleMyungjo.ttf}すばらしい!{/font} "
        sf "Sou desu ka? Subarashi desuwa! Anata wa koukangakusei desu ka?"
        menu:
            "Sou da! Demo... nihon wa yoi desu!  Thorne-san ha tensai desu!":
                show sf happy at right
                sf "Ara, ma!  Arigato gozaimasu!"
                sf "You're too kind.  That's pretty much all the Japanese I know."
                show sf at right
                sf "I'm more well-versed in the Romantic languages, myself."
                sf "French, Italian, and Spanish, mostly."
                sf "Of course, knowing Dutch and English makes German easy to understand, too..."
                "Damn, this girl knows too many languages for her own good."
            "Sore ga himitsu desu!":
                sf "Honto ni?  Sore wa chotti ni kyoumibukai desu wa...."
            "Er... kawaii, sushi... bishoujou baka!":
                show sf mad at right
                sf "Impressive, indeed."
            "Haha, jsut kidding, I'm just a wannabe weeaboo who WISHES they were Japanese.":
               show sf mad at right
               sf "...Oh."
               
I really want the Japanese text to display IN Japanese, but so far the only solution has been to give up and write it in romanji.

Yamino
Newbie
Posts: 2
Joined: Mon Sep 21, 2009 5:50 am
Contact:

Re: Trouble using different fonts

#2 Post by Yamino »

Oops. I thought I was logged in. :shock:

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Trouble using different fonts

#3 Post by JQuartz »

Guest wrote:First I tried to just replace the font for one bit of dialogue in the game (For one short conversation, the text needs to be displayed in Japanese), but I got an error.
I copied the code and it worked perfectly. I think you either didn't name the file correctly or you misplaced the ttf.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

Yamino
Newbie
Posts: 2
Joined: Mon Sep 21, 2009 5:50 am
Contact:

Re: Trouble using different fonts

#4 Post by Yamino »

I put it both in the main folder for the game, and also in the folder called "game."

And I copy-pasted the font name from the file, just to make sure I spelled it right. Would using a mac have anything to do with it?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Trouble using different fonts

#5 Post by JQuartz »

Yamino wrote:Would using a mac have anything to do with it?
Well, I never used a mac before so I can't say.
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

User avatar
trish_vc
Regular
Posts: 47
Joined: Tue Dec 25, 2012 1:52 am
Projects: SC; Lost Memories (on hold)
Deviantart: ash-chiori
Skype: aeisha33
Location: The land of FUN
Contact:

Re: Trouble using different fonts

#6 Post by trish_vc »

I'm sorry, but an uncaught exception occurred.

While running game code:
Exception: Could not find font 'font.ttf'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\execution.py", line 266, in run
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\ast.py", line 646, in execute
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\python.py", line 1172, in py_exec_bytecode
File "common/00library.rpy", line 419, in <module>
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\exports.py", line 841, in pause
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\ui.py", line 237, in interact
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\display\core.py", line 1813, in interact
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\display\core.py", line 2118, in interact_core
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\display\core.py", line 1402, in draw_screen
File "render.pyx", line 366, in renpy.display.render.render_screen (gen\renpy.display.render.c:4567)
File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2032)
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\display\layout.py", line 514, in render
File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2290)
File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2032)
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\display\layout.py", line 514, in render
File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2290)
File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2032)
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\display\layout.py", line 514, in render
File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2290)
File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2032)
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\text\text.py", line 1282, in render
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\text\text.py", line 440, in __init__
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\text\text.py", line 219, in glyphs
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\text\font.py", line 569, in get_font
File "D:\OTAKU\!renpy-6.14.1-sdk\renpy\text\font.py", line 542, in load_face
Exception: Could not find font 'font.ttf'.

Windows-XP-5.1.2600-SP3
Ren'Py 6.14.1.366

User avatar
trish_vc
Regular
Posts: 47
Joined: Tue Dec 25, 2012 1:52 am
Projects: SC; Lost Memories (on hold)
Deviantart: ash-chiori
Skype: aeisha33
Location: The land of FUN
Contact:

Re: Trouble using different fonts

#7 Post by trish_vc »

what should i do? unfortunately i'm a noOby

Post Reply

Who is online

Users browsing this forum: simple_human