xoreos
0.0.5
|
An ABC/SBM font, as used by Jade Empire. More...
#include <abcfont.h>
Classes | |
struct | Char |
A font character. More... | |
Public Member Functions | |
ABCFont (const Common::UString &name) | |
~ABCFont () | |
float | getWidth (uint32 c) const |
Return the width of a character. More... | |
float | getHeight () const |
Return the height of a character. More... | |
void | draw (uint32 c) const |
Draw this character. More... | |
virtual void | renderBind (const glm::mat4 &transform) const |
Bind the font for rendering. More... | |
virtual void | render (uint32 c, float &x, float &y, float *rgba) const |
virtual void | renderUnbind () const |
Public Member Functions inherited from Graphics::Font | |
Font () | |
virtual | ~Font () |
virtual float | getLineSpacing () const |
Return the size of space between lines. More... | |
size_t | getLineCount (const Common::UString &text, float maxWidth=0.0f, float maxHeight=0.0f) const |
Return the number of lines this text spans. More... | |
float | getWidth (const Common::UString &text, float maxWidth=0.0f) const |
Return the width this string would take. More... | |
float | getHeight (const Common::UString &text, float maxWidth=0.0f, float maxHeight=0.0f) const |
Return the height this string would take. More... | |
float | getLineWidth (const Common::UString &text) const |
Return the width of this string. More... | |
virtual void | buildChars (const Common::UString &str) |
Build all necessary characters to display this string. More... | |
float | split (const Common::UString &line, std::vector< Common::UString > &lines, float maxWidth=0.0f, float maxHeight=0.0f, bool trim=true) const |
float | split (Common::UString &line, float maxWidth, float maxHeight=0.0f, bool trim=true) const |
float | split (const Common::UString &line, Common::UString &lines, float maxWidth, float maxHeight=0.0f, bool trim=true) const |
Private Member Functions | |
void | load (const Common::UString &name) |
void | readCharDesc (Char &c, Common::SeekableReadStream &abc) |
void | calcCharVertices (Char &c) |
const Char & | findChar (uint32 c) const |
Private Attributes | |
TextureHandle | _texture |
Mesh::MeshFont * | _mesh |
Shader::ShaderMaterial * | _material |
Shader::ShaderRenderable * | _renderable |
uint8 | _base |
Char | _invalid |
Char | _ascii [128] |
std::map< uint32, Char > | _extended |
Graphics::Aurora::ABCFont::ABCFont | ( | const Common::UString & | name | ) |
Definition at line 43 of file abcfont.cpp.
References _material, _mesh, _renderable, _texture, Graphics::Shader::ShaderMaterial::getVariableData(), Graphics::Shader::ShaderSampler::handle, load(), MeshMan, Graphics::Shader::SHADER_FRAGMENT, ShaderMan, SurfaceMan, and TextureMan.
Graphics::Aurora::ABCFont::~ABCFont | ( | ) |
Definition at line 56 of file abcfont.cpp.
References _material, and _renderable.
|
private |
Definition at line 210 of file abcfont.cpp.
References _texture, Graphics::Aurora::ABCFont::Char::dataX, Graphics::Aurora::ABCFont::Char::dataY, Graphics::Aurora::Texture::getHeight(), Graphics::Aurora::TextureHandle::getTexture(), Graphics::Aurora::Texture::getWidth(), Graphics::Aurora::ABCFont::Char::tX, Graphics::Aurora::ABCFont::Char::tY, Graphics::Aurora::ABCFont::Char::vX, Graphics::Aurora::ABCFont::Char::vY, and Graphics::Aurora::ABCFont::Char::width.
Referenced by load().
|
virtual |
Draw this character.
Implements Graphics::Font.
Definition at line 71 of file abcfont.cpp.
References _texture, findChar(), Graphics::Aurora::ABCFont::Char::spaceL, Graphics::Aurora::ABCFont::Char::spaceR, TextureMan, Graphics::Aurora::ABCFont::Char::tX, Graphics::Aurora::ABCFont::Char::tY, Graphics::Aurora::ABCFont::Char::vX, Graphics::Aurora::ABCFont::Char::vY, and Graphics::Aurora::ABCFont::Char::width.
|
private |
Definition at line 233 of file abcfont.cpp.
References _ascii, _extended, _invalid, and Common::UString::isASCII().
Referenced by draw(), getWidth(), and render().
|
virtual |
Return the height of a character.
Implements Graphics::Font.
Definition at line 61 of file abcfont.cpp.
|
virtual |
Return the width of a character.
Implements Graphics::Font.
Definition at line 65 of file abcfont.cpp.
References findChar(), Graphics::Aurora::ABCFont::Char::spaceL, Graphics::Aurora::ABCFont::Char::spaceR, and Graphics::Aurora::ABCFont::Char::width.
|
private |
Definition at line 129 of file abcfont.cpp.
References _ascii, _base, _extended, _invalid, Common::UString::c_str(), calcCharVertices(), Graphics::Aurora::ABCFont::Char::dataX, Graphics::Aurora::ABCFont::Char::dataY, Common::UString::fromUTF16(), Aurora::kFileTypeABC, readCharDesc(), ResMan, Graphics::Aurora::ABCFont::Char::spaceL, Graphics::Aurora::ABCFont::Char::spaceR, Graphics::Aurora::ABCFont::Char::tX, Graphics::Aurora::ABCFont::Char::tY, Graphics::Aurora::ABCFont::Char::vX, Graphics::Aurora::ABCFont::Char::vY, and Graphics::Aurora::ABCFont::Char::width.
Referenced by ABCFont().
|
private |
Definition at line 195 of file abcfont.cpp.
References Graphics::Aurora::ABCFont::Char::dataX, Graphics::Aurora::ABCFont::Char::dataY, Common::ReadStream::readByte(), Common::ReadStream::readUint32LE(), Graphics::Aurora::ABCFont::Char::spaceL, Graphics::Aurora::ABCFont::Char::spaceR, and Graphics::Aurora::ABCFont::Char::width.
Referenced by load().
|
virtual |
Reimplemented from Graphics::Font.
Definition at line 97 of file abcfont.cpp.
References _mesh, findChar(), Graphics::Mesh::MeshFont::render(), Graphics::Aurora::ABCFont::Char::spaceL, Graphics::Aurora::ABCFont::Char::spaceR, Graphics::Aurora::ABCFont::Char::tX, Graphics::Aurora::ABCFont::Char::tY, Graphics::Aurora::ABCFont::Char::vX, Graphics::Aurora::ABCFont::Char::vY, and Graphics::Aurora::ABCFont::Char::width.
|
virtual |
Bind the font for rendering.
Must be performed before render is called.
transform | Base modelview transform. Under most circumstances this is expected to be the identity matrix. |
Reimplemented from Graphics::Font.
Definition at line 88 of file abcfont.cpp.
References _material, _mesh, _renderable, Graphics::Shader::ShaderSurface::bindGLState(), Graphics::Shader::ShaderMaterial::bindGLState(), Graphics::Shader::ShaderSurface::bindProgram(), Graphics::Shader::ShaderMaterial::bindProgram(), Graphics::Shader::ShaderRenderable::getProgram(), Graphics::Shader::ShaderRenderable::getSurface(), Graphics::Shader::ShaderProgram::glid, and Graphics::Mesh::Mesh::renderBind().
|
virtual |
Reimplemented from Graphics::Font.
Definition at line 121 of file abcfont.cpp.
References _material, _mesh, _renderable, Graphics::Shader::ShaderRenderable::getSurface(), Graphics::Mesh::Mesh::renderUnbind(), Graphics::Shader::ShaderMaterial::unbindGLState(), and Graphics::Shader::ShaderSurface::unbindGLState().
|
private |
Definition at line 90 of file abcfont.h.
Referenced by findChar(), and load().
|
private |
Definition at line 91 of file abcfont.h.
Referenced by findChar(), and load().
|
private |
Definition at line 89 of file abcfont.h.
Referenced by findChar(), and load().
|
private |
Definition at line 84 of file abcfont.h.
Referenced by ABCFont(), renderBind(), renderUnbind(), and ~ABCFont().
|
private |
Definition at line 83 of file abcfont.h.
Referenced by ABCFont(), render(), renderBind(), and renderUnbind().
|
private |
Definition at line 85 of file abcfont.h.
Referenced by ABCFont(), renderBind(), renderUnbind(), and ~ABCFont().
|
private |
Definition at line 82 of file abcfont.h.
Referenced by ABCFont(), calcCharVertices(), and draw().