sharp small fonts- how?

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
muhkuh
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Wed Jan 12, 2005 12:06

sharp small fonts- how?

Postby muhkuh » Wed Dec 15, 2004 13:12

Oh, great. It will be interesting to have a look at your code and compare it to the things I did. Strange thing that floor looses against simple casting. What compiler did you use?

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

sharp small fonts- how?

Postby CrazyEddie » Wed Dec 15, 2004 14:48

What compiler did you use?

MSVC 7.1.

I guess this could have been some strangeness caused by the profiler itself, but a per-line breakdown of the main Imageset::draw method showed the floorf version taking (IIRC) far longer than the casting alternative:

Quick example:
floorf: time = 194,567 over 71,377 iterations = 2.726 (approx.)
casting: time = 4,060 over 73,900 iterations = 0.055 (approx.)

so casting is almost 50 times faster :shock:

Something doesn't look right :lol: maybe I messed up, it was quite late when I did the profiling ;)

CE.

User avatar
muhkuh
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Wed Jan 12, 2005 12:06

sharp small fonts- how?

Postby muhkuh » Wed Dec 15, 2004 21:19

Checked this myself with similar results. The problem is that floor has no intrinsic from. My mistake. :roll:

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

sharp small fonts- how?

Postby gcarlton » Wed Dec 15, 2004 22:37

If you are feeling like profiling, I'd be curious how the more hardcore "skip the FPU switch" functions hold up:
http://ldesoras.free.fr/doc/articles/rounding_en.pdf

I recently switched from the standard (int)(x+0.5) to the asm on page 8. Apart from the fact that the int cast is just plain wrong for -ve numbers, the asm function is significantly faster.

The floor/ceil functions are also correct and faster as well, although in one of them he apparently renamed a variable in the declaration but not where it was used, so there's a typo in there to fix before it compiles.

Of course, its probably very Windows specific, but if you are using a macro anyway, there wouldn't be any harm in ifdefing it in there. Unless it starts hurting people, of course... :)

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

sharp small fonts- how?

Postby CrazyEddie » Thu Dec 16, 2004 19:07

Thanks for the link; I'll have a read tomorrow. I have been engaged in "other activities" today, so have not been here or looked at CEGUI ;)

"macro magic" is all very nice until it goes wrong - in general I err on the side of caution and try to keep such things to a minimum. Though you never know :)

CE.

User avatar
Pacome
Just popping in
Just popping in
Posts: 14
Joined: Fri Dec 02, 2005 11:54
Contact:

Re: sharp small fonts- how?

Postby Pacome » Sun Mar 19, 2006 01:03

CrazyEddie wrote: (...) other techniques should the need arise, and also to turn it off entirely (there's an option in CEGUIConfig.h for this).

Hello,

this is an old topic, but I have the same problem of sharpness with the latest version of CeGUI, and I would like to know what are the preprocessor definitions which allow modifying it ?

EDIT: Maybe I should explain a little bit more. I use CeGUI only with integer values, and not relative values, and I want all the GUIs and texts to be really sharp (because most of them are small and can not be blurred).
How can I use CeGUI totally configured with integer values ?

Thanks,

Pacôme

User avatar
Pacome
Just popping in
Just popping in
Posts: 14
Joined: Fri Dec 02, 2005 11:54
Contact:

Postby Pacome » Sun Mar 26, 2006 10:57

Any news about this ?


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 2 guests