Regular / bold text

Started by robvleugel, 25 July 2013, 16:16:02

robvleugel



As you can see the right text appears bold while the left text is not, any idea what might be causing this?


    m_gui.setGlobalFont("Fonts\\Cousine-Regular-Latin.ttf");

    //buttonQuit
    m_buttonQuit.init(m_gui);
    m_buttonQuit->load(m_config.guiTheme);
    m_buttonQuit->setSize(100, 30);
    m_buttonQuit->setPosition(900, 730);
    m_buttonQuit->setText("Quit");

    //buttonMenu
    m_buttonMenu.init(m_gui);
    m_buttonMenu->load(m_config.guiTheme);
    m_buttonMenu->setSize(100, 30);
    m_buttonMenu->setPosition(24, 730);
    m_buttonMenu->setText("Menu");



texus

You don't set a text size, which means the button is allowed to choose the best fitting size.
It probably takes a different size for the words menu and quit (although I would expect menu to have a slightly larger size).

Try giving both buttons a fixed size with setTextSize (you can use getTextSize in your code to find out the size that it is currently using).

robvleugel

That was indeed the problem, thanks