Greetings,,
please have a look at my code and the attached screenshot
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(300, 200), "hello");
sf::Font mf;
mf.loadFromFile("KacstArt.ttf");
sf::Text text;
sf::String s(L"مرحبا"); // This suppose to be Arabic characters in here
text.setString(s);
//text.setFont(mf);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(text);
window.display();
}
return 0;
}
any ideas how to fix this
Thanks
[attachment deleted by admin]
So maybe if i include arabic characters inside a code tag it turns like that
Anyway thats what I wrote in the code
مرحبا
Let me try to but it in code tags
مرحبا
so if there is a way to take an array of indexes to the unicode table and we tell the Text class to render it.
it would be perfect for testing this.
You can write Unicode numbers directly into a string with the \uXXX notation:
text.setString(L"\uFEE1\uFEE3...");
But Arabic text is really complicated to render, and I don't think you'll get a perfect result (ie. all characters joined together) with SFML anyway.
I don't know how SFML is rendering it. and what library is using to do this task
SFML uses the FreeType library.