→ If you want to change only the in game font please look at this great tutorial about font selection from BáiYù.
→ If you want to change all the font (so in game, interface like menu button and character name), there is two possibility :
1) All your fonts are the same
2) All your fonts are different (more likely).
1) All your font are the same.
Step 1 : put all your font, including OpenDyslexic into your game folder. (You can find it here)
Step 2 : Go into your gui.rpy file, and look for this piece of code
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"`
step 3 : Instead put :
Code: Select all
## The font used for in-game text.
define gui.text_font = gui.preference("font", "DejaVuSans.ttf")
## The font used for character names.
define gui.name_text_font = gui.preference("font", "DejaVuSans.ttf")
## The font used for out-of-game text.
define gui.interface_text_font = gui.preference("font", "DejaVuSans.ttf")
step 4 : Go into your screen.rpy, and look for your preference screen find this line :
Then add :## Additional vboxes of type "radio_pref" or "check_pref" can be
## added here, to add additional creator-defined preferences.
Code: Select all
vbox:
style_prefix "check"
label _("Font")
textbutton _("Default") action gui.SetPreference("font", "DejaVuSans.ttf")
textbutton _("OpenDyslexic") action gui.SetPreference("font", "OpenDyslexic.otf")
Bonus : Add more font choices.
You can add as many font choice you want, at the end of the previous code inside the preference screen just add this line as much as you need :
Code: Select all
textbutton _("OpenDyslexic") action gui.SetPreference("font", "Yourfont.otf")
2) All your font are different (so a font for in game, a font for buttons and so on.)
Step 1 : put all your font, including OpenDyslexic into your game folder. (You can find it here)
Step 2 : Go into your gui.rpy file, and look for this piece of code
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"`
step 3 : Instead put :
Code: Select all
## The font used for in-game text.
define gui.text_font = gui.preference("font_1", "DejaVuSans.ttf")
## The font used for character names.
define gui.name_text_font = gui.preference("font_2", "DejaVuSans.ttf")
## The font used for out-of-game text.
define gui.interface_text_font = gui.preference("font_3", "DejaVuSans.ttf")
step 4 : go into your screen.rpy, and look for your preference screen find this line :
Then add :## Additional vboxes of type "radio_pref" or "check_pref" can be
## added here, to add additional creator-defined preferences.
Code: Select all
vbox:
style_prefix "check"
label _("Font")
textbutton _("Default") action [gui.SetPreference("font_1", "DejaVuSans.ttf"), gui.SetPreference("font_2", "DejaVuSans.ttf"), gui.SetPreference("font_3", "DejaVuSans.ttf")]
textbutton _("OpenDyslexic") action [ gui.SetPreference("font_1", "OpenDyslexic.otf"), gui.SetPreference("font_2", "OpenDyslexic.otf"), gui.SetPreference("font_3", "OpenDyslexic.otf")]
Bonus : Add more font choices.
You can add as many font choice you want, at the end of the previous code inside the preference screen just add this line as much as you need :
Code: Select all
textbutton _("Font name") action [ gui.SetPreference("font_1", "YourFont.otf"), gui.SetPreference("font_2", "YourFont.otf"), gui.SetPreference("font_3", "YourFont.otf")
And that's all, I hope it will be useful !
3) Adjust font size
OpenDyslexic is a font really bigger than other traditional font. It can then cause problem (text too big for the texbox, overlaping in game menu and so on). There is a simple solution to fix it, into your gui.rpy just at the begining after the :
Code: Select all
init python:
Code: Select all
config.ftfont_scale["OpenDyslexic.otf"] = .7
Code: Select all
config.ftfont_vertical_extent_scale["OpenDyslexic.otf"] = .8