Can't find font?

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
taupah
Newbie
Posts: 15
Joined: Fri Jun 26, 2015 6:26 pm
Contact:

Can't find font?

#1 Post by taupah »

Hi guys.... first, let me apologize for all the dumb newbie questions. Secondly, I'm having trouble changing the default font in my VN. I'm wondering if I have the font in the wrong folder (it's just in the "game" folder right now), or if the way you're supposed to declare a font has changed? Thanks in advance!
This is the code:

Code: Select all

 style.default.font = "images/SUDBLT__.ttf" 
And this is the error message:
I'm sorry, but an uncaught exception occurred.

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

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

Full traceback:
File "renpy/common/_layout/screen_main_menu.rpym", line 29, in script
$ ui.interact()
File "/Applications/renpy-6.99.4-sdk/renpy/ast.py", line 785, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "/Applications/renpy-6.99.4-sdk/renpy/python.py", line 1448, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/_layout/screen_main_menu.rpym", line 29, in <module>
$ ui.interact()
File "/Applications/renpy-6.99.4-sdk/renpy/ui.py", line 277, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "/Applications/renpy-6.99.4-sdk/renpy/display/core.py", line 2276, in interact
repeat, rv = self.interact_core(preloads=preloads, **kwargs)
File "/Applications/renpy-6.99.4-sdk/renpy/display/core.py", line 2608, in interact_core
self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
File "/Applications/renpy-6.99.4-sdk/renpy/display/core.py", line 1717, in draw_screen
renpy.config.screen_height,
File "renpy/display/render.pyx", line 379, in renpy.display.render.render_screen (gen/renpy.display.render.c:5886)
rv = render(root, width, height, 0, 0)
File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2662)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/layout.py", line 649, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3045)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2662)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/layout.py", line 649, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3045)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2662)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/layout.py", line 649, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3045)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2662)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/screen.py", line 597, in render
child = renpy.display.render.render(self.child, w, h, st, at)
File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3045)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2662)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/layout.py", line 649, in render
surf = render(child, width, height, cst, cat)
File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3045)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2662)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/layout.py", line 995, in render
st, at)
File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3045)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2662)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/layout.py", line 808, in render
surf = render(d, width - x, rh, cst, cat)
File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3045)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2662)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/behavior.py", line 619, in render
rv = super(Button, self).render(width, height, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/layout.py", line 968, in render
xminimum = max(xminimum, size_groups[size_group].width(width, height, st, at))
File "/Applications/renpy-6.99.4-sdk/renpy/display/layout.py", line 914, in width
rend = i.render(width, height, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/behavior.py", line 619, in render
rv = super(Button, self).render(width, height, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/display/layout.py", line 995, in render
st, at)
File "renpy/display/render.pyx", line 103, in renpy.display.render.render (gen/renpy.display.render.c:3045)
cpdef render(d, object widtho, object heighto, double st, double at):
File "renpy/display/render.pyx", line 185, in renpy.display.render.render (gen/renpy.display.render.c:2662)
rv = d.render(widtho, heighto, st, at)
File "/Applications/renpy-6.99.4-sdk/renpy/text/text.py", line 1524, in render
layout = Layout(self, width, height, renders)
File "/Applications/renpy-6.99.4-sdk/renpy/text/text.py", line 523, in __init__
glyphs = ts.glyphs(s)
File "/Applications/renpy-6.99.4-sdk/renpy/text/text.py", line 229, in glyphs
fo = font.get_font(self.font, self.size, self.bold, self.italic, 0, self.antialias, self.vertical)
File "/Applications/renpy-6.99.4-sdk/renpy/text/font.py", line 593, in get_font
face = load_face(fn)
File "/Applications/renpy-6.99.4-sdk/renpy/text/font.py", line 562, in load_face
raise Exception("Could not find font {0!r}.".format(orig_fn))
Exception: Could not find font 'images/SUDBLT__.ttf'.

Darwin-14.1.0-x86_64-i386-64bit
Ren'Py 6.99.4.467
Kayla's Story 0.0

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Can't find font?

#2 Post by trooper6 »

If it is just in the game folder and not in the images folder then you sould declare it:

style.default.font = "SUDBLT__.ttf"
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

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:

Re: Can't find font?

#3 Post by PyTom »

If not, consider shift+D, file list, and posting that so we can figure out where the font is.
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: Bing [Bot]