1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice
  2. NOTICE: We will be applying a Xenforo update on Tuesday 25th of February. This means that from approximately 10:00 to 14:00 BST the forums will be offline (or possibly longer). Sorry for the inconvenience! Official Announcement here.

Add a specific character

Discussion in 'Programming' started by Valrad, Jan 22, 2020.

  1. Valrad

    Valrad Member

    Joined:
    Nov 20, 2019
    Posts:
    15
    Hello,

    I now am stuck about adding a specific character that is not in the ASCII table implemented in GMS2. I'm talking of █ (alt+219).

    Then I figured out that adding it to a font is the solution. But how can I keep an official font, and just add this character at the end?

    I looked at font_add_sprite, but it seems that it begins from nothing, and then that I need to create a whole new font to make it work
     
  2. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    7,449
    font_add_ext()?
     
  3. Valrad

    Valrad Member

    Joined:
    Nov 20, 2019
    Posts:
    15
    You mean font_add_sprite_ext()? I don't understand the difference with the other one
     
  4. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    4,214
    Upper half of ASCII is codepage-dependent, this means a lot of issues. (Backslash and Yen is the same symbol depending on which codepage you use, for instance) But all of those characters should have an unique unicode code point these days. Fonts already have unicode support in GMS2, the "unimplemented placeholder character" is added by default these days. The "add character range" button should let you type in the range, guess it from all the strings present in the project, or load a file and add all characters present in it. So save the character in a text file (in unicode format like UTF-8) and use the "from file" range option to load it.
     
  5. Valrad

    Valrad Member

    Joined:
    Nov 20, 2019
    Posts:
    15
    It worked out! Thanks alot!
     

Share This Page