I know I must be missing something very elementary, but this is very disheartening, this being the very first thing I tried doing on the engine. I've been thinking about it for many hours now, but, I really have no idea how to interpret this error...
It works fine in its default state, when the fonts are specified as 'DejaVuSans.ttf'. I tried Times New Roman and Calibri, as simple Windows fonts, but as you can see, both produced the same error message -- "An exception has occured".
Thank you beforehand, to anyone kind enough to respond...
[Solved] Can't Change Font
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.
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.
[Solved] Can't Change Font
Last edited by Theoria on Wed Aug 09, 2017 6:28 am, edited 2 times in total.
- PMscenarios
- Regular
- Posts: 93
- Joined: Sat Jul 01, 2017 11:22 pm
- Completed: Whale's Waldo
- Projects: In Blood, Xenopathy
- Tumblr: pmscenarios
- itch: pmscenarios
- Contact:
Re: Can't Change Font
You need to supply the font. You can download free fonts from google.
If you put it somewhere other than the main "game" folder you also need to tell it where to look: define.gui.text_font = "font/roboto.ttf"
(this example means I've put the downloaded font into a folder called "font" in the game folder)
If you put it somewhere other than the main "game" folder you also need to tell it where to look: define.gui.text_font = "font/roboto.ttf"
(this example means I've put the downloaded font into a folder called "font" in the game folder)
Re: Can't Change Font
Ah. But, why does it work fine in its default form, when there is no "DejaVuSans.ttf" font in the game folder? Because of that, I just assumed that the script can detect the fonts that are installed on the computer.
Either way, thank you... Hope this prevents further possible confusions from me, in the future, and I don't need to consult here so often.
Either way, thank you... Hope this prevents further possible confusions from me, in the future, and I don't need to consult here so often.
- PMscenarios
- Regular
- Posts: 93
- Joined: Sat Jul 01, 2017 11:22 pm
- Completed: Whale's Waldo
- Projects: In Blood, Xenopathy
- Tumblr: pmscenarios
- itch: pmscenarios
- Contact:
Re: [Mostly Solved] Can't Change Font
It's said several times in the documentation that "DejaVuSans" is the default font supplied with the engine - for example here:
The engine has several defaults like that - try for example writing a sample game without supplying a background or sprite image.
In this case not supplying the font file would mean the game (well, the text) wouldn't work on computers that don't have the custom font spesified installed. The engine is designed to be able to seemlessly compile for several different OSs, and offers translations to different type sets/languages, so requiring the file is the only choice.
...
Overall, having learned from scratch this last month I've found the documentation has a tendency to assume you know basic programming/game design. While it tells you functions and commands, it usually doesn't tell you where to place them and how to use them.
It's also mentioned under gui customization and text - font.Changing Fonts
Ren'Py ships with a default font (DejaVuSans) that covers most western languages, but other fonts are often needed.
The engine has several defaults like that - try for example writing a sample game without supplying a background or sprite image.
In this case not supplying the font file would mean the game (well, the text) wouldn't work on computers that don't have the custom font spesified installed. The engine is designed to be able to seemlessly compile for several different OSs, and offers translations to different type sets/languages, so requiring the file is the only choice.
...
Overall, having learned from scratch this last month I've found the documentation has a tendency to assume you know basic programming/game design. While it tells you functions and commands, it usually doesn't tell you where to place them and how to use them.
Re: [Mostly Solved] Can't Change Font
Thank you again... Now I understand. If it wasn't for the weird error message -- "Could not find font u'times.ttf'." (why "u"?) -- I think I would've searched the document more thoroughly.
"While it tells you functions and commands, it usually doesn't tell you where to place them and how to use them."
I see. Indeed, I virtually have no programming background. I can only hope that I'll be able to pull through, and be able to make a decent game eventually.
"While it tells you functions and commands, it usually doesn't tell you where to place them and how to use them."
I see. Indeed, I virtually have no programming background. I can only hope that I'll be able to pull through, and be able to make a decent game eventually.
Who is online
Users browsing this forum: Bing [Bot]