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

Author Topic: [Solved] Setting Font from Vector  (Read 1920 times)

0 Members and 1 Guest are viewing this topic.

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
[Solved] Setting Font from Vector
« on: January 08, 2011, 06:25:30 am »
Code: [Select]
sf::Font TwoForJuan;
for (int i = 0; i < rm.FontList.size(); i++)
{
    if (rm.FontList[i].first == "TwoForJuan.ttf"){}
        TwoForJuan.SetFont(rm.FontList[i].second);
}


I need to know how to set a text from a vector. The vector stored a pair of values. The first one is the file name (TwoForJuan.ttf in my case). The second stored the actual font.

It seems to me that there is no SetFont member in sf::Font. If anyone knows a way to perform this task help would be greatly appreciated.[/code]
-Wander

Terrydil

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
[Solved] Setting Font from Vector
« Reply #1 on: January 08, 2011, 07:33:09 am »
Are you looking for LoadFromFile and LoadFromMemory?

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
[Solved] Setting Font from Vector
« Reply #2 on: January 08, 2011, 07:37:16 am »
no. i got those used in my resource manage and then the font is saved in the vector. I need to set another sf::Font object outside of the resource manager to that font inside the vector.
-Wander

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[Solved] Setting Font from Vector
« Reply #3 on: January 08, 2011, 01:35:04 pm »
Code: [Select]
TwoForJuan = rm.FontList[i].second;
Laurent Gomila - SFML developer