|
QGIS API Documentation 3.99.0-Master (d270888f95f)
|
Encapsulates a font texture atlas. More...
#include <qgsfonttextureatlasgenerator.h>
Public Member Functions | |
| QgsFontTextureAtlas () | |
| QgsFontTextureAtlas (const QgsFontTextureAtlas &other) | |
| ~QgsFontTextureAtlas () | |
| QSize | atlasSize () const |
| Returns the total size required for the atlas, i.e. | |
| int | count () const |
| Returns the number of textures in the atlas. | |
| int | graphemeCount (const QString &string) const |
| Returns the number of graphemes to render for a given string. | |
| bool | isValid () const |
Returns true if the atlas is valid. | |
| QgsFontTextureAtlas & | operator= (const QgsFontTextureAtlas &other) |
| QPoint | pixelOffsetForGrapheme (const QString &string, int graphemeIndex) const |
| Returns the pixel offset at which the texture for the matching grapheme should be placed. | |
| QRect | rect (const QString &grapheme) const |
| Returns the packed rectangle for the texture for the specified grapheme. | |
| QImage | renderAtlasTexture () const |
| Renders the combined texture atlas, containing all required characters. | |
| QImage | renderDebugTexture () const |
| Renders a debug texture. | |
| QRect | textureRectForGrapheme (const QString &string, int graphemeIndex) const |
| Returns the packed rectangle for the texture for the matching grapheme. | |
| int | totalWidth (const QString &string) const |
| Returns the total width (in pixels) required for a given string. | |
Friends | |
| class | QgsFontTextureAtlasGenerator |
Encapsulates a font texture atlas.
QgsFontTextureAtlas contains the packed texture atlas for a font, along with the associated text metrics for rendering.
See QgsFontTextureAtlasGenerator for a class which automatically creates texture atlases.
Definition at line 46 of file qgsfonttextureatlasgenerator.h.
|
default |
|
default |
|
default |
|
inline |
Returns the total size required for the atlas, i.e.
the total size for the texture.
Definition at line 64 of file qgsfonttextureatlasgenerator.h.
| int QgsFontTextureAtlas::count | ( | ) | const |
Returns the number of textures in the atlas.
Definition at line 79 of file qgsfonttextureatlasgenerator.cpp.
| int QgsFontTextureAtlas::graphemeCount | ( | const QString & | string | ) | const |
Returns the number of graphemes to render for a given string.
The string must match one of the strings passed to QgsFontTextureAtlasGenerator when creating the texture atlas.
Definition at line 93 of file qgsfonttextureatlasgenerator.cpp.
|
inline |
Returns true if the atlas is valid.
Definition at line 58 of file qgsfonttextureatlasgenerator.h.
|
default |
| QPoint QgsFontTextureAtlas::pixelOffsetForGrapheme | ( | const QString & | string, |
| int | graphemeIndex ) const |
Returns the pixel offset at which the texture for the matching grapheme should be placed.
The string must match one of the strings passed to QgsFontTextureAtlasGenerator when creating the texture atlas.
Definition at line 111 of file qgsfonttextureatlasgenerator.cpp.
| QRect QgsFontTextureAtlas::rect | ( | const QString & | grapheme | ) | const |
Returns the packed rectangle for the texture for the specified grapheme.
Definition at line 84 of file qgsfonttextureatlasgenerator.cpp.
| QImage QgsFontTextureAtlas::renderAtlasTexture | ( | ) | const |
Renders the combined texture atlas, containing all required characters.
Definition at line 139 of file qgsfonttextureatlasgenerator.cpp.
| QImage QgsFontTextureAtlas::renderDebugTexture | ( | ) | const |
Renders a debug texture.
The debug texture renders all packed character rectangles with a unique color, and can be used to visualize the solution.
Definition at line 158 of file qgsfonttextureatlasgenerator.cpp.
| QRect QgsFontTextureAtlas::textureRectForGrapheme | ( | const QString & | string, |
| int | graphemeIndex ) const |
Returns the packed rectangle for the texture for the matching grapheme.
The string must match one of the strings passed to QgsFontTextureAtlasGenerator when creating the texture atlas.
Definition at line 125 of file qgsfonttextureatlasgenerator.cpp.
| int QgsFontTextureAtlas::totalWidth | ( | const QString & | string | ) | const |
Returns the total width (in pixels) required for a given string.
The string must match one of the strings passed to QgsFontTextureAtlasGenerator when creating the texture atlas.
Definition at line 102 of file qgsfonttextureatlasgenerator.cpp.
|
friend |
Definition at line 179 of file qgsfonttextureatlasgenerator.h.