74 String doGet(
const void* target)
const;
75 void doSet(
void* target,
const String& val);
81 String doGet(
const void* target)
const;
82 void doSet(
void* target,
const String& val);
87 String doGet(
const void* target)
const;
88 void doSet(
void* target,
const String& val);
94 String doGet(
const void* target)
const;
95 void doSet(
void* target,
const String& val);
101 String doGet(
const void* target)
const;
102 void doSet(
void* target,
const String& val);
108 String doGet(
const void* target)
const;
109 void doSet(
void* target,
const String& val);
149 : codePoint(id), uvRect(rect), aspectRatio(aspect)
175 void createTextureFromFont(
void);
178 virtual void loadImpl();
180 virtual void unloadImpl();
213 void setSource(
const String& source);
217 const String& getSource(
void)
const;
224 void setCharacterSpacer(
uint charSpacer);
231 uint getCharacterSpacer(
void)
const;
238 void setTrueTypeSize(
Real ttfSize);
243 void setTrueTypeResolution(
uint ttfResolution);
251 Real getTrueTypeSize(
void)
const;
256 uint getTrueTypeResolution(
void)
const;
266 int getTrueTypeMaxBearingY()
const;
277 CodePointMap::const_iterator i = mCodePointMap.find(
id);
278 if (i != mCodePointMap.end())
280 return i->second.uvRect;
284 static UVRect nullRect(0.0, 0.0, 0.0, 0.0);
298 CodePointMap::iterator i = mCodePointMap.find(
id);
299 if (i != mCodePointMap.end())
301 i->second.uvRect.left = u1;
302 i->second.uvRect.top = v1;
303 i->second.uvRect.right = u2;
304 i->second.uvRect.bottom = v2;
305 i->second.aspectRatio = textureAspect * (u2 - u1) / (v2 - v1);
309 mCodePointMap.insert(
310 CodePointMap::value_type(
id,
312 textureAspect * (u2 - u1) / (v2 - v1))));
319 CodePointMap::const_iterator i = mCodePointMap.find(
id);
320 if (i != mCodePointMap.end())
322 return i->second.aspectRatio;
336 CodePointMap::iterator i = mCodePointMap.find(
id);
337 if (i != mCodePointMap.end())
339 i->second.aspectRatio = ratio;
346 const GlyphInfo& getGlyphInfo(CodePoint
id)
const;
358 mCodePointRangeList.push_back(range);
365 mCodePointRangeList.clear();
372 return mCodePointRangeList;
403 mAntialiasColour = enabled;
411 return mAntialiasColour;
417 void loadResource(
Resource* resource);
void setGlyphTexCoords(CodePoint id, Real u1, Real v1, Real u2, Real v2, Real textureAspect)
Sets the texture coordinates of a glyph.
const MaterialPtr & getMaterial() const
Gets the material generated for this font, as a weak reference.
Loaded from an image created by an artist.
int mTtfMaxBearingY
Max distance to baseline of this (truetype) font.
static CmdResolution msResolutionCmd
void clearCodePointRanges()
Clear the list of code point ranges.
bool mAntialiasColour
for TRUE_TYPE font only
const MaterialPtr & getMaterial()
Gets the material generated for this font, as a weak reference.
Information about the position and size of a glyph in a texture.
vector< CodePointRange >::type CodePointRangeList
Real mTtfSize
Size of the truetype font, in points.
String mSource
Source of the font (either an image name or a truetype font)
float Real
Software floating point type.
uint mCharacterSpacer
Add a gap between letters vertically and horizonally prevents nasty artifacts caused by fonts atypica...
Real getGlyphAspectRatio(CodePoint id) const
Gets the aspect ratio (width / height) of this character.
#define _OgreOverlayExport
Abstract class representing a loadable resource (e.g.
CodePointMap mCodePointMap
Interface describing a manual resource loader.
unsigned long long int ResourceHandle
map< CodePoint, GlyphInfo >::type CodePointMap
Map from unicode code point to texture coordinates.
uint mTtfResolution
Resolution (dpi) of truetype font.
FontType mType
The type of font.
void setGlyphAspectRatio(CodePoint id, Real ratio)
Sets the aspect ratio (width / height) of this character.
Command object for Font - see ParamCommand.
FontType
Enumerates the types of Font usable in the engine.
std::pair< CodePoint, CodePoint > CodePointRange
A range of code points, inclusive on both ends.
Generated from a truetype (.ttf) font.
void setAntialiasColour(bool enabled)
Sets whether or not the colour of this font is antialiased as it is generated from a true type font...
GlyphInfo(CodePoint id, const UVRect &rect, Real aspect)
void addCodePointRange(const CodePointRange &range)
Adds a range of code points to the list of code point ranges to generate glyphs for, if this is a truetype based font.
CodePointRangeList mCodePointRangeList
Range of code points to generate glyphs for (truetype only)
TexturePtr mTexture
Texture pointer.
Command object for Font - see ParamCommand.
static CmdSource msSourceCmd
bool getAntialiasColour(void) const
Gets whether or not the colour of this font is antialiased as it is generated from a true type font...
Defines a generic resource handler.
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...
Command object for Font - see ParamCommand.
const UVRect & getGlyphTexCoords(CodePoint id) const
Returns the texture coordinates of the associated glyph.
static CmdCharSpacer msCharacterSpacerCmd
Command object for Font - see ParamCommand.
size_t calculateSize(void) const
Calculate the size of a resource; this will only be called after 'load'.
const CodePointRangeList & getCodePointRangeList() const
Get a const reference to the list of code point ranges to be used to generate glyphs from a truetype ...
Command object for Font - see ParamCommand.
Abstract class which is command object which gets/sets parameters.
MaterialPtr mMaterial
The material which is generated for this font.
Class representing a font in the system.
static CmdCodePoints msCodePointsCmd