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);
88 String doGet(
const void* target)
const;
89 void doSet(
void* target,
const String& val);
95 String doGet(
const void* target)
const;
96 void doSet(
void* target,
const String& val);
102 String doGet(
const void* target)
const;
103 void doSet(
void* target,
const String& val);
138 : codePoint(id), uvRect(rect), aspectRatio(aspect)
164 void createTextureFromFont(
void);
167 virtual void loadImpl();
169 virtual void unloadImpl();
202 void setSource(
const String& source);
206 const String& getSource(
void)
const;
213 void setTrueTypeSize(
Real ttfSize);
218 void setTrueTypeResolution(
uint ttfResolution);
226 Real getTrueTypeSize(
void)
const;
231 uint getTrueTypeResolution(
void)
const;
241 int getTrueTypeMaxBearingY()
const;
252 CodePointMap::const_iterator i = mCodePointMap.find(
id);
253 if (i != mCodePointMap.end())
255 return i->second.uvRect;
259 static UVRect nullRect(0.0, 0.0, 0.0, 0.0);
273 CodePointMap::iterator i = mCodePointMap.find(
id);
274 if (i != mCodePointMap.end())
276 i->second.uvRect.left = u1;
277 i->second.uvRect.top = v1;
278 i->second.uvRect.right = u2;
279 i->second.uvRect.bottom = v2;
280 i->second.aspectRatio = textureAspect * (u2 - u1) / (v2 - v1);
284 mCodePointMap.insert(
285 CodePointMap::value_type(
id,
287 textureAspect * (u2 - u1) / (v2 - v1))));
294 CodePointMap::const_iterator i = mCodePointMap.find(
id);
295 if (i != mCodePointMap.end())
297 return i->second.aspectRatio;
311 CodePointMap::iterator i = mCodePointMap.find(
id);
312 if (i != mCodePointMap.end())
314 i->second.aspectRatio = ratio;
321 const GlyphInfo& getGlyphInfo(CodePoint
id)
const;
333 mCodePointRangeList.push_back(range);
340 mCodePointRangeList.clear();
347 return mCodePointRangeList;
378 mAntialiasColour = enabled;
386 return mAntialiasColour;
392 void loadResource(
Resource* resource);
425 if (pRep == static_cast<Font*>(r.
getPointer()))
443 assert(r.
isNull() &&
"RHS must be null if it has no mutex!");
FontType mType
The type of font.
float Real
Software floating point type.
size_t calculateSize(void) const
Calculate the size of a resource; this will only be called after 'load'.
FontPtr(const FontPtr &r)
const MaterialPtr & getMaterial()
Gets the material generated for this font, as a weak reference.
Loaded from an image created by an artist.
bool getAntialiasColour(void) const
Gets whether or not the colour of this font is antialiased as it is generated from a true type font...
void clearCodePointRanges()
Clear the list of code point ranges.
Command object for Font - see ParamCommand.
void setGlyphTexCoords(CodePoint id, Real u1, Real v1, Real u2, Real v2, Real textureAspect)
Sets the texture coordinates of a glyph.
GlyphInfo(CodePoint id, const UVRect &rect, Real aspect)
Class representing a font in the system.
int mTtfMaxBearingY
Max distance to baseline of this (truetype) font.
#define OGRE_MUTEX_CONDITIONAL(name)
FontType
Enumerates the types of Font usable in the engine.
const CodePointRangeList & getCodePointRangeList() const
Get a const reference to the list of code point ranges to be used to generate glyphs from a truetype ...
FontPtr & operator=(const ResourcePtr &r)
Operator used to convert a ResourcePtr to a FontPtr.
Information about the position and size of a glyph in a texture.
Interface describing a manual resource loader.
map< CodePoint, GlyphInfo >::type CodePointMap
Map from unicode code point to texture coordinates.
Real mTtfSize
Size of the truetype font, in points.
uint mTtfResolution
Resolution (dpi) of truetype font.
Command object for Font - see ParamCommand.
CodePointMap mCodePointMap
static CmdSource msSourceCmd
const UVRect & getGlyphTexCoords(CodePoint id) const
Returns the texture coordinates of the associated glyph.
Generated from a truetype (.ttf) font.
Command object for Font - see ParamCommand.
String mSource
Source of the font (either an image name or a truetype font)
CodePointRangeList mCodePointRangeList
Range of code points to generate glyphs for (truetype only)
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.
MaterialPtr mpMaterial
The material which is generated for this font.
Command object for Font - see ParamCommand.
TexturePtr mTexture
Texture pointer.
void setGlyphAspectRatio(CodePoint id, Real ratio)
Sets the aspect ratio (width / height) of this character.
Command object for Font - see ParamCommand.
Specialisation of SharedPtr to allow SharedPtr to be assigned to TexturePtr.
static CmdCodePoints msCodePointsCmd
static CmdResolution msResolutionCmd
Real getGlyphAspectRatio(CodePoint id) const
Gets the aspect ratio (width / height) of this character.
Abstract class representing a loadable resource (e.g.
unsigned long long int ResourceHandle
#define OGRE_LOCK_MUTEX(name)
Specialisation of SharedPtr to allow SharedPtr to be assigned to FontPtr.
const MaterialPtr & getMaterial() const
Gets the material generated for this font, as a weak reference.
std::pair< CodePoint, CodePoint > CodePointRange
A range of code points, inclusive on both ends.
Defines a generic resource handler.
unsigned int * useCountPointer() const
FontPtr(const ResourcePtr &r)
Reference-counted shared pointer, used for objects where implicit destruction is required.
Specialisation of SharedPtr to allow SharedPtr to be assigned to MaterialPtr.
bool mAntialiasColour
for TRUE_TYPE font only
vector< CodePointRange >::type CodePointRangeList
#define OGRE_COPY_AUTO_SHARED_MUTEX(from)
Abstract class which is command object which gets/sets parameters.
void setAntialiasColour(bool enabled)
Sets whether or not the colour of this font is antialiased as it is generated from a true type font...