[Solved] Inserting unique letters?

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:

[Solved] Inserting unique letters?

#1 Post by 017Bluefield »

Is there a way to insert unique letters such as é and ł into the script, such as in the gui.about section? I tried putting ł directly into the script earlier, but it messed with the formatting and turned into a different letter entirely.
Last edited by 017Bluefield on Fri May 04, 2018 2:13 am, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Inserting unique letters?

#2 Post by Imperf3kt »

Does the font you are using support the character/s?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

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: Inserting unique letters?

#3 Post by 017Bluefield »

Yes, Open Sans does support it.

One other thing, I tried putting it in a different spot and it worked, but when I tried to put it where I wanted it, it gave me the weird formatting at the beginning and ending of that line.

This is the first example, which didn't work:

Code: Select all

define gui.about = _("""\
Created by ***.

SFX from ***.
                     
Music:
\"***\" by *** Musiał.""")
Now here's the second, which did work:

Code: Select all

define gui.about = _("""\
Created by ***.
ł
SFX from ***.
                     
Music:
\"***\" by *** Musial.""")

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Inserting unique letters?

#4 Post by xavimat »

017Bluefield wrote: Sat Apr 14, 2018 1:13 am Yes, Open Sans does support it.

One other thing, I tried putting it in a different spot and it worked, but when I tried to put it where I wanted it, it gave me the weird formatting at the beginning and ending of that line.

This is the first example, which didn't work:

Code: Select all

define gui.about = _("""\
Created by ***.

SFX from ***.
                     
Music:
\"***\" by *** Musiał.""")
Now here's the second, which did work:

Code: Select all

define gui.about = _("""\
Created by ***.
ł
SFX from ***.
                     
Music:
\"***\" by *** Musial.""")
That's strange...
- Do you need to scape the quotes " when you are inside a triple-quoted block?
- Have you tried typographical quotes instead of straight ones? “”
- Why do you need the first backslash?
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

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: Inserting unique letters?

#5 Post by 017Bluefield »

  • First: I believe so?
  • Second: No, not yet
  • Third: I don't know, the first backslash was part of the gui.about code.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Inserting unique letters?

#6 Post by Imperf3kt »

You do not need to escape quotes within a triple quoted block, as far as I know. I never have and so far I've had no troubles (I make use of triple quotes a lot)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

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: Inserting unique letters?

#7 Post by 017Bluefield »

Tested getting rid of the first \ before the first line of text...

Code: Select all

define gui.about = _("""Created by ***.

SFX from ***.
                     
Music:
\"***\" by *** Musiał, for the game {i}***{/i}.""")
No dice.

BTW, the error adds \u to the start of the last line, and replaces ł with Å,. Yes, it replaces one unique character with a different character and a...comma?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Inserting unique letters?

#8 Post by Imperf3kt »

I may have been mistaken.
I am not able to check right now.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Inserting unique letters?

#9 Post by Remix »

Try:
# Upper case
\u0141
or
# Lower case
\u0142

Code: Select all

define gui.about = _("""\
Created by ***.

SFX from ***.
                     
Music:
"***" by *** Musia\u0142.""")
If that still outputs an odd looking character, open the font in Start->Windows Accessories->Character Map (or whatever on *nix/mac) and find the unicode character reference...
Frameworks & Scriptlets:

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Inserting unique letters?

#10 Post by Imperf3kt »

017Bluefield wrote: Thu May 03, 2018 3:15 am Tested getting rid of the first \ before the first line of text...

Code: Select all

define gui.about = _("""Created by ***.

SFX from ***.
                     
Music:
\"***\" by *** Musiał, for the game {i}***{/i}.""")
No dice.

BTW, the error adds \u to the start of the last line, and replaces ł with Å,. Yes, it replaces one unique character with a different character and a...comma?
I think it is because you are still escaping the quotes. Removing the escape characters works fine for me.

Code: Select all

define gui.about = _("""Created by ***.

SFX from ***.
                     
Music:
"***" by *** Musiał, for the game {i}***{/i}.""")
And a screenshot from in-game
Image

Leaving them in causes issues.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

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: Inserting unique letters?

#11 Post by 017Bluefield »

Imperf3kt wrote: Thu May 03, 2018 9:28 am ...
I think it is because you are still escaping the quotes. Removing the escape characters works fine for me.

Code: Select all

define gui.about = _("""Created by ***.

SFX from ***.
                     
Music:
"***" by *** Musiał, for the game {i}***{/i}.""")
And a screenshot from in-game
Image

Leaving them in causes issues.
Ohhhhhh, okay. Sorry, I was under the impression that \" \" was necessary. :oops:

Code: Select all

"***" by ...
So in future, just use " " in the triple quotes. Got it. Thanks.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Ocelot