How to insert a non-breaking space?

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
User avatar
Reikun
Miko-Class Veteran
Posts: 565
Joined: Tue Dec 20, 2011 9:57 pm
Completed: Mnemonic Devices, Ciikos Bridge, Helena's Flowers, The Madness
Projects: Fox in the Hollyhocks
Organization: skyharborr
itch: skyharborr
Contact:

How to insert a non-breaking space?

#1 Post by Reikun »

Hi, I have a character whose name has a space in it ("De Clercq"), but I'd like to keep the name together when it's displayed in narration/dialogue.

For example, after a long line it gets displayed like:

Code: Select all

We followed the cat around the neighborhood, but had to stop because De
Clercq called us to come home.
I want it to display like:

Code: Select all

We followed the cat around the neighborhood, but had to stop because
De Clercq called us to come home.
Is there an escape character or a text tag for non-breaking space?
ImageImageImage

fastest way to contact me: DM @skyharborr on twitter

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: How to insert a non-breaking space?

#2 Post by m_from_space »

You have to use a "non-breaking space" character instead of the space. I don't think Renpy supports a no-break text-tag.

Try using unicode symbol U+00A0. It works for me, but depends on the font you are using. Sometimes a weird character might appear.

Code: Select all

$ name = "De\u00A0Clercq"

User avatar
Reikun
Miko-Class Veteran
Posts: 565
Joined: Tue Dec 20, 2011 9:57 pm
Completed: Mnemonic Devices, Ciikos Bridge, Helena's Flowers, The Madness
Projects: Fox in the Hollyhocks
Organization: skyharborr
itch: skyharborr
Contact:

Re: How to insert a non-breaking space?

#3 Post by Reikun »

Thank you! This worked perfectly.
ImageImageImage

fastest way to contact me: DM @skyharborr on twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot], Milkymalk