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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - krvju

Pages: [1]
1
Graphics / [solved] Issues drawing characters outside ASCII char set
« on: July 18, 2024, 12:40:18 am »
Hello, I am having issues printing non-ASCII characters on Windows.

    //i have also tried wide strings and u8 encoded strings
    sf::String str= sf::String("привет");
    std::cout << str.toAnsiString() << std::endl; //outputs "привет" to console
    sf::Text text_block = sf::Text(str, font, 48);
    window.draw(text_block);
 

I have tried the font.hasGlyph() function too, but I am not sure if I am using it correctly :)))
It does not exit the program here so the characters should exist in the font file
    //cyrillic п character in utf-32 bytecode
    sf::Uint32 cyrillic_p = 0x0000043f;
    if (!font.hasGlyph(sf::Uint32(cyrillic_p))) {
        std::cerr << "font error" << std::endl;
        exit(1);
    }
 

In the attached image I am using the Arial system font which should have the cyrillic alphabet in it. I have also tried it with three other system fonts and three downloaded fonts with the same results.

Pages: [1]