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

Author Topic: sf::Font::getGlyph getting the code point  (Read 2423 times)

0 Members and 1 Guest are viewing this topic.

dk123

  • Newbie
  • *
  • Posts: 49
    • View Profile
sf::Font::getGlyph getting the code point
« 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: sf::Font::getGlyph getting the code point
« Reply #1 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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

dk123

  • Newbie
  • *
  • Posts: 49
    • View Profile
Re: sf::Font::getGlyph getting the code point
« Reply #2 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.