I can't define or use imported fonts? (version 6.99.12.4)

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
017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

I can't define or use imported fonts? (version 6.99.12.4)

#1 Post by 017Bluefield »

I don't know if this is related to the current version of Ren'Py, but when I tried using an imported font (in the gui.py file), it gave me an error message. What code do I use, and where do I put it?

BTW, before you ask, I couldn't find any "style" or "font" options in the options script. I checked.

User avatar
Valhalla
Regular
Posts: 140
Joined: Mon Jun 13, 2016 10:01 am
Contact:

Re: I can't define or use imported fonts? (version 6.99.12.4

#2 Post by Valhalla »

What error are you getting and where are you trying to use it?
Image Image Image

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: I can't define or use imported fonts? (version 6.99.12.4

#3 Post by 017Bluefield »

It says:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 37, in script
    a "......"
Exception: Could not find font u'segoeui.ttf'.

~~~~

Windows-8-6.2.9200
Ren'Py 6.99.12.4.2187
Here's the gui.rpy code I fiddled with (currently using default fonts):

Code: Select all

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

## The font used for in-game text.
define gui.text_font = "DejaVuSans.ttf"

## The font used for character names.
define gui.name_text_font = "DejaVuSans.ttf"

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

User avatar
Valhalla
Regular
Posts: 140
Joined: Mon Jun 13, 2016 10:01 am
Contact:

Re: I can't define or use imported fonts? (version 6.99.12.4

#4 Post by Valhalla »

Well the most obvious problem would be that you are in some way misspelling the font name. Make sure it's not capitalized and that it is TrueType Font (.ttf) and not OpenType Font (.otf). Also you have put the font file into the game folder, yeah?
Image Image Image

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: I can't define or use imported fonts? (version 6.99.12.4

#5 Post by 017Bluefield »

I'm fairly certain that I spelled the font file correctly, but I could be wrong.

Oh, not capitalized. Okay, that's one possible problem down.

Yes, I did. But, is it supposed to be just in the game folder, or can it be in a "fonts" subfolder?

User avatar
Valhalla
Regular
Posts: 140
Joined: Mon Jun 13, 2016 10:01 am
Contact:

Re: I can't define or use imported fonts? (version 6.99.12.4

#6 Post by Valhalla »

You can put it in a sub-folder but when you write it in you have to include the folder. i.e. "fonts/segoeui.ttf" instead of just "segoeui.ttf"
Image Image Image

017Bluefield
Regular
Posts: 93
Joined: Mon Dec 30, 2013 1:55 am
Projects: Project Bluefield - Origins
Organization: Autumn Rain
Deviantart: playerzero17
itch: autumn-rain
Contact:

Re: I can't define or use imported fonts? (version 6.99.12.4

#7 Post by 017Bluefield »

Okay, I think I got it working. Thanks. :)

User avatar
Donmai
Eileen-Class Veteran
Posts: 1962
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: I can't define or use imported fonts? (version 6.99.12.4

#8 Post by Donmai »

AFAIK Ren'Py supports OTF fonts without problems.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Post Reply

Who is online

Users browsing this forum: Ocelot