Page 1 of 1

Planned new Font-API

Posted: Sun Jan 08, 2012 21:45
by Hanmac
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.

Re: Planned new Font-API

Posted: Tue Jan 10, 2012 12:14
by CrazyEddie
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.