[Solved]How do I change fonts for my dialogue?

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
User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

[Solved]How do I change fonts for my dialogue?

#1 Post by PoisionLullaby »

Okay so I'll admit i didn't look around too much to see if this has already been asked or answered, so sorry if this is a repeat question.

So i'm trying to replace the dejavusans text because it doesn't fit with my game. I've looked on the website as to how to do this but I keep getting an error when I tried. I've changed how I write the font many times in hopes of just accidentally finding the issue but I can't seem to find it. The font is in the common folder too. (I thought that was my issue) It's probably a simple fix and i'm being stupid but I'd really appreciate the help. Here is the Traceback and everything in case that is needed.

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 68, in script
pt "..."
File "renpy/common/000window.rpy", line 98, in _window_auto_callback
_window_show()
File "renpy/common/000window.rpy", line 60, in _window_show
renpy.with_statement(trans)
Exception: Could not find font u'0@HoboStd.ttc'.

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

Full traceback:
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\bootstrap.py", line 305, in bootstrap
renpy.main.main()
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\main.py", line 499, in main
run(restart)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\main.py", line 147, in run
renpy.execution.run_context(True)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\execution.py", line 795, in run_context
context.run()
File "game/script.rpy", line 68, in script
pt "..."
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\ast.py", line 590, in execute
statement_name("say")
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\ast.py", line 43, in statement_name
i(name)
File "renpy/common/000window.rpy", line 98, in _window_auto_callback
_window_show()
File "renpy/common/000window.rpy", line 60, in _window_show
renpy.with_statement(trans)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\exports.py", line 1406, in with_statement
return renpy.game.interface.do_with(trans, paired, clear=clear)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\core.py", line 2123, in do_with
clear=clear)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\core.py", line 2553, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\core.py", line 2916, in interact_core
self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\core.py", line 1980, in draw_screen
renpy.config.screen_height,
File "renpy/display/render.pyx", line 430, in renpy.display.render.render_screen (gen\renpy.display.render.c:6938)
rv = render(root, width, height, 0, 0)
File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
rv = d.render(widtho, heighto, st, at)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\layout.py", line 702, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
rv = d.render(widtho, heighto, st, at)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\transition.py", line 361, in render
top = render(self.new_widget, width, height, st, at)
File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
rv = d.render(widtho, heighto, st, at)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\layout.py", line 702, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
rv = d.render(widtho, heighto, st, at)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\layout.py", line 702, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
rv = d.render(widtho, heighto, st, at)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\screen.py", line 625, in render
child = renpy.display.render.render(self.child, w, h, st, at)
File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
rv = d.render(widtho, heighto, st, at)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\layout.py", line 702, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
rv = d.render(widtho, heighto, st, at)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\display\layout.py", line 1093, in render
st, at)
File "renpy/display/render.pyx", line 110, in renpy.display.render.render (gen\renpy.display.render.c:3445)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 196, in renpy.display.render.render (gen\renpy.display.render.c:2983)
rv = d.render(widtho, heighto, st, at)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\text\text.py", line 1774, in render
virtual_layout = Layout(self, width, height, renders, drawable_res=False, size_only=True)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\text\text.py", line 574, in __init__
glyphs = ts.glyphs(s, self)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\text\text.py", line 236, in glyphs
fo = font.get_font(self.font, self.size, self.bold, self.italic, 0, self.antialias, self.vertical, self.hinting, layout.oversample)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\text\font.py", line 650, in get_font
face = load_face(fn)
File "C:\Users\happy customer\Desktop\Visual Novel stuff\renpy-6.99.13-sdk\renpy\text\font.py", line 591, in load_face
raise Exception("Could not find font {0!r}.".format(orig_fn))
Exception: Could not find font u'0@HoboStd.ttc'.


I'm new here so I apologize if I do something wrong. ^^'
Last edited by PoisionLullaby on Thu Jan 11, 2018 10:04 pm, edited 1 time in total.
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

User avatar
erickcire95
Regular
Posts: 33
Joined: Tue Dec 26, 2017 7:38 pm
Contact:

Re: How do I change fonts for my dialogue?

#2 Post by erickcire95 »

The font file should be in the Game folder, place it there and then search in gui.rpy for "fonts and font sizes" (around line 58) and then change the font for the text you want

For example, if you want to change the font used for characters' names you should change to

Code: Select all

define gui.name_text_font = "CoolFont.ttf"
if you have your fonts in a subfolder then you should add the route, for example:
if the Font file is in "game/fonts" then you should set it like:

Code: Select all

define gui.name_text_font = "fonts/CoolFont.ttf"

User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

Re: How do I change fonts for my dialogue?

#3 Post by PoisionLullaby »

Okay I moved the font file into my game folder but I still get errors. Could I be placing it in the wrong game folder? there is one in "gui" and "launcher".

I've tried doing it in both ways you suggested both gave me the similar error.

-------------------------------------------
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 72, in script
pt "..."
File "renpy/common/000window.rpy", line 98, in _window_auto_callback
_window_show()
File "renpy/common/000window.rpy", line 60, in _window_show
renpy.with_statement(trans)
Exception: Could not find font u'HoboStd.ttf'.

-------------------------------------------
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 72, in script
pt "..."
File "renpy/common/000window.rpy", line 98, in _window_auto_callback
_window_show()
File "renpy/common/000window.rpy", line 60, in _window_show
renpy.with_statement(trans)
Exception: Could not find font u'fonts/HoboStd.ttf'.
-------------------------------------------

I'm changing it in this part of the gui.rpy file too in case you need to know this.

## Fonts and Font Sizes ########################################################

## The font used for in-game text.
define gui.text_font = "HoboStd.ttf"
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

User avatar
NocturneLight
Regular
Posts: 163
Joined: Thu Jun 30, 2016 1:20 pm
Projects: Unsound Minds: The Clarevine Epoch
Organization: Reminiscent 64
Tumblr: Reminiscent64
itch: Reminiscent64
Location: Texas
Contact:

Re: How do I change fonts for my dialogue?

#4 Post by NocturneLight »

PoisionLullaby wrote: Thu Jan 11, 2018 2:23 am Okay I moved the font file into my game folder but I still get errors. Could I be placing it in the wrong game folder? there is one in "gui" and "launcher".

I've tried doing it in both ways you suggested both gave me the similar error.

-------------------------------------------
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 72, in script
pt "..."
File "renpy/common/000window.rpy", line 98, in _window_auto_callback
_window_show()
File "renpy/common/000window.rpy", line 60, in _window_show
renpy.with_statement(trans)
Exception: Could not find font u'HoboStd.ttf'.

-------------------------------------------
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 72, in script
pt "..."
File "renpy/common/000window.rpy", line 98, in _window_auto_callback
_window_show()
File "renpy/common/000window.rpy", line 60, in _window_show
renpy.with_statement(trans)
Exception: Could not find font u'fonts/HoboStd.ttf'.
-------------------------------------------

I'm changing it in this part of the gui.rpy file too in case you need to know this.

## Fonts and Font Sizes ########################################################

## The font used for in-game text.
define gui.text_font = "HoboStd.ttf"
Are you positive you're putting it in your game's game folder? Like, you're going to the folder that has your game's name, clicking on it, and then pasting the font file to the only folder in there called "game"? Because judging by the error, you don't seem to be putting it there.

Also, are you sure you're spelling the name of the font file correctly?

Also, for what it's worth, is your version of Ren'Py up to date?
The Old Guard is at His Limit. The time is near to usher in the New Guard.

The Great Horror is soon to be free.

Clarevine is the key.


"Unsound Minds: The Clarevine Epoch" is a yuri visual novel that shatters english visual novel norms and aims to blend Christianity and the Cthulhu Mythos to tell a deep and dark story that you'll enjoy. You can follow the Kickstarter here.

Stay sound and persist through the chaos,
NocturneLight

User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

Re: How do I change fonts for my dialogue?

#5 Post by PoisionLullaby »

Ah no I misunderstood what "game" folder meant.

And I think so? I tried it with other fonts in case that was the issue before and got the same error now that I put the font in the right folder the font I wanted won't work but the other two I tested do. The only difference I can see in one that gives me an error is that it's an "OpenType font file" and the others are "TrueType font file". I thought Ren'py could use both? Or is it just the particular font i'm trying to use and just not all work?

Also I double checked my version is up to date.
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How do I change fonts for my dialogue?

#6 Post by Imperf3kt »

Your first reply says your font file is the unsupported macOS font extension .ttc

Your next reply says the file is .ttf

Renpy only supports (properly exported) truetypefont (.ttf) and opentypefont (.otf)

Are you positive the file is a .ttf?
For example, renaming 'myfont.ttc' to 'myfont.ttf' won't make it compatible, the file is still a .ttc except instead of 'myfont (.ttc)', it is now called 'myfont.ttf (.ttc)'
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

Re: How do I change fonts for my dialogue?

#7 Post by PoisionLullaby »

That was the issue! Thank you all so much for the help. :) The smallest wrong detail can mess everything up.
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

User avatar
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: How do I change fonts for my dialogue?

#8 Post by ComputerArt.Club »

Imperf3kt wrote: Thu Jan 11, 2018 3:31 am Renpy only supports (properly exported) truetypefont (.ttf) and opentypefont (.otf)
I recently was trying to solve some font related issues while translating to Chinese and I came across this thread in the process, in case someone finds themselves wondering if ttc being unsupported is part of their problem, I can now confirm that I have a Chinese .ttc font working in the game I am working on. Also, a couple of places mention support for ttc:

https://www.renpy.org/doc/html/text.html#fonts
and
PyTom wrote: Mon Feb 13, 2017 10:00 pm Woff is not supported. It's TTF, TTC, and OTF. I'm pretty sure this is documented somewhere.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: [Solved]How do I change fonts for my dialogue?

#9 Post by Imperf3kt »

TTC works just fine. I found that out after posting previously.

What you have to do is tell renpy which font number to use from the collection.
For example,

Code: Select all

0@myfont.ttc
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]