#include <OgreFont.h>
Inheritance diagram for Ogre::Font:
Public Methods | |
Font (const String &name) | |
Constructor. | |
virtual | ~Font () |
void | setType (FontType ftype) |
Sets the type of font. | |
FontType | getType (void) const |
Gets the type of font. | |
void | setSource (const String &source) |
Sets the source of the font. | |
const String & | getSource (void) const |
Gets the source this font (either an image or a truetype font). | |
void | setTrueTypeSize (Real ttfSize) |
Sets the size of a truetype font (only required for FT_TRUETYPE). | |
void | setTrueTypeResolution (uint ttfResolution) |
Gets the resolution (dpi) of the font used to generate the texture (only required for FT_TRUETYPE). | |
Real | getTrueTypeSize (void) const |
Gets the point size of the font used to generate the texture. | |
uint | getTrueTypeResolution (void) const |
Gets the resolution (dpi) of the font used to generate the texture. | |
std::pair< uint, uint > | StrBBox (const String &text, Real char_height, RenderWindow &window) |
Returns the size in pixels of a box that could contain the whole string. | |
virtual void | load () |
See Resource. | |
virtual void | unload () |
See Resource. | |
void | getGlyphTexCoords (OgreChar id, Real &u1, Real &v1, Real &u2, Real &v2) const |
Returns the teture coordinates of the associated glyph. | |
void | setGlyphTexCoords (OgreChar id, Real u1, Real v1, Real u2, Real v2) |
Sets the texture coordinates of a glyph. | |
Real | getGlyphAspectRatio (OgreChar id) const |
Gets the aspect ratio (width / height) of this character. | |
void | setGlyphAspectRatio (OgreChar id, Real ratio) |
Sets the aspect ratio (width / height) of this character. | |
const Material * | getMaterial () const |
Gets the material generated for this font. | |
Material * | getMaterial () |
Gets the material generated for this 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. | |
bool | getAntialiasColour (void) const |
virtual size_t | getSize (void) const |
Retrieves info about the size of the resource. | |
virtual void | touch (void) |
'Touches' the resource to indicate it has been used. | |
time_t | getLastAccess (void) const |
Gets the last time the resource was 'touched'. | |
const String & | getName (void) const |
Gets resource name. | |
ResourceHandle | getHandle (void) const |
bool | isLoaded (void) const |
Returns true if the Resource has been loaded, false otherwise. | |
virtual void | destroy () |
A method to make the resource delete itself. | |
Protected Methods | |
void | createTextureFromFont (void) |
Internal method for loading from ttf. | |
Protected Attributes | |
FontType | mType |
The type of font. | |
String | mSource |
Source of the font (either an image name or a truetype font). | |
Real | mTtfSize |
Size of the truetype font, in points. | |
uint | mTtfResolution |
Resolution (dpi) of truetype font. | |
Real | mTexCoords_u1 [OGRE_NUM_GLYPHS] |
Start u coords. | |
Real | mTexCoords_u2 [OGRE_NUM_GLYPHS] |
End u coords. | |
Real | mTexCoords_v1 [OGRE_NUM_GLYPHS] |
Start v coords. | |
Real | mTexCoords_v2 [OGRE_NUM_GLYPHS] |
End v coords. | |
Real | mAspectRatio [OGRE_NUM_GLYPHS] |
Aspect ratio between x and y (width / height). | |
Material * | mpMaterial |
The material which is generated for this font. | |
bool | mAntialiasColour |
for TRUE_TYPE font only | |
String | mName |
ResourceHandle | mHandle |
bool | mIsLoaded |
time_t | mLastAccess |
size_t | mSize |
Definition at line 68 of file OgreFont.h.
|
Constructor.
Definition at line 52 of file OgreFont.cpp. References Ogre::FT_TRUETYPE, mAntialiasColour, Ogre::Resource::mName, mpMaterial, mSource, mTtfResolution, mTtfSize, and mType. |
|
Definition at line 66 of file OgreFont.cpp. |
|
Internal method for loading from ttf.
Definition at line 191 of file OgreFont.cpp. References Ogre::Pass::createTextureUnitState(), Except, Ogre::FO_LINEAR, Ogre::FO_NONE, Ogre::Technique::getPass(), Ogre::DataChunk::getPtr(), Ogre::DataChunk::getSize(), Ogre::Material::getTechnique(), Ogre::Image::loadRawData(), Ogre::Resource::mName, mpMaterial, mSource, mTtfResolution, mTtfSize, Ogre::PF_A8R8G8B8, Ogre::Real, setGlyphTexCoords(), Ogre::TextureUnitState::setTextureFiltering(), Ogre::TEX_TYPE_2D, Ogre::uchar, and Ogre::uint. Referenced by load(). |
|
A method to make the resource delete itself.
Definition at line 137 of file OgreResource.h. |
|
Definition at line 248 of file OgreFont.h. |
|
Gets the aspect ratio (width / height) of this character.
Definition at line 201 of file OgreFont.h. References OGRE_GLYPH_INDEX, OgreChar, and Ogre::Real. Referenced by Ogre::TextBoxGuiElement::processEvent(), Ogre::TTYGuiElement::setFontName(), StrBBox(), Ogre::TextAreaGuiElement::updateGeometry(), Ogre::TTYGuiElement::updateTextGeometry(), and Ogre::TTYGuiElement::updateWindowGeometry(). |
|
Returns the teture coordinates of the associated glyph.
Definition at line 176 of file OgreFont.h. References OGRE_GLYPH_INDEX, OgreChar, and Ogre::Real. Referenced by StrBBox(), Ogre::TextAreaGuiElement::updateGeometry(), and Ogre::TTYGuiElement::updateWindowGeometry(). |
|
Definition at line 120 of file OgreResource.h. References Ogre::ResourceHandle. Referenced by Ogre::Material::clone(), Ogre::BspLevel::loadQuake3Level(), and Ogre::ResourceManager::unload(). |
|
Gets the last time the resource was 'touched'.
Definition at line 108 of file OgreResource.h. |
|
Gets the material generated for this font.
Definition at line 228 of file OgreFont.h. |
|
Gets the material generated for this font.
Definition at line 220 of file OgreFont.h. Referenced by Ogre::TTYGuiElement::setFontName(), and Ogre::TextAreaGuiElement::setFontName(). |
|
|
Retrieves info about the size of the resource.
Definition at line 93 of file OgreResource.h. Referenced by Ogre::ResourceManager::unload(). |
|
Gets the source this font (either an image or a truetype font).
Definition at line 96 of file OgreFont.cpp. References mSource. |
|
Gets the resolution (dpi) of the font used to generate the texture.
Definition at line 106 of file OgreFont.cpp. References mTtfResolution, and Ogre::uint. |
|
Gets the point size of the font used to generate the texture.
Definition at line 101 of file OgreFont.cpp. References mTtfSize, and Ogre::Real. |
|
Gets the type of font.
Definition at line 76 of file OgreFont.cpp. References Ogre::FontType, and mType. |
|
Returns true if the Resource has been loaded, false otherwise.
Definition at line 127 of file OgreResource.h. Referenced by Ogre::GpuProgramUsage::_load(), Ogre::SceneManager::deriveShadowCasterPass(), Ogre::SceneManager::deriveShadowReceiverPass(), Ogre::Technique::isLoaded(), Ogre::D3D9Texture::load(), Ogre::D3D9Texture::unload(), and Ogre::D3D9Texture::~D3D9Texture(). |
|
See Resource.
Implements Ogre::Resource. Definition at line 139 of file OgreFont.cpp. References createTextureFromFont(), Ogre::Pass::createTextureUnitState(), Except, Ogre::FT_TRUETYPE, Ogre::Technique::getPass(), Ogre::Material::getTechnique(), Ogre::Pass::getTextureUnitState(), Ogre::Texture::hasAlpha(), Ogre::Resource::mIsLoaded, Ogre::Resource::mName, mpMaterial, mSource, mType, Ogre::SBT_ADD, Ogre::SBT_TRANSPARENT_ALPHA, Ogre::Material::setSceneBlending(), and Ogre::TextureUnitState::setTextureAddressingMode(). Referenced by Ogre::TTYGuiElement::setFontName(), and Ogre::TextAreaGuiElement::setFontName(). |
|
Sets whether or not the colour of this font is antialiased as it is generated from a true type font.
Definition at line 243 of file OgreFont.h. Referenced by Ogre::FontManager::parseAttribute(). |
|
Sets the aspect ratio (width / height) of this character.
Definition at line 211 of file OgreFont.h. References OGRE_GLYPH_INDEX, OgreChar, and Ogre::Real. |
|
Sets the texture coordinates of a glyph.
Definition at line 191 of file OgreFont.h. References OGRE_GLYPH_INDEX, OgreChar, and Ogre::Real. Referenced by createTextureFromFont(), and Ogre::FontManager::parseAttribute(). |
|
Sets the source of the font.
Definition at line 81 of file OgreFont.cpp. References mSource. Referenced by Ogre::FontManager::parseAttribute(). |
|
Gets the resolution (dpi) of the font used to generate the texture (only required for FT_TRUETYPE).
Definition at line 91 of file OgreFont.cpp. References mTtfResolution, and Ogre::uint. Referenced by Ogre::FontManager::parseAttribute(). |
|
Sets the size of a truetype font (only required for FT_TRUETYPE).
Definition at line 86 of file OgreFont.cpp. References mTtfSize, and Ogre::Real. Referenced by Ogre::FontManager::parseAttribute(). |
|
Sets the type of font. Must be set before loading. Definition at line 71 of file OgreFont.cpp. References Ogre::FontType, and mType. Referenced by Ogre::FontManager::parseAttribute(). |
|
Returns the size in pixels of a box that could contain the whole string.
Definition at line 111 of file OgreFont.cpp. References getGlyphAspectRatio(), getGlyphTexCoords(), Ogre::RenderWindow::getMetrics(), Ogre::Real, and Ogre::uint. |
|
'Touches' the resource to indicate it has been used.
Reimplemented in Ogre::Material. Definition at line 100 of file OgreResource.h. Referenced by Ogre::Mesh::clone(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), and Ogre::ResourceManager::load(). |
|
See Resource.
Reimplemented from Ogre::Resource. Definition at line 186 of file OgreFont.cpp. References Ogre::Resource::mIsLoaded. |
|
for TRUE_TYPE font only
Definition at line 99 of file OgreFont.h. Referenced by Font(). |
|
Aspect ratio between x and y (width / height).
Definition at line 93 of file OgreFont.h. |
|
Definition at line 57 of file OgreResource.h. Referenced by Ogre::ResourceManager::add(), Ogre::Material::clone(), Ogre::Material::copyDetailsTo(), and Ogre::Material::operator=(). |
|
|
Definition at line 59 of file OgreResource.h. Referenced by Ogre::Material::operator=(). |
|
|
The material which is generated for this font.
Definition at line 96 of file OgreFont.h. Referenced by createTextureFromFont(), Font(), and load(). |
|
Definition at line 60 of file OgreResource.h. Referenced by Ogre::D3D9Texture::_setFinalAttributes(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), Ogre::GLTexture::loadImages(), and Ogre::Material::operator=(). |
|
Source of the font (either an image name or a truetype font).
Definition at line 75 of file OgreFont.h. Referenced by createTextureFromFont(), Font(), getSource(), load(), and setSource(). |
|
Start u coords.
Definition at line 84 of file OgreFont.h. |
|
End u coords.
Definition at line 86 of file OgreFont.h. |
|
Start v coords.
Definition at line 88 of file OgreFont.h. |
|
End v coords.
Definition at line 90 of file OgreFont.h. |
|
Resolution (dpi) of truetype font.
Definition at line 80 of file OgreFont.h. Referenced by createTextureFromFont(), Font(), getTrueTypeResolution(), and setTrueTypeResolution(). |
|
Size of the truetype font, in points.
Definition at line 78 of file OgreFont.h. Referenced by createTextureFromFont(), Font(), getTrueTypeSize(), and setTrueTypeSize(). |
|
The type of font.
Definition at line 72 of file OgreFont.h. |
Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:26:09 2004