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.
Message
Author
User avatar
Loading
Newbie
Posts: 23
Joined: Tue Aug 05, 2014 2:08 pm
Contact:

Font

#1 Post by Loading » Mon Jan 05, 2015 6:10 pm

This might seem like a really stupid question, but how can I change the font? For some reason it doesn't work when I use style.default.font in the options file and I get the following:

Parsing the script failed.
File "game/options.rpy", line 148: expected 'word' not found.
style->.default.font = "DejaVuSans.ttf"

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Font

#2 Post by xela » Mon Jan 05, 2015 6:44 pm

There is an field in config that does that.

Otherwise:

Code: Select all

style text:
    is default
    font "DejaVuSans.ttf"
Might do the trick as well.
Like what we're doing? Support us at:
Image

User avatar
SinSisters
Regular
Posts: 94
Joined: Sat Sep 20, 2014 11:07 am
Projects: The Spanish Privateer
Tumblr: thespanishprivateer
itch: sinsisters
Location: Ottawa, Canada
Contact:

Re: Font

#3 Post by SinSisters » Mon Jan 05, 2015 6:57 pm

If you want to use the default font then you can just make it a comment, because I'm pretty sure that otherwise Ren'py will search for the font in the files. So you can have it as:

Code: Select all

    ## The file containing the default font.

    # style.default.font = "DejaVuSans.ttf"

    ## The default size of text.
If you want to change it then remove the # and put the font name in between the quotation marks. Make sure you actually have the font in the game files.

-Nat

User avatar
Loading
Newbie
Posts: 23
Joined: Tue Aug 05, 2014 2:08 pm
Contact:

Re: Font

#4 Post by Loading » Mon Jan 05, 2015 7:18 pm

xela wrote:There is an field in config that does that.

Otherwise:

Code: Select all

style text:
    is default
    font "DejaVuSans.ttf"
Might do the trick as well.

Tried it, doesn't work.
SinSisters wrote:If you want to use the default font then you can just make it a comment, because I'm pretty sure that otherwise Ren'py will search for the font in the files. So you can have it as:

Code: Select all

    ## The file containing the default font.

    # style.default.font = "DejaVuSans.ttf"

    ## The default size of text.
If you want to change it then remove the # and put the font name in between the quotation marks. Make sure you actually have the font in the game files.

-Nat

"DejaVuSans.ttf" was an example, and it's precisely the fact that this code doesn't work that made me come here. I uncommented it and all, but all I got was the error that's in the first post.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Font

#5 Post by xela » Mon Jan 05, 2015 7:26 pm

Well, that worked for me and a lot (all?) other people who're using Ren'Py :)

Post your code, try it on a fresh project... it's prolly some small thing you've missed.
Like what we're doing? Support us at:
Image

User avatar
Loading
Newbie
Posts: 23
Joined: Tue Aug 05, 2014 2:08 pm
Contact:

Re: Font

#6 Post by Loading » Mon Jan 05, 2015 7:39 pm

The code is literally just what you and the other person said. Using the code you gave me didn't show any errors, but it didn't show the font either.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Font

#7 Post by xela » Mon Jan 05, 2015 7:46 pm

What font are you using instead? Maybe it looks really similar... I cannot try it right now, but it would surprize me if config and style failed. Can you try specifying text as the style to whatever you're using to test new font?
Like what we're doing? Support us at:
Image

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Font

#8 Post by xela » Mon Jan 05, 2015 7:49 pm

Just to clarify, dejavusans is the default font of renpy. Everyone who gave you advice naturally assumed that you were trying to default to something else.
Like what we're doing? Support us at:
Image

User avatar
Loading
Newbie
Posts: 23
Joined: Tue Aug 05, 2014 2:08 pm
Contact:

Re: Font

#9 Post by Loading » Mon Jan 05, 2015 8:03 pm

While the difference between them isn't as big as day and night, there is a clearly visible difference.
It works when I set it so only certain characters use the font by using the following code:

Code: Select all

define e = Character('Eileen', color="#c8ffc8", what_font="DejaVuSans.ttf")
I know it's the default Ren'Py font, I was just using it instead of the actual font name.
Last edited by Loading on Mon Jan 05, 2015 8:10 pm, edited 1 time in total.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Font

#10 Post by xela » Mon Jan 05, 2015 8:09 pm

My last suggestion would be to rename it to something else like myfont.ttf. Otherwise I need renpy to test it for myself and that doesn't fly on android. This should be basic stuff anyway.
Like what we're doing? Support us at:
Image

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: Font

#11 Post by trooper6 » Mon Jan 05, 2015 8:14 pm

Did you put the font into the game folder?
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
Loading
Newbie
Posts: 23
Joined: Tue Aug 05, 2014 2:08 pm
Contact:

Re: Font

#12 Post by Loading » Tue Jan 06, 2015 6:29 am

xela wrote:My last suggestion would be to rename it to something else like myfont.ttf. Otherwise I need renpy to test it for myself and that doesn't fly on android. This should be basic stuff anyway.
Well, it already has a very unique name, so I don't see how it would help.

trooper6 wrote:Did you put the font into the game folder?
Yes.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Font

#13 Post by nyaatrap » Tue Jan 06, 2015 6:46 am

You can't change default font style if you are using a certain theme (A white tulip).

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Font

#14 Post by xela » Tue Jan 06, 2015 1:31 pm

nyaatrap wrote:You can't change default font style if you are using a certain theme (A white tulip).
Sweet.. should that not be flagged as a plain bug and fixed??? Sounds kinda ridiculous even if someone documents such a behavior.
Like what we're doing? Support us at:
Image

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: Font

#15 Post by trooper6 » Tue Jan 06, 2015 3:02 pm

Okay, I just looked at the code for my game...my options.rpy file specifically.

My game uses a remade theme: Marker

Where is lets you customize the font, I have:

Code: Select all

    style.default.font = "00 fonts/Connie-Regular.ttf"
That is exactly how it is entered. I have no problems.

Could you post the code you have under that options section exactly, and use the code tags? Perhaps there is an indentation problem?
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

Post Reply

Who is online

Users browsing this forum: No registered users