Author Topic: Special characters in text  (Read 1250 times)

DementedKirby

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Special characters in text
« on: July 23, 2015, 04:01:14 am »
I don't know if this question was answered or not (used the search tool of the forum but to no avail  :-[), but how do I get special characters to appear in the text in dialogues? For example, directional arrows, the Link face, Hylian text, etc.

Thanks in advanced!

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1173
    • View Profile
Re: Special characters in text
« Reply #1 on: July 23, 2015, 09:02:32 am »
There are two ways:
1) Change the dialog script to display additional content. For example, ZSDX shows icons in some dialogs.
2) (easier) If you use a PNG font, put some special images instead of characters. For example, in https://github.com/christopho/solarus-alttp-pack/blob/master/data/fonts/alttp.png, characters { | } are actually replaced by Hylian characters.

DementedKirby

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Special characters in text
« Reply #2 on: July 23, 2015, 09:25:08 am »
Yeah, I'm using the .png you provided in the resources (thanks!) but how do I know which area in the image corresponds to which symbol on the keyboard? That way I can add arrows and the Link face to the font (and maybe some other things) and know what to input in order to see it in the dialogue box.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1173
    • View Profile
Re: Special characters in text
« Reply #3 on: July 23, 2015, 09:59:57 am »
Characters are ordered as in UTF-8 encoding. The first row is exactly ASCII characters and other rows are characters that use two bytes in UTF-8, like accented characters in French.

See the doc for more details: http://www.solarus-games.org/doc/latest/quest_fonts.html#quest_fonts_bitmap

See this other example with all normal characters present: https://github.com/christopho/solarus/blob/master/sample_quest/data/fonts/8_bit.png

DementedKirby

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Special characters in text
« Reply #4 on: July 23, 2015, 10:21:54 pm »
Thanks! That image helped a lot! I can see exactly where everything goes! Thanks!