xoreos
0.0.5
|
#include <ttf.h>
Public Member Functions | |
TTFRenderer (Common::SeekableReadStream &ttfFile, int height) | |
Create a TTF renderer with this TTF in the specified line height in pixels. More... | |
~TTFRenderer () | |
int | getHeight () const |
Return the height of a character in pixels. More... | |
int | getMaxWidth () const |
Return the max width of a character in pixels. More... | |
bool | hasChar (uint32 ch) const |
Does the font have the specified character? More... | |
int | getCharWidth (uint32 ch) const |
Return the width of a specific character in pixels. More... | |
void | drawCharacter (uint32 ch, Surface &surface, int x, int y) |
Draw a specific character onto a BGRA surface. More... | |
Private Member Functions | |
void | getFaceMetrics (int &advance, int &yOffset, int &xMin) const |
Private Attributes | |
FT_Library | _library |
FT_Face | _face |
Common::ScopedArray< byte > | _fileBuffer |
int | _width |
int | _height |
int | _ascent |
int | _descent |
Graphics::TTFRenderer::TTFRenderer | ( | Common::SeekableReadStream & | ttfFile, |
int | height | ||
) |
Create a TTF renderer with this TTF in the specified line height in pixels.
Definition at line 48 of file ttf.cpp.
References _ascent, _descent, _face, _fileBuffer, _height, _library, _width, Common::ScopedPtrBase< T, Deallocator >::get(), Common::kReadError, Common::ReadStream::read(), Common::ScopedPtrBase< T, Deallocator >::reset(), and Common::SeekableReadStream::size().
Graphics::TTFRenderer::~TTFRenderer | ( | ) |
Draw a specific character onto a BGRA surface.
Definition at line 134 of file ttf.cpp.
References _face, error(), Graphics::Surface::getData(), getFaceMetrics(), Graphics::Surface::getHeight(), and Graphics::Surface::getWidth().
int Graphics::TTFRenderer::getCharWidth | ( | uint32 | ch | ) | const |
Return the width of a specific character in pixels.
Definition at line 119 of file ttf.cpp.
References _face, error(), and getFaceMetrics().
|
private |
Definition at line 107 of file ttf.cpp.
References _ascent, and _face.
Referenced by drawCharacter(), and getCharWidth().
int Graphics::TTFRenderer::getHeight | ( | ) | const |
int Graphics::TTFRenderer::getMaxWidth | ( | ) | const |
bool Graphics::TTFRenderer::hasChar | ( | uint32 | ch | ) | const |
|
private |
Definition at line 67 of file ttf.h.
Referenced by getFaceMetrics(), and TTFRenderer().
|
private |
Definition at line 67 of file ttf.h.
Referenced by TTFRenderer().
|
private |
Definition at line 62 of file ttf.h.
Referenced by drawCharacter(), getCharWidth(), getFaceMetrics(), hasChar(), TTFRenderer(), and ~TTFRenderer().
|
private |
Definition at line 64 of file ttf.h.
Referenced by TTFRenderer().
|
private |
Definition at line 66 of file ttf.h.
Referenced by getHeight(), and TTFRenderer().
|
private |
Definition at line 61 of file ttf.h.
Referenced by TTFRenderer(), and ~TTFRenderer().
|
private |
Definition at line 66 of file ttf.h.
Referenced by getMaxWidth(), and TTFRenderer().