SFML community forums

Help => General => Topic started by: lowarago on April 17, 2017, 11:23:48 pm

Title: Writing Unicode characters in sf::Text
Post by: lowarago 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 ?
Title: Re: Writing Unicode characters in sf::Text
Post by: Laurent 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?
Title: Re: Writing Unicode characters in sf::Text
Post by: lowarago 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 ?

Title: Re: Writing Unicode characters in sf::Text
Post by: Laurent on April 18, 2017, 06:21:59 pm
Just pick one that contains all the glyphs that you plan to use.