Angle Brackets

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
OdysseusL
Posts: 5
Joined: February 14th, 2014, 5:18 pm

Angle Brackets

Post by OdysseusL »

Hello all:

I am adjusting the WML in War of the Dragon campaign to Wesnoth 1.10. I have a couple of questions for anyone who can help me.

The angle brackets in message text aren't properly recognized as text.

Code: Select all

[message]
id=wleader
message= _ "(sniff) <Snarl!> <Snap!> <Growl!>"
[/message]
Everything after (sniff) doesn't show up in the message box. Is there a workaround for this? I want to keep the angle brackets.

Also, is there a good way to make corner brackets that would be recognized by the game? For example,

Code: Select all

[message]
id=wleader
message= _ "「guttural growling」"
[/message]
But the game again doesn't recognize the corner brackets or anything inside them as text. They don't show up in the message box.
User avatar
iceiceice
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: Angle Brackets

Post by iceiceice »

This almost surely has to do with Pango: http://wiki.wesnoth.org/InterfaceActionsWML#Formatting

I think the right way to get <'s and >'s to show up is to use escape codes `<` and `>` for these, respectively, just like in HTML. I'm pretty sure I've actually done that before.

As for the corner boxes, I don't know what the right way to escape those is but I would guess that you could google for a comprehensive guide to escaping things in Pango and see what you find. It's also possible that for some reason you can't do this.

You could also try running wmllint on your campaign like the wiki suggests, and see what it does with these characters, if anything.
OdysseusL
Posts: 5
Joined: February 14th, 2014, 5:18 pm

Re: Angle Brackets

Post by OdysseusL »

That worked. Thanks.
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Angle Brackets

Post by Max »

how did you fix the string with the "corner brackets"? my guess would be that they show up just fine (that is if the font supports them) if you make sure your text-editor saves the file in utf-8 encoding.
OdysseusL
Posts: 5
Joined: February 14th, 2014, 5:18 pm

Re: Angle Brackets

Post by OdysseusL »

Code: Select all

[message]
id=wleader
message= _ "&#8968;guttural growling&#8971;"
[/message]
It might only show up on my laptop because I have the particular font installed. I can test this on a different computer at work after a few days.
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Angle Brackets

Post by Max »

my guess is still that your text editor didn't save the file in utf8 encoding. pango handles utf8 string just fine, otherwise languages that consist of multi-byte chars wouldn't work.
Post Reply