Monotype's iType font. More...
#include "kzu_font_common.h"
#include <kanzi/core.ui/platform/graphics_backend/gl/shader.hpp>
#include <kanzi/core/math/color_rgba.hpp>
#include <kanzi/core/legacy/debug/kzs_error.hpp>
#include <kanzi/core/legacy/kzs_types.hpp>
Namespaces | |
kanzi | |
Functions | |
kzsError | kzuItypeSystemCreate (const struct KzcMemoryManager *memoryManager, kanzi::Domain *domain, struct KzuItypeSystem **out_itypeSystem) |
Creates an iType font system. More... | |
kzsError | kzuItypeSystemDelete (struct KzuItypeSystem *itypeSystem) |
Deletes an iType font system. More... | |
void | kzuItypeSystemSetShader (struct KzuItypeSystem *itypeSystem, kzBool useDistanceField, kanzi::ShaderProgramSharedPtr shader) |
Sets shader for iType system. More... | |
struct KzuItypeSystem * | kzuItypeSystemFromTruetypeSystem (struct KzuTruetypeSystem *truetypeSystem) |
Type casts a generic TrueType font system to more specific iType font system. More... | |
struct KzuTruetypeSystem * | kzuItypeSystemToTruetypeSystem (struct KzuItypeSystem *itypeSystem) |
Type casts an iType font system to more generic TrueType font system. More... | |
kzsError | kzuItypeFontCreate (struct KzuItypeSystem *itypeSystem, kanzi::string_view name, struct KzuItypeFont **out_itypeFont) |
Creates new iType font. More... | |
kzsError | kzuItypeFontCreateFromResource (const struct KzcMemoryManager *memoryManager, struct KzuItypeSystem *itypeSystem, kzString resourcePath, struct KzuItypeFont **out_itypeFont) |
Creates new iType font from resource. More... | |
kzsError | kzuItypeFontCreateFromFile (const struct KzcMemoryManager *memoryManager, struct KzuItypeSystem *itypeSystem, kzString filePath, struct KzuItypeFont **out_itypeFont) |
Creates new iType font from file. More... | |
kzsError | kzuItypeFontCreateFromMemory (const struct KzcMemoryManager *memoryManager, struct KzuItypeSystem *itypeSystem, const kzByte *data, kzUint size, kanzi::string_view name, bool createMemoryCopy, struct KzuItypeFont **out_itypeFont) |
Creates new iType font from memory. More... | |
kzsError | kzuItypeFontLoadFromKZB (struct KzuItypeFont *itypeFont, struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file) |
Loads iType font from KZB. More... | |
struct KzuItypeFont * | kzuItypeFontFromFont (struct KzuFont *font) |
Type casts generic font structure to iType font structure. More... | |
struct KzuFont * | kzuItypeFontToFont (struct KzuItypeFont *itypeFont) |
Type casts iType font structure to generic font structure. More... | |
kzsError | kzuItypeFontSetSize (struct KzuItypeFont *itypeFont, kzFloat size) |
Sets the size of iType font (in pixels). More... | |
kzFloat | kzuItypeFontGetSize (const struct KzuItypeFont *itypeFont) |
Returns the size of iType font. More... | |
void | kzuItypeFontSetColor (struct KzuItypeFont *itypeFont, kanzi::ColorRGBA color) |
Sets the color of the font. More... | |
kanzi::ColorRGBA | kzuItypeFontGetColor (const struct KzuItypeFont *itypeFont) |
Gets the color of the font. More... | |
kzFloat | kzuItypeFontGetLineHeight (const struct KzuItypeFont *itypeFont) |
Returns the line height of iType font. More... | |
kzFloat | kzuItypeFontGetAscender (const struct KzuItypeFont *itypeFont) |
Returns the ascender of iType font. More... | |
kzFloat | kzuItypeFontGetDescender (const struct KzuItypeFont *itypeFont) |
Returns the descender of iType font. More... | |
kzUint | kzuItypeFontGetGlyphIndex (const struct KzuItypeFont *itypeFont, kzUnicodeChar character) |
Returns the glyph index in the iType font for the given unicode code point. More... | |
kzsError | kzuItypeFontGetCharacterMetrics (const struct KzuItypeFont *itypeFont, kzUint glyphIndex, kzFloat *out_advanceX, kzFloat *out_advanceY, struct KzcRectangle *out_boundingBox) |
Returns the advance of given character using iType font. More... | |
kzsError | kzuItypeFontGetKerning (const struct KzuItypeFont *itypeFont, kzUint previousGlyphIndex, kzUint glyphIndex, kzFloat *out_kerningX, kzFloat *out_kerningY) |
Returns the kerning of given character pair using iType font. More... | |
kzsError | kzuItypeFontPrepareTextLayout (struct KzuTextLayout *textLayout, kanzi::Renderer *renderer) |
Prepares the given pre-layouted text for fast rendering using iType. More... | |
kzsError | kzuItypeFontDrawTextLayout (struct KzuTextLayout *textLayout, kanzi::Renderer *renderer, kzFloat x, kzFloat y) |
Draw the given pre-layouted text using iType. More... | |
kzsError | kzuItypeFontDrawTextLayout3D (struct KzuTextLayout *textLayout, kanzi::Renderer *renderer) |
Draw the given pre-layouted text in 3D space using iType. More... | |
kzsError | kzuItypeFontFreeTextLayoutData (struct KzuTextLayout *textLayout) |
Frees the data and resources created by the prepare function. More... | |
kzsError | kzuItypeFontLoadCharacterGlyph (const struct KzuItypeFont *itypeFont, kzUint glyphIndex, kzUint *out_width, kzUint *out_height, const kzByte **out_bitmapData, void **out_characterGlyph) |
Loads a bitmap data for a single character glyph. More... | |
kzsError | kzuItypeFontReleaseCharacterGlyph (const struct KzuItypeFont *itypeFont, void *characterGlyph) |
Releases a loaded character glyph. More... | |
void * | kzuItypeFontGetState (const struct KzuItypeFont *itypeFont) |
Returns the FS_STATE* object from iType font. More... | |
Variables | |
const KzuFontType | KZU_FONT_TYPE_ITYPE |
Font type identifier for font iType fonts. More... | |
Monotype's iType font.
Copyright 2008-2017 by Rightware. All rights reserved.
kzsError kzuItypeSystemCreate | ( | const struct KzcMemoryManager * | memoryManager, |
kanzi::Domain * | domain, | ||
struct KzuItypeSystem ** | out_itypeSystem | ||
) |
Creates an iType font system.
kzsError kzuItypeSystemDelete | ( | struct KzuItypeSystem * | itypeSystem | ) |
Deletes an iType font system.
void kzuItypeSystemSetShader | ( | struct KzuItypeSystem * | itypeSystem, |
kzBool | useDistanceField, | ||
kanzi::ShaderProgramSharedPtr | shader | ||
) |
Sets shader for iType system.
struct KzuItypeSystem* kzuItypeSystemFromTruetypeSystem | ( | struct KzuTruetypeSystem * | truetypeSystem | ) |
Type casts a generic TrueType font system to more specific iType font system.
struct KzuTruetypeSystem* kzuItypeSystemToTruetypeSystem | ( | struct KzuItypeSystem * | itypeSystem | ) |
Type casts an iType font system to more generic TrueType font system.
kzsError kzuItypeFontCreate | ( | struct KzuItypeSystem * | itypeSystem, |
kanzi::string_view | name, | ||
struct KzuItypeFont ** | out_itypeFont | ||
) |
Creates new iType font.
kzsError kzuItypeFontCreateFromResource | ( | const struct KzcMemoryManager * | memoryManager, |
struct KzuItypeSystem * | itypeSystem, | ||
kzString | resourcePath, | ||
struct KzuItypeFont ** | out_itypeFont | ||
) |
Creates new iType font from resource.
kzsError kzuItypeFontCreateFromFile | ( | const struct KzcMemoryManager * | memoryManager, |
struct KzuItypeSystem * | itypeSystem, | ||
kzString | filePath, | ||
struct KzuItypeFont ** | out_itypeFont | ||
) |
Creates new iType font from file.
kzsError kzuItypeFontCreateFromMemory | ( | const struct KzcMemoryManager * | memoryManager, |
struct KzuItypeSystem * | itypeSystem, | ||
const kzByte * | data, | ||
kzUint | size, | ||
kanzi::string_view | name, | ||
bool | createMemoryCopy, | ||
struct KzuItypeFont ** | out_itypeFont | ||
) |
Creates new iType font from memory.
kzsError kzuItypeFontLoadFromKZB | ( | struct KzuItypeFont * | itypeFont, |
struct KzcInputStream * | inputStream, | ||
const struct KzuBinaryFileInfo * | file | ||
) |
Loads iType font from KZB.
struct KzuItypeFont* kzuItypeFontFromFont | ( | struct KzuFont * | font | ) |
Type casts generic font structure to iType font structure.
struct KzuFont* kzuItypeFontToFont | ( | struct KzuItypeFont * | itypeFont | ) |
Type casts iType font structure to generic font structure.
kzsError kzuItypeFontSetSize | ( | struct KzuItypeFont * | itypeFont, |
kzFloat | size | ||
) |
Sets the size of iType font (in pixels).
kzFloat kzuItypeFontGetSize | ( | const struct KzuItypeFont * | itypeFont | ) |
Returns the size of iType font.
void kzuItypeFontSetColor | ( | struct KzuItypeFont * | itypeFont, |
kanzi::ColorRGBA | color | ||
) |
Sets the color of the font.
kanzi::ColorRGBA kzuItypeFontGetColor | ( | const struct KzuItypeFont * | itypeFont | ) |
Gets the color of the font.
kzFloat kzuItypeFontGetLineHeight | ( | const struct KzuItypeFont * | itypeFont | ) |
Returns the line height of iType font.
kzFloat kzuItypeFontGetAscender | ( | const struct KzuItypeFont * | itypeFont | ) |
Returns the ascender of iType font.
kzFloat kzuItypeFontGetDescender | ( | const struct KzuItypeFont * | itypeFont | ) |
Returns the descender of iType font.
kzUint kzuItypeFontGetGlyphIndex | ( | const struct KzuItypeFont * | itypeFont, |
kzUnicodeChar | character | ||
) |
Returns the glyph index in the iType font for the given unicode code point.
kzsError kzuItypeFontGetCharacterMetrics | ( | const struct KzuItypeFont * | itypeFont, |
kzUint | glyphIndex, | ||
kzFloat * | out_advanceX, | ||
kzFloat * | out_advanceY, | ||
struct KzcRectangle * | out_boundingBox | ||
) |
Returns the advance of given character using iType font.
kzsError kzuItypeFontGetKerning | ( | const struct KzuItypeFont * | itypeFont, |
kzUint | previousGlyphIndex, | ||
kzUint | glyphIndex, | ||
kzFloat * | out_kerningX, | ||
kzFloat * | out_kerningY | ||
) |
Returns the kerning of given character pair using iType font.
kzsError kzuItypeFontPrepareTextLayout | ( | struct KzuTextLayout * | textLayout, |
kanzi::Renderer * | renderer | ||
) |
Prepares the given pre-layouted text for fast rendering using iType.
kzsError kzuItypeFontDrawTextLayout | ( | struct KzuTextLayout * | textLayout, |
kanzi::Renderer * | renderer, | ||
kzFloat | x, | ||
kzFloat | y | ||
) |
Draw the given pre-layouted text using iType.
kzsError kzuItypeFontDrawTextLayout3D | ( | struct KzuTextLayout * | textLayout, |
kanzi::Renderer * | renderer | ||
) |
Draw the given pre-layouted text in 3D space using iType.
kzsError kzuItypeFontFreeTextLayoutData | ( | struct KzuTextLayout * | textLayout | ) |
Frees the data and resources created by the prepare function.
kzsError kzuItypeFontLoadCharacterGlyph | ( | const struct KzuItypeFont * | itypeFont, |
kzUint | glyphIndex, | ||
kzUint * | out_width, | ||
kzUint * | out_height, | ||
const kzByte ** | out_bitmapData, | ||
void ** | out_characterGlyph | ||
) |
Loads a bitmap data for a single character glyph.
The returned character glyph needs to be released with a call to release. The bitmap data is returned as a greyscale image with 8 bits per pixel.
kzsError kzuItypeFontReleaseCharacterGlyph | ( | const struct KzuItypeFont * | itypeFont, |
void * | characterGlyph | ||
) |
Releases a loaded character glyph.
void* kzuItypeFontGetState | ( | const struct KzuItypeFont * | itypeFont | ) |
Returns the FS_STATE* object from iType font.
const KzuFontType KZU_FONT_TYPE_ITYPE |
Font type identifier for font iType fonts.