Change font default height from code

fantasian

21-07-2010 10:47:56

Is it possible to change a "ResourceManualFont"'s default height from code?

I need this because I want to support all kinds of different screen aspect ratios. To achieve this, I have to resize and reposition all widgets according to whether the Ogre window is in fullscreen mode or not. Currently, the only thing I can't change is the fonts' aspect ratio.

Thanks,

Bill

my.name

22-07-2010 09:21:10

1. change default font
2. reload all forms

fantasian

22-07-2010 09:26:51

The second part, I understand.

But how do I change the default font from code? I see no way to change the Default Font Height by code, either in ResourceManualFont or FontManager.

Thank you for your time,

Bill

my.name

22-07-2010 13:49:56

MyGUI::FontManager::getInstance().setDefaultFont("MyFontName");

fantasian

22-07-2010 18:16:35

MyGUI::FontManager::getInstance().setDefaultFont("MyFontName");
Sorry for yet another post, I suppose I am a bit dumb these days.

How would changing the default font would help in any way?

I have some buttons which use the font "Dots", e.g
<Widget type="Button" skin="Button" position_real="0.4 0.657292 0.2 0.116667" layer="Middle" name="NEXT">
<Property key="Text_FontName" value="Dots"/>
<Property key="Widget_Caption" value="#a0ffa0RETRY"/>
<Property key="Text_FontHeight" value="50"/>
<Property key="Text_TextColour" value="#a0ffa0"/>
</Widget>

where "Dots" is defined as
<Resource type="ResourceManualFont" name="Dots">
<Property key="Source" value="zfont.tga"/>
<Property key="DefaultHeight" value="70"/>
<Codes>
...

If I change the Default Font, that won't affect these buttons, right?

What I would like to do is change the "DefaultHeight" of the font "Dots", because when the screen aspect ratio changes, the font ratio doesn't automatically follow. Like I said, I can change by code the size of the buttons to match the mode's aspect ratio, but I can't change the aspect ratio of the fonts themselves, only their full size.

If that sounds confusing, I have provided the following 2 screenshots. If it's still confusing, I could elaborate more on the concept of full-screen mode & aspect ratios... :-)




Thank you a lot for your time,

Bill

my.name

23-07-2010 11:36:06

<Property key="DefaultHeight" value="70"/>
This value is not pixels.
This value is pt.

fantasian

23-07-2010 14:11:49

<Property key="DefaultHeight" value="70"/>
This value is not pixels.
This value is pt.

That doesn't matter. The hard fact is that, changing this value actually changes the aspect ratio of the fonts! It makes them wider or thinner!!

Can I change it in code in any way?