Bitmap font. More...
#include "kzu_font_base.h"#include "kzu_font_common.h"#include <kanzi/core/cpp/vector.hpp>#include <kanzi/core/legacy/debug/kzs_error.hpp>#include <kanzi/core/legacy/kzs_types.hpp>Classes | |
| struct | KzuBitmapFont |
| Font structure for rendering text. More... | |
Namespaces | |
| kanzi | |
Typedefs | |
| typedef shared_ptr< ShaderProgram > | kanzi::ShaderProgramSharedPtr |
| Shader program shared pointer type. More... | |
| typedef shared_ptr< Texture > | kanzi::TextureSharedPtr |
| Texture shared pointer type. More... | |
Functions | |
| kzsError | kzuBitmapFontSystemCreate (const struct KzcMemoryManager *memoryManager, struct KzuBitmapFontSystem **out_bitmapSystem) |
| Creates a bitmap font system. More... | |
| kzsError | kzuBitmapFontSystemDelete (struct KzuBitmapFontSystem *bitmapSystem) |
| Deletes a bitmap font system. More... | |
| void | kzuBitmapFontSystemSetShader (struct KzuBitmapFontSystem *bitmapSystem, kanzi::ShaderProgramSharedPtr shader) |
| Sets shader for bitmap font system. More... | |
| kzsError | kzuBitmapFontCreate (struct KzuBitmapFontSystem *bitmapSystem, kanzi::Domain *domain, kzString name, struct KzuBitmapFont **out_bitmapFont) |
| Creates new font without any data. More... | |
| kzsError | kzuBitmapFontCreateFromFile (struct KzuBitmapFontSystem *bitmapSystem, kanzi::Domain *domain, kzString filePath, struct KzuBitmapFont **out_bitmapFont) |
| Creates new font from file. More... | |
| kzsError | kzuBitmapFontCreateFromResource (struct KzuBitmapFontSystem *bitmapSystem, kanzi::Domain *domain, kzString resourcePath, struct KzuBitmapFont **out_bitmapFont) |
| Creates new font from resource. More... | |
| KANZI_API kzsError | kzuBitmapFontCreateFromMemory (struct KzuBitmapFontSystem *bitmapSystem, kanzi::Domain *domain, kzString fntFileContent, kzString name, struct KzuBitmapFont **out_bitmapFont) |
| Creates new font from preloaded resources. More... | |
| kzsError | kzuBitmapFontLoadFromKZB (struct KzuBitmapFont *bitmapFont, struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file) |
| Loads font from KZB. More... | |
| struct KzuBitmapFont * | kzuBitmapFontFromFont (struct KzuFont *font) |
| Type cast from generic font to bitmap font. More... | |
| struct KzuFont * | kzuBitmapFontToFont (struct KzuBitmapFont *bitmapFont) |
| Type cast from bitmap font to generic font. More... | |
| struct KzcDynamicArrayIterator | kzuBitmapFontGetFontTextureNames (const struct KzuBitmapFont *bitmapFont) |
| Gets font texture names from font. More... | |
| KANZI_API void | kzuBitmapFontSetTexture (KzuBitmapFont *bitmapFont, kanzi::TextureSharedPtr texture, kzUint slot) |
| Sets texture to given slot in font. More... | |
| void | kzuBitmapFontSetSize (struct KzuBitmapFont *bitmapFont, kzUint size) |
| Sets the size of bitmap font (in pixels). More... | |
| void | kzuBitmapFontSetScale (struct KzuBitmapFont *bitmapFont, kzFloat scale) |
| Sets the scale (relative size) of bitmap font. More... | |
| kzFloat | kzuBitmapFontGetSize (const struct KzuBitmapFont *bitmapFont) |
| Returns the size of bitmap font. More... | |
| void | kzuBitmapFontSetColor (struct KzuBitmapFont *bitmapFont, kanzi::ColorRGBA color) |
| Sets the color of the font. More... | |
| kanzi::ColorRGBA | kzuBitmapFontGetColor (const struct KzuBitmapFont *bitmapFont) |
| Gets the color of the font. More... | |
| kzFloat | kzuBitmapFontGetLineHeight (const struct KzuBitmapFont *bitmapFont) |
| Returns the line height of bitmap font. More... | |
| kzFloat | kzuBitmapFontGetAscender (const struct KzuBitmapFont *bitmapFont) |
| Returns the ascender of bitmap font. More... | |
| kzFloat | kzuBitmapFontGetDescender (const struct KzuBitmapFont *bitmapFont) |
| Returns the descender of bitmap font. More... | |
| kzUint | kzuBitmapFontGetGlyphIndex (const struct KzuBitmapFont *bitmapFont, kzUnicodeChar character) |
| Returns the glyph index in the font for the given unicode code point. More... | |
| void | kzuBitmapFontGetCharacterMetrics (const struct KzuBitmapFont *bitmapFont, kzUint glyphIndex, kzFloat *out_advance, struct KzcRectangle *out_boundingBox) |
| Returns the advance of given character using bitmap font. More... | |
| kzFloat | kzuBitmapFontGetKerning (const struct KzuBitmapFont *bitmapFont, kzUint previousGlyphIndex, kzUint glyphIndex) |
| Returns the kerning of given character pair using bitmap font. More... | |
| kzsError | kzuBitmapFontDrawCharacter (const struct KzuBitmapFont *bitmapFont, kanzi::Renderer *renderer, kzUint glyphIndex, kzFloat x, kzFloat y) |
| Draws a character at given coordinates. More... | |
| kzsError | kzuBitmapFontPrepareTextLayout (struct KzuTextLayout *textLayout, kanzi::Renderer *renderer) |
| Prepares the given pre-layouted text for fast rendering using bitmap font. More... | |
| kzsError | kzuBitmapFontDrawTextLayout (struct KzuTextLayout *textLayout, kanzi::Renderer *renderer, kzFloat x, kzFloat y) |
| Draw the given pre-layouted text using bitmap font. More... | |
| kzsError | kzuBitmapFontDrawTextLayout3D (struct KzuTextLayout *textLayout, kanzi::Renderer *renderer) |
| Draw the given pre-layouted text in 3D space using bitmap font. More... | |
| kzsError | kzuBitmapFontFreeTextLayoutData (struct KzuTextLayout *textLayout) |
| Frees the data and resources created by the prepare function. More... | |
Variables | |
| const KzuFontType | KZU_FONT_TYPE_BITMAP |
| Font type identifier for bitmap font objects. More... | |
Bitmap font.
Copyright 2008-2017 by Rightware. All rights reserved.
| kzsError kzuBitmapFontSystemCreate | ( | const struct KzcMemoryManager * | memoryManager, |
| struct KzuBitmapFontSystem ** | out_bitmapSystem | ||
| ) |
Creates a bitmap font system.
| kzsError kzuBitmapFontSystemDelete | ( | struct KzuBitmapFontSystem * | bitmapSystem | ) |
Deletes a bitmap font system.
| void kzuBitmapFontSystemSetShader | ( | struct KzuBitmapFontSystem * | bitmapSystem, |
| kanzi::ShaderProgramSharedPtr | shader | ||
| ) |
Sets shader for bitmap font system.
| kzsError kzuBitmapFontCreate | ( | struct KzuBitmapFontSystem * | bitmapSystem, |
| kanzi::Domain * | domain, | ||
| kzString | name, | ||
| struct KzuBitmapFont ** | out_bitmapFont | ||
| ) |
Creates new font without any data.
| kzsError kzuBitmapFontCreateFromFile | ( | struct KzuBitmapFontSystem * | bitmapSystem, |
| kanzi::Domain * | domain, | ||
| kzString | filePath, | ||
| struct KzuBitmapFont ** | out_bitmapFont | ||
| ) |
Creates new font from file.
| kzsError kzuBitmapFontCreateFromResource | ( | struct KzuBitmapFontSystem * | bitmapSystem, |
| kanzi::Domain * | domain, | ||
| kzString | resourcePath, | ||
| struct KzuBitmapFont ** | out_bitmapFont | ||
| ) |
Creates new font from resource.
| KANZI_API kzsError kzuBitmapFontCreateFromMemory | ( | struct KzuBitmapFontSystem * | bitmapSystem, |
| kanzi::Domain * | domain, | ||
| kzString | fntFileContent, | ||
| kzString | name, | ||
| struct KzuBitmapFont ** | out_bitmapFont | ||
| ) |
Creates new font from preloaded resources.
| kzsError kzuBitmapFontLoadFromKZB | ( | struct KzuBitmapFont * | bitmapFont, |
| struct KzcInputStream * | inputStream, | ||
| const struct KzuBinaryFileInfo * | file | ||
| ) |
Loads font from KZB.
| struct KzuBitmapFont* kzuBitmapFontFromFont | ( | struct KzuFont * | font | ) |
Type cast from generic font to bitmap font.
| struct KzuFont* kzuBitmapFontToFont | ( | struct KzuBitmapFont * | bitmapFont | ) |
Type cast from bitmap font to generic font.
| struct KzcDynamicArrayIterator kzuBitmapFontGetFontTextureNames | ( | const struct KzuBitmapFont * | bitmapFont | ) |
Gets font texture names from font.
| KANZI_API void kzuBitmapFontSetTexture | ( | KzuBitmapFont * | bitmapFont, |
| kanzi::TextureSharedPtr | texture, | ||
| kzUint | slot | ||
| ) |
Sets texture to given slot in font.
The font takes ownership of the font after the operation and releases the texture when font is released.
| void kzuBitmapFontSetSize | ( | struct KzuBitmapFont * | bitmapFont, |
| kzUint | size | ||
| ) |
Sets the size of bitmap font (in pixels).
| void kzuBitmapFontSetScale | ( | struct KzuBitmapFont * | bitmapFont, |
| kzFloat | scale | ||
| ) |
Sets the scale (relative size) of bitmap font.
| kzFloat kzuBitmapFontGetSize | ( | const struct KzuBitmapFont * | bitmapFont | ) |
Returns the size of bitmap font.
| void kzuBitmapFontSetColor | ( | struct KzuBitmapFont * | bitmapFont, |
| kanzi::ColorRGBA | color | ||
| ) |
Sets the color of the font.
| kanzi::ColorRGBA kzuBitmapFontGetColor | ( | const struct KzuBitmapFont * | bitmapFont | ) |
Gets the color of the font.
| kzFloat kzuBitmapFontGetLineHeight | ( | const struct KzuBitmapFont * | bitmapFont | ) |
Returns the line height of bitmap font.
| kzFloat kzuBitmapFontGetAscender | ( | const struct KzuBitmapFont * | bitmapFont | ) |
Returns the ascender of bitmap font.
| kzFloat kzuBitmapFontGetDescender | ( | const struct KzuBitmapFont * | bitmapFont | ) |
Returns the descender of bitmap font.
| kzUint kzuBitmapFontGetGlyphIndex | ( | const struct KzuBitmapFont * | bitmapFont, |
| kzUnicodeChar | character | ||
| ) |
Returns the glyph index in the font for the given unicode code point.
| void kzuBitmapFontGetCharacterMetrics | ( | const struct KzuBitmapFont * | bitmapFont, |
| kzUint | glyphIndex, | ||
| kzFloat * | out_advance, | ||
| struct KzcRectangle * | out_boundingBox | ||
| ) |
Returns the advance of given character using bitmap font.
| kzFloat kzuBitmapFontGetKerning | ( | const struct KzuBitmapFont * | bitmapFont, |
| kzUint | previousGlyphIndex, | ||
| kzUint | glyphIndex | ||
| ) |
Returns the kerning of given character pair using bitmap font.
| kzsError kzuBitmapFontDrawCharacter | ( | const struct KzuBitmapFont * | bitmapFont, |
| kanzi::Renderer * | renderer, | ||
| kzUint | glyphIndex, | ||
| kzFloat | x, | ||
| kzFloat | y | ||
| ) |
Draws a character at given coordinates.
The coordinates indicate the character left point on the baseline. This function is meant for debugging purposes only. For real text rendering, use KzcTextLayouter.
| kzsError kzuBitmapFontPrepareTextLayout | ( | struct KzuTextLayout * | textLayout, |
| kanzi::Renderer * | renderer | ||
| ) |
Prepares the given pre-layouted text for fast rendering using bitmap font.
| kzsError kzuBitmapFontDrawTextLayout | ( | struct KzuTextLayout * | textLayout, |
| kanzi::Renderer * | renderer, | ||
| kzFloat | x, | ||
| kzFloat | y | ||
| ) |
Draw the given pre-layouted text using bitmap font.
| kzsError kzuBitmapFontDrawTextLayout3D | ( | struct KzuTextLayout * | textLayout, |
| kanzi::Renderer * | renderer | ||
| ) |
Draw the given pre-layouted text in 3D space using bitmap font.
| kzsError kzuBitmapFontFreeTextLayoutData | ( | struct KzuTextLayout * | textLayout | ) |
Frees the data and resources created by the prepare function.
| const KzuFontType KZU_FONT_TYPE_BITMAP |
Font type identifier for bitmap font objects.