Regular / bold text
« on: 25 July 2013, 16:16:02 »


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

Code: [Select]
    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

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Regular / bold text
« Reply #1 on: 25 July 2013, 16:56:37 »
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).

Re: Regular / bold text
« Reply #2 on: 25 July 2013, 18:55:33 »
That was indeed the problem, thanks