A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
-
Gianserpe
- Newbie
- Posts: 21
- Joined: Mon May 27, 2019 4:20 pm
-
Contact:
#1
Post
by Gianserpe » Thu Mar 18, 2021 6:40 pm
Hi everyone, I'm trying to change the font of a single word in a sentence. I tried to do such a thing
Code: Select all
image test_word = Text("[the_word]", what_font="Pixellari.ttf")
label start:
$ the_word = "Test_Word_Sentence"
"Verify that it works [the_word ]"
Only the font I set is not taken.Obviously I put the .ttf file in the game folder.
Can anyone help me?
-
parttimestorier
- Veteran
- Posts: 428
- Joined: Thu Feb 09, 2017 10:29 pm
- Completed: No Other Medicine, Well Met By Moonlight, RE:BURN, The Light at the End of the Ocean, Take A Hike!, Wizard School Woes
- Projects: Seeds of Dreams
- itch: janetitor
- Location: Canada
-
Contact:
#2
Post
by parttimestorier » Fri Mar 19, 2021 10:18 am
I believe that code might work if you wanted to treat that one word on its own like an image, and "show" it separate from the textbox. But if you want to change the font of part of your normal text, it's actually simpler than that. You should be able to just write something like, "Here's the text where the font changes for one {font=Pixellari.ttf}word{/font}."
-
Gianserpe
- Newbie
- Posts: 21
- Joined: Mon May 27, 2019 4:20 pm
-
Contact:
#3
Post
by Gianserpe » Fri Mar 19, 2021 6:26 pm
parttimestorier wrote: ↑Fri Mar 19, 2021 10:18 am
I believe that code might work if you wanted to treat that one word on its own like an image, and "show" it separate from the textbox. But if you want to change the font of part of your normal text, it's actually simpler than that. You should be able to just write something like, "Here's the text where the font changes for one {font=Pixellari.ttf}word{/font}."
It was what I had tried to do initially. however when that string is processed the game gives this error
Exeption: Unknown text tag u'font = font = Pixellari.ttf
This is the sentence I try to put
Code: Select all
"This is a test to see if it works {font = Pixellari.ttf} word font{/font}"
Did I do something wrong? I looked at the official guide and this method is the one reported
-
puppetbomb
- Regular
- Posts: 123
- Joined: Fri May 19, 2017 4:04 pm
- Tumblr: puppetbomb
- itch: puppetbomb
- Location: USA
-
Contact:
#4
Post
by puppetbomb » Fri Mar 19, 2021 6:32 pm
Would it be difficult to create a raster image of the word and insert it in the text string?
-
Gianserpe
- Newbie
- Posts: 21
- Joined: Mon May 27, 2019 4:20 pm
-
Contact:
#5
Post
by Gianserpe » Fri Mar 19, 2021 8:31 pm
puppetbomb wrote: ↑Fri Mar 19, 2021 6:32 pm
Would it be difficult to create a raster image of the word and insert it in the text string?
I found the error in the code, it was a matter of spaces. I got lost in a glass of water.
I wrote
Code: Select all
{font = Pixellari.ttf} word font{/font}"
Instead of
Code: Select all
{font=Pixellari.ttf} word font{/font}"
Thanks so much for taking the time
Users browsing this forum: No registered users