How to set the font in an IGUITab or IGUITabControl
How to set the font in an IGUITab or IGUITabControl
How is this done? I do not see a way to do so. Thanks.
Is there some reason that you didn't look to the implementation to find your answer? If you had looked, you would have seen the following code...
So it looks like the tab control gets the font from the gui skin. If you looked at the skin interface, you might notice the following method declarations...
Ideally the tab control would allow you to override the font, like you can for other controls. The changes would be trivial. If you wanted such an enhancement to be added, the quickest way is to write the change yourself and to post a patch here or to the tracker.
Travis
Code: Select all
490 void CGUITabControl::draw()
491 {
492 if (!IsVisible)
493 return;
494
495 IGUISkin* skin = Environment->getSkin();
496 if (!skin)
497 return;
498
499 IGUIFont* font = skin->getFont();
Code: Select all
44 //! returns the default font
45 virtual IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const;
46
47 //! sets a default font
48 virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT);
Travis
I understand all that, I was just curious if there was some obscure/more abstract way of setting the font that I could not find. Especially since merely setting the skin would apply it to any control without the ability to set an override font (an undesired effect).
Thanks.
This was in fact what I was looking for. I will add the enhancement in my own code, but I am not too familiar with the tracker, so if I can figure it out I will definitely add it.vitek wrote:Ideally the tab control would allow you to override the font, like you can for other controls.
Thanks.