Scaled Font Support

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Scaled Font Support

Postby CrazyEddie » Fri Jan 07, 2005 09:56

I have a patch that enables the output from the fonts to be scaled; this has many uses as I'm sure you can imagine ;)

Currently, the patch has not had much in the way of testing and since it's quite a central part of the system, I'm reluctant to commit changes that could have adverse impact on peoples projects; so I'm posting here for two reasons:

1) To inform you that a change like this is coming.
2) To try and get some feedback.

You can find the patch for the changes HERE.

I'm hoping to do some more testing and profiling tomorrow (Saturday), with a mind to committing the changes on Sunday. So, all feedback before then is very welcomed :)

Thanks,

CE.

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Scaled Font Support

Postby spannerman » Fri Jan 07, 2005 13:05

I'll check this out tonight and get back to you.

User avatar
Debug
Just popping in
Just popping in
Posts: 7
Joined: Wed Jan 12, 2005 12:06
Contact:

Scaled Font Support

Postby Debug » Fri Jan 07, 2005 13:47

I need this feature as i use CEGUI dynamic fonts to handle the overhead names on entities in my game, i use a formula to scale the overhead health bar and name which results in a scale 0~1 needing to be applied to a font so this is in fact vital for me :)

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Scaled Font Support

Postby spannerman » Fri Jan 07, 2005 21:39

Ok, sorry for getting a bit OT here, but how the hell do you apply these patches? In the past I have done it by hand (when the patch is small enough and I can read what is going on) or usually just waited for CVS to synch up, but I want to try this out before it gets in CVS.

Im on windows and I use Tortoise CVS. Ive searched Sourceforge and Google, but I cant find the answer. Any tips or links please?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Scaled Font Support

Postby CrazyEddie » Sat Jan 08, 2005 09:18

I also use TortoiseCVS on Windows and never found out how to apply a patch using it, and eventually decidied it wasn't possible.

What I have though is a package of Unix/Linux commands that have been ported to Win32, which contains the 'patch' command and I just do:

Code: Select all

patch -p0 -i filename.patch

or similar, from within the cegui_mk2 directory.

If you want to take a similar approach, here's a link to something useful :)

CE.

User avatar
Debug
Just popping in
Just popping in
Posts: 7
Joined: Wed Jan 12, 2005 12:06
Contact:

Scaled Font Support

Postby Debug » Sat Jan 08, 2005 13:21

also you can use cygwin, then from within dos all the usual unix commands are avaiable including the bash shell and patch.

you can aquire cygwin here http://www.cygwin.com/

then like with the gnu tools just copy the patch file to your cegui_mk2 folder open a cmd prompt and type

cd /path/to/cegui_mk2

patch -p0 -i scaledfonts.patch

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Scaled Font Support

Postby spannerman » Sat Jan 08, 2005 16:23

Ok, thanks Eddie I got it patched :) Thats good, I know how to do it now for future.

@Debug, cheers, I think I tried the cygwin tools a while ago, but never got it working, although by what you say it sounds incredibly easy.
Strange how there is such little info or patch apps specifically for windows...they all seem to be ports from unix/linux.

Ok, Eddie its compiling fine, and hasnt made any adverse effects or difference to my CEGUI-intensive app. So how exactly do I use it and take advantage of the new scaling functionality? Do I need to call a 'drawText' method directly, passing in the new paramaters to change the width and height scale of a font when rendered on a widget?

User avatar
Debug
Just popping in
Just popping in
Posts: 7
Joined: Wed Jan 12, 2005 12:06
Contact:

Scaled Font Support

Postby Debug » Sat Jan 08, 2005 16:45

@spannerman

i use it with drawText after creating a dynamic font, although what i use it for is not part of an actual window i render the name of a character over the characters head and adjust scale with distance the character is from the camera, the actual scale formula is a normalised vector from the projection and a multiplier.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Scaled Font Support

Postby CrazyEddie » Sat Jan 08, 2005 16:50

Ok, Eddie its compiling fine, and hasnt made any adverse effects or difference to my CEGUI-intensive app.

This is good news, since that was my main worry ;)

So how exactly do I use it and take advantage of the new scaling functionality? Do I need to call a 'drawText' method directly, passing in the new paramaters to change the width and height scale of a font when rendered on a widget?

Yes, that's basically the current usage, or for direct-to-screen rendering as Debug is doing.

Once the functionality has been in a while I can imagine that there will be opportunities to extend the widgets to make use of the new ability. One thing I had in mind was a new "stretched" formatting option for text, whereby text would be scaled to fill the formatting area; but that's one for the future, I think.

In relation to your report about no adverse effects, I just finished up some profiling, and can report that while there is a very, very minor performance price, in the grand scheme of things this really adds up to zero.

At the moment I'm confident that the changes can be added to CVS without fear :D

CE.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest