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

Author Topic: Font help  (Read 2450 times)

0 Members and 1 Guest are viewing this topic.

Xyro

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Font help
« on: August 31, 2009, 04:55:28 pm »
Im trying to create my own font, but since I added the font part it gives me this error :

1>sfml.obj : error LNK2001: unresolved external symbol "private: static unsigned int * sf::Font::ourDefaultCharset" (?ourDefaultCharset@Font@sf@@0PAIA)

Code

Code: [Select]

#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>  
#include <iostream>
 
class Debug    
{    
private:    
    sf::RenderWindow& Render;  
    sf::String Text;  
    sf::Font IDK;

public:    
    Debug(sf::RenderWindow& app);    
    void Draw();  
};  
   
Debug::Debug(sf::RenderWindow& app) : Render(app)  
{  
if (!IDK.LoadFromFile("arial.ttf"))
{
std::cout<<"Cannot load font !";
}

    Text.SetText("FPS :");    
    Text.SetFont(sf::Font::GetDefaultFont());    
    Text.SetSize(10);    
    Text.SetPosition(5.f, 5.f);  
Text.SetColor(sf::Color(0,0,0,255));
}    
   
void Debug::Draw()  
{  
    Render.Draw(Text);    
}


This code is called by a sfml.cpp

the IDK part is cause I thought it may had to do something with the name.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Font help
« Reply #1 on: August 31, 2009, 05:02:49 pm »
Did you define SFML_DYNAMIC?
Laurent Gomila - SFML developer

Xyro

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Font help
« Reply #2 on: August 31, 2009, 05:10:40 pm »
Quote from: "Laurent"
Did you define SFML_DYNAMIC?


Uhmmm, No ?

Also I calculated the fps and rounded it, how would I convert+add it to the string.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Font help
« Reply #3 on: August 31, 2009, 05:23:04 pm »
Quote
Uhmmm, No ?

This is explained in the "getting started" tutorial.

Quote
Also I calculated the fps and rounded it, how would I convert+add it to the string.

Badic string manipulations are well explained if you search 2 seconds on Google ;)
Laurent Gomila - SFML developer