SFML community forums

Help => General => Topic started by: dk123 on August 05, 2016, 07:02:07 am

Title: sf::Font::getGlyph getting the code point
Post by: dk123 on August 05, 2016, 07:02:07 am
Hi, I'm trying to get glyph information for certain characters within a string. sf::Font::getGlyph however seems to take a codepoint int as it's argument though, which I'm finding difficulty in finding. How can find the codepoint of a given character?

It would be nice if this was a default override of sf::Font::getGlyph if not already implemented.
Title: Re: sf::Font::getGlyph getting the code point
Post by: eXpl0it3r on August 05, 2016, 11:16:20 am
A code point is just the integer representation of a character. So you basically pass in a char, e.g. font.getGlyph(L'2', 10, false).

It would be nice if this was a default override of sf::Font::getGlyph if not already implemented.
What do you mean by "this" and what default override?
Title: Re: sf::Font::getGlyph getting the code point
Post by: dk123 on August 05, 2016, 03:22:57 pm
A code point is just the integer representation of a character. So you basically pass in a char, e.g. font.getGlyph(L'2', 10, false).

It would be nice if this was a default override of sf::Font::getGlyph if not already implemented.
What do you mean by "this" and what default override?

Thanks, that helps. I thought there might need to be some sort of conversion (indexing) between the char and the integer representation, which is why I mentioned that it might be nice to have an overloaded function for sf::Font::getGlyph that explicitly takes in a char_t or wchar_t.

Might be nice to add this to the class information to make things clearer.