1
General / Font problems
« on: September 18, 2015, 02:02:30 am »
sf::RenderWindow window(sf::VideoMode(800, 600), "CALENDAR");
sf::Font font;
if (!font.loadFromFile("arial.ttf"))
std::cout << "no\n";
sf::Text text1;
text1.setFont(font);
text1.setCharacterSize(30);
text1.setColor(sf::Color::Black);
text1.setStyle(sf::Text::Regular);
text1.setString("ttestst");
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (event.type){
case sf::Event::Closed:
window.close();
}
}
window.clear(sf::Color::White);
window.draw(text1);
window.display();
}
I'm pretty sure this should work, but for whatever reason, it doesn't import the font correctly, can anyone help?
sf::Font font;
if (!font.loadFromFile("arial.ttf"))
std::cout << "no\n";
sf::Text text1;
text1.setFont(font);
text1.setCharacterSize(30);
text1.setColor(sf::Color::Black);
text1.setStyle(sf::Text::Regular);
text1.setString("ttestst");
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (event.type){
case sf::Event::Closed:
window.close();
}
}
window.clear(sf::Color::White);
window.draw(text1);
window.display();
}
I'm pretty sure this should work, but for whatever reason, it doesn't import the font correctly, can anyone help?