Page 1 of 1

Text is not working with SleekSpace skin

Posted: Sat Mar 07, 2009 16:18
by leonardoalt
Hi there.
I am using AquaLook skin for my project, and it's working great.
I did a test today, using SleekSpace cuz i found it nice too, but the texts i have in my GUI do not appear.
The font used in AquaLook is loaded inside AquaLookSkin.scheme, and no C++ code is used to load it. But in SleekSpace, the file SleekSpace.scheme does not contain font informations, so i load the font inside my app:
CEGUI::FontManager::getSingleton().createFont("bluehighway-12.font"));
It didn't work. So i copy&paste the font infos from AquaLookSkin.scheme to SleekSpace.scheme:
<Font Name="BlueHighway-12" Filename="bluehighway-12.font" />

<Font Name="BlueHighway-10" Filename="bluehighway-10.font" />

<Font Name="BlueHighway-8" Filename="bluehighway-8.font" />

Does anybody know what's going on, or how can i fix it?

Thanks.

Posted: Sat Mar 07, 2009 17:43
by Jamarr
If you want to load fonts normally via xml .font files, you should look in the Samples/datafiles/fonts folder for an example xml file; update the file as needed, and then in your code do something like this:

Code: Select all

// load in a font. The first font loaded automatically becomes the default font.
if (!CEGUI::FontManager::getSingleton().isFontPresent("default"))
   CEGUI::FontManager::getSingleton().createFont("default.font");


If you want to load fonts directly, without needing to use an xml file, you can do something like this:

Code: Select all

// load in a font. The first font loaded automatically becomes the default font.
if (!CEGUI::FontManager::getSingleton().isFontPresent("default"))
{
   CEGUI::Font* font = CEGUI::FontManager::getSingleton().createFont(
      "FreeType", "default", "Verdana.ttf"
   );
   font->setProperty("AutoScaled", "False");
   font->setProperty("NativeRes", "w:1024 h:768");
   font->setProperty("Antialiased", "True");
   font->setProperty("PointSize", "14");
   font->load();
}


Note that either way your CEGUI::Font resource group should already be pointing to the directory you are trying to load the files from. I would also recommend placing try/catch blocks around the code where necessary.

Posted: Sun Mar 08, 2009 00:44
by leonardoalt
Thanks for reply.
I tried both ways, but it keeps not working.
Using the code way, it enters in the "if", it loads the font.. the code passes through it..
but the buttons' texts do not appear..

I think i'll keep using AquaLook skin.

Thanks for the help.

Posted: Sun Mar 08, 2009 09:39
by CrazyEddie
Hi,

Do you get any log errors at all?

Also, is the colour of the text an issue; with Aqua using lighter backgrounds and Sleekspace using darker backgrounds, perhaps your text is too dark to see?

CE.

Posted: Tue Mar 17, 2009 17:48
by LennyH
Have you tried using the name you specified in the scheme, instead of the file name?

IE, instead of

CEGUI::FontManager::getSingleton().createFont("bluehighway-12.font"));

try

CEGUI::FontManager::getSingleton().createFont("BlueHighway-12"));

I know, for instance, when using CEGUI::System::getSingleton().setDefaultFont you should use the name specified in the scheme, instead of the file name - I would expect or hope that to be consistent with createFont as well. But, you never know - never hurts to try.

edit: On second thought, maybe create font should use the file name - but, if you have the font in your scheme, you can use setDefaultFont with the name (not file name) you specified in the scheme, or use setFont on individual elements also using the name.

edit2: Also, make sure your font is where the scheme expects it. Your log will tell you if it isn't found - if that is the case, the fix is easy - find it :)

Re: Text is not working with SleekSpace skin

Posted: Fri Jul 27, 2012 01:35
by AnthonyS
Hi all,

I realise this thread is somewhat old now, but I'm having this same issue with the SleekSpace skin still.

These are the errors I get in the log file:

27/07/2012 11:27:58 (Error) CEGUI::UnknownObjectException in file ..\..\..\cegui\src\CEGUIPropertySet.cpp(109) : There is no Property named 'NormalTextColour' available in the set.
27/07/2012 11:27:59 (Error) CEGUI::UnknownObjectException in file ..\..\..\cegui\src\CEGUIPropertySet.cpp(109) : There is no Property named 'HoverTextColour' available in the set.
27/07/2012 11:28:00 (Error) CEGUI::UnknownObjectException in file ..\..\..\cegui\src\CEGUIPropertySet.cpp(109) : There is no Property named 'PushedTextColour' available in the set.
27/07/2012 11:28:00 (Error) CEGUI::UnknownObjectException in file ..\..\..\cegui\src\CEGUIPropertySet.cpp(109) : There is no Property named 'HoverTextColour' available in the set.
27/07/2012 11:28:00 (Error) CEGUI::UnknownObjectException in file ..\..\..\cegui\src\CEGUIPropertySet.cpp(109) : There is no Property named 'NormalTextColour' available in the set.

Is this easy to fix? If not, I'm happy enough to just move to a different skin...

Thanks muchly for any help, please excuse me if it's a noob question, I truly am a CEGUI noob atm :)

Cheers,
Anthony

Re: Text is not working with SleekSpace skin

Posted: Fri Jul 27, 2012 08:58
by CrazyEddie
Hi,

We would prefer people not to necro topics but to create a fresh topic (perhaps with a link to the ancient one), since so much can change in three years ;)

I have to state up front that SleekSpace is a community made skin and as such we offer no direct support for it, though of course we will try to assist where possible (i.e we will treat it as if you made the skin yourself, but will not be fixing or updating the skin at all).

You should have posted the entire log (and used code tags), since right now we have no idea which version of cegui you are using - IIRC sleek space is originally made for 0.5 / 0.6. You're most likely using 0.7, so there will be some other stuff you will need to update to get it working 100% correctly - especially related to window frames and such (note that this has nothing to do with the issue you're having right now... I'm coming to that...)

To fix the issue you're having, you'll need to edit the looknfeel xml for sleek space. I don't have the SleekSpace skin here to look at, but I'm guessing that these properties are mentioned in subelements of StateImagery blocks for the button types, but there are no PropertyDefinition elements for them (because these properties used to exist always, but now have to be defined in the WidgerLook xml). So the solution is likely to be to add a PropertyDefinition for each of those missing properties, as an example the NormalTextColour, might look like this:

Code: Select all

<PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />

This would go right at the top of the WidgetLook which is causing the issue (likely the button type(s)), and you'll need similar entries for the other missing colour properties.

HTH

CE.

Re: Text is not working with SleekSpace skin

Posted: Sun Jul 29, 2012 03:12
by AnthonyS
Hey,

Sorry for my numerous errors...

But thanks for the fix! worked perfectly :)

Cheers,
Anthony