A couple questions:fonts & boost
Posted: Wed Aug 11, 2004 13:49
I've got a couple of questions that hopefully someone can help me out with:
1) I am trying to make a new font to use with my app, but when I use it on gui elements I get nothing, literally, no text shows up. If I replace a line in the .xml file and use the tahoma font I get my text as expected. Here is what I've done to setup the new font:
created a .xml file (dragonmaster-18.xml) based on the Tahoma-14.xml file:
Created a new scheme .xml file (battlesscheme.xml) based on the demoscheme file but with the new font added:
I have created a static text object in an .xml file using this font:
I don't seem to understand why this won't work. However I know I may not be setting all the properties correctly for the font. How can I tell the native resolution of a font? I didn't create it and I don't see an obvious way to find out. Am I missing something else?
2) Boost question: I am trying to setup events for my gui and I have created a function called handleNew which takes a const CEGUI::EventArgs& e as its only argument. When I try to bind an event subscription to the event with boost::bind, I get a linking error. I thought I followed the demo, but I'm not having any luck. Of course I can take out the _1 argument and remove the arg from the function and it works (except I don't get the event information). I know this isn't a boost forum, but the boost forum has been less than helpful.
Sorry for the long winded post, and thanks in advance.
1) I am trying to make a new font to use with my app, but when I use it on gui elements I get nothing, literally, no text shows up. If I replace a line in the .xml file and use the tahoma font I get my text as expected. Here is what I've done to setup the new font:
created a .xml file (dragonmaster-18.xml) based on the Tahoma-14.xml file:
Code: Select all
<?xml version="1.0" ?>
<Font Name="DragonMaster-18" Filename="DragonMaster.ttf" Type="Dynamic" Size="18" AutoScaled="true"/>
Created a new scheme .xml file (battlesscheme.xml) based on the demoscheme file but with the new font added:
Code: Select all
<?xml version="1.0" ?>
<GUIScheme Name="BattlesScheme">
<Imageset Name="TaharezImagery" Filename="TaharezImageset.xml" />
<Imageset Name="OgreGuiImagery" Filename="ogregui.xml" />
<Font Name="Tahoma-14" Filename="tahoma-14.xml" />
<Font Name="Tahoma-8" Filename="tahoma-8.xml" />
<Font Name="DragonMaster-18" Filename="dragonmaster-18.xml" />
<WindowSet Filename="Taharez Look.dll">
<WindowFactory Name="Taharez Frame Window" />
<WindowFactory Name="Taharez Titlebar" />
.... etc.
I have created a static text object in an .xml file using this font:
Code: Select all
<?xml version="1.0" ?>
<GUILayout>
<Window Type="DefaultGUISheet" Name="Progress">
<Property Name="Position" Value="x:0.35 y:0" />
<Property Name="RelativeMaxSize" Value="w:.3 h:1" />
<Property Name="Size" Value="w:1 h:1" />
<Property Name="Visible" Value="false" />
<Window Type="Taharez StaticText" Name="Progress/Text">
<Property Name="Position" Value="x:0 y:0.65" />
<Property Name="FrameEnabled" Value="False" />
<Property Name="BackgroundEnabled" Value="False" />
<Property Name="Font" Value="DragonMaster-18" />
<Property Name="Size" Value="w:1 h:0.25" />
<Property Name="TextColours" Value="tl:FF7CFC00 tr:FF7CFC00 bl:FF48D1CC br:FF48D1CC" />
<Property Name="HorzFormatting" Value="HorzCentred" />
<Property Name="Text" Value="Loading..." />
</Window>
<Window Type="Taharez AltProgressBar" Name="Progress/Bar">
<Property Name="Position" Value="x:0 y:0.8" />
<Property Name="RelativeMaxSize" Value="w:1 h:0.07" />
<Property Name="Size" Value="w:1 h:1" />
<Property Name="StepSize" Value="0.1" />
</Window>
</Window>
</GUILayout>
I don't seem to understand why this won't work. However I know I may not be setting all the properties correctly for the font. How can I tell the native resolution of a font? I didn't create it and I don't see an obvious way to find out. Am I missing something else?
2) Boost question: I am trying to setup events for my gui and I have created a function called handleNew which takes a const CEGUI::EventArgs& e as its only argument. When I try to bind an event subscription to the event with boost::bind, I get a linking error. I thought I followed the demo, but I'm not having any luck. Of course I can take out the _1 argument and remove the arg from the function and it works (except I don't get the event information). I know this isn't a boost forum, but the boost forum has been less than helpful.
Code: Select all
WindowManager::getSingleton().getWindow((utf8*)"MainMenu/New")->
subscribeEvent(PushButton::Clicked, boost::bind(&MenuMode::handleNew, this, _1));
Sorry for the long winded post, and thanks in advance.