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

Author Topic: Load TrueType Font From Resource?  (Read 1173 times)

0 Members and 1 Guest are viewing this topic.

lmsmi1

  • Newbie
  • *
  • Posts: 13
  • Console Obsession
    • View Profile
Load TrueType Font From Resource?
« on: June 26, 2013, 08:10:23 pm »
Is it possible to embed a TTF (TrueType Font) file in an application (resource file or direct embed) and then load the font from it? I'm looking for the most portable way to do this, but is it even possible?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Load TrueType Font From Resource?
« Reply #1 on: June 26, 2013, 09:07:20 pm »
Convert your file to an array of char embedded into a C++ header, then use Font::loadFromMemory to load it into a sf::Font.
Laurent Gomila - SFML developer

 

anything