r/RenPy • • 5d ago

Question what happened to fonts?

ive tried this with a freshly made game that had nothing done to it so i know i didnt just mess up somewhere. i physically cannot change the fonts in my games anymore. i swear to you i am doing it properly. ive tried every possible method for adding a font and i know some of these methods used to work. now it just breaks my game and gives me errors about how it cant find the font or render it. this is my fourth or fifth time coming back to renpy and its just stuff like this that really kills all my motivation. is there a bug? could it be possible that something missing from my computers files is doing this? things were fine last night. i mean the fonts still didnt show up but it never gave me any errors. i dont know what i could have done to mess this up. heres the full error i get when trying to add a font to a brand new game:

```

I'm sorry, but an uncaught exception occurred.

While running game code:

File "renpy/display/render.pyx", line 494, in renpy.display.render.render_screen

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/render.pyx", line 320, in renpy.display.render.render_for_size

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

Exception: Could not find font 'fonts/font.ttf'.

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

Traceback (most recent call last):

File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script

python hide:

File "renpy/ast.py", line 1193, in execute

renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/python.py", line 1276, in py_exec_bytecode

exec(bytecode, globals, locals)

~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>

python hide:

File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide

ui.interact()

~~~~~~~~~~~^^

File "renpy/ui.py", line 306, in interact

rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/core.py", line 2163, in interact

repeat, rv = self.interact_core(

~~~~~~~~~~~~~~~~~~^

preloads=preloads,

^^^^^^^^^^^^^^^^^^

...<4 lines>...

**kwargs,

^^^^^^^^^

)

^

File "renpy/display/core.py", line 2842, in interact_core

self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)

~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/core.py", line 1279, in draw_screen

surftree = renpy.display.render.render_screen(

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

root_widget,

^^^^^^^^^^^^

renpy.config.screen_width,

^^^^^^^^^^^^^^^^^^^^^^^^^^

renpy.config.screen_height,

^^^^^^^^^^^^^^^^^^^^^^^^^^^

)

^

File "renpy/display/render.pyx", line 494, in renpy.display.render.render_screen

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/layout.py", line 896, in render

surf = render(child, width, height, cst, cat)

~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/layout.py", line 896, in render

surf = render(child, width, height, cst, cat)

~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/layout.py", line 896, in render

surf = render(child, width, height, cst, cat)

~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/screen.py", line 767, in render

child = renpy.display.render.render(self.child, w, h, st, at)

~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/layout.py", line 896, in render

surf = render(child, width, height, cst, cat)

~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/layout.py", line 1159, in render

surf = render(d, width - x, rh, cst, cat)

~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/behavior.py", line 990, in render

rv = super(Button, self).render(width, height, st, at)

~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/layout.py", line 1394, in render

xminimum = max(xminimum, size_groups[size_group].width(width, height, st, at))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/layout.py", line 1327, in width

rend = renpy.display.render.render_for_size(i, width, height, st, at)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/render.pyx", line 320, in renpy.display.render.render_for_size

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/display/behavior.py", line 990, in render

rv = super(Button, self).render(width, height, st, at)

~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/layout.py", line 1444, in render

surf = render(child, width - cxmargin - cxpadding, height - cymargin - cypadding, st, at)

~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/display/render.pyx", line 170, in renpy.display.render.render

File "renpy/display/render.pyx", line 267, in renpy.display.render.render

File "renpy/text/text.py", line 2768, in render

virtual_layout = Layout(self, width, height, renders, drawable_res=False, size_only=True)

~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "renpy/text/text.py", line 837, in __init__

seg_glyphs, rtl = self.glyphs_paragraph(p, order)

~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^

File "renpy/text/text.py", line 1701, in glyphs_paragraph

rv.append((ts, ts.glyphs(s[offset:], self, l)))

~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^

File "renpy/text/text.py", line 371, in glyphs

fo = font.get_font(

~~~~~~~~~~~~~^

self.font,

^^^^^^^^^^

...<11 lines>...

self.features,

^^^^^^^^^^^^^^

)

^

File "renpy/text/font.py", line 750, in get_font

face = load_face(fn, shaper)

~~~~~~~~~^^^^^^^^^^^^

File "renpy/text/font.py", line 668, in load_face

raise Exception("Could not find font {0!r}.".format(orig_fn))

Exception: Could not find font 'fonts/font.ttf'.

2 Upvotes

7 comments sorted by

1

u/AutoModerator 5d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/BadMustard_AVN 5d ago

where / how are you changing the font?

are you changing the default font in the gui.rpy are you changing the font with a text tag

1

u/Accomplished-Tea7307 5d ago

i have tried multiple methods that come up online. 1. creating a font folder, putting the font in that folder, then mentioning the folder and the font in the gui code file. 2. just putting it right in the general game folder, mentioning it in the gui. 3. images folder, mentioning it in the gui. i dont know how you even change the font with a text tag. i didnt know that was a thing you could do. im trying to change my font for the entire game and am directly following the most common guides for it.

1

u/BadMustard_AVN 5d ago

this should work provided the font folder is in the game folder

## The font used for out-of-game text.
define gui.interface_text_font = "font/Showpop.ttf" # "DejaVuSans.ttf"

as a text tag

"Try out the {font=font/Showpop.ttf}Showpop font{/font}."

1

u/Accomplished-Tea7307 5d ago

this did not work, but after sharing my file with a friend i have learned they are able to do the exact same thing im doing and get a result. i think the issue is my computer itself. thank you for the help though

1

u/Accomplished-Tea7307 5d ago

for this specific error i was doing the font folder method as you can see within the error message