Planned new Font-API

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

Hanmac
Just popping in
Just popping in
Posts: 7
Joined: Thu Jul 07, 2011 19:45

Planned new Font-API

Postby Hanmac » Sun Jan 08, 2012 21:45

As you can read there an new Font-API is planned.

there is some of my ideas:
add bold and italic as variables to Font and maybe also underscore, strikethrough and
possible other font attributes.
And let the FontManager map name & fontFlags => real font path
to register some font i thought about something like this

Code: Select all

void setFontPath(const String& name, const String& filename, FontFlag flags)
const String& getFontPath(const String& name, FontFlag flags)


but remove the get font from name function from manager because fonts doent have a uniq name any more
(or make it that "abc_12i" is casted to font with registerd name abc, in font size 12 and italic)

PS: maybe remove native_horz_res from Font and try to check it dynamicly from System

currently it does not change many of the API you can still create a font with FontManager.createFreeTypeFont
it only get new create method

Code: Select all

FontManager.create(const String& name,const float size, FontFlag flags, const bool anti_aliased,const bool auto_scaled = false)


for Caching all the font sizes of a specific font, all Font* of the same font, shares a Font_impl* object that hold the cache.
maybe in from of a smart_ptr or that the Font* says to its Font_impl* that is going to be deleted.

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

Re: Planned new Font-API

Postby CrazyEddie » Tue Jan 10, 2012 12:14

Just a quick note to say that you can't discover a value for the "native resolution" from the system - even though the name of it suggests you can. When auto-scaling is enabled, the native resolution is the resolution at which images are drawn 1:1 (no additional scaling), when the resolution in use differs from the native resolution, images are scaled up or down so they appear the same physical size as they would have at the native res (so scaled down at lower resolutions and scaled up at higher resolutions). It is intended that native res be set by the developer or UI designer.

HTH

CE.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests