Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Writing Unicode characters in sf::Text  (Read 2810 times)

0 Members and 2 Guests are viewing this topic.

lowarago

  • Newbie
  • *
  • Posts: 10
    • View Profile
Writing Unicode characters in sf::Text
« on: April 17, 2017, 11:23:48 pm »
Hello, I want to be able to write all of this characters https://unicode-table.com/en/#latin-extended-a in my Text object.

I am having hard time and nothing is being successfull

What I've tried and doesn't work :

wchar_t c = L'\u2F00';

sf::Text my_text;
my_text.setString(c);
/*
... Rest of the setup for "my_text"
*/


 


When I draw it I just get a Square.

How to actually do this kind of stuff ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Writing Unicode characters in sf::Text
« Reply #1 on: April 18, 2017, 06:32:10 am »
Why 0x2F00 if the range you show us is from 0x0100 to 0x017F? Or maybe with "all of this characters" you mean the whole Unicode range?

Anyway, the most important thing is to load a font that actually contains the characters you want to draw. Is it the case?
Laurent Gomila - SFML developer

lowarago

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Writing Unicode characters in sf::Text
« Reply #2 on: April 18, 2017, 04:51:11 pm »
Yeah, whole range I mean. So, I should check out the table https://en.wikipedia.org/wiki/Unicode_font ? And download ones with high number of Chars and Glyphs right ?


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Writing Unicode characters in sf::Text
« Reply #3 on: April 18, 2017, 06:21:59 pm »
Just pick one that contains all the glyphs that you plan to use.
Laurent Gomila - SFML developer