kzu_configured_font.h File Reference

Configured font. More...

Namespaces

 kanzi
 

Functions

kzsError kzuConfiguredFontCreate (const struct KzcMemoryManager *memoryManager, struct KzuFont *targetFont, kzFloat size, kanzi::ColorRGBA color, const kanzi::Domain *domain, kzString name, struct KzuConfiguredFont **out_configuredFont)
 Creates new configured font wrapping the given target font. More...
 
struct KzuConfiguredFontkzuConfiguredFontFromFont (struct KzuFont *font)
 Type cast from generic font to configured font. More...
 
struct KzuFontkzuConfiguredFontToFont (struct KzuConfiguredFont *configuredFont)
 Type cast from configured font to generic font. More...
 
kzsError kzuConfiguredFontSetSize (struct KzuConfiguredFont *configuredFont, kzFloat size)
 Sets the size of configured font. More...
 
kzFloat kzuConfiguredFontGetSize (const struct KzuConfiguredFont *configuredFont)
 Returns the size of configured font. More...
 
kzsError kzuConfiguredFontSetColor (struct KzuConfiguredFont *configuredFont, kanzi::ColorRGBA color)
 Sets the color of the font. More...
 
kanzi::ColorRGBA kzuConfiguredFontGetColor (const struct KzuConfiguredFont *configuredFont)
 Gets the color of the font. More...
 
kzsError kzuConfiguredFontGetLineHeight (const struct KzuConfiguredFont *configuredFont, kzFloat *out_lineHeight)
 Returns the line height of configured font. More...
 
kzsError kzuConfiguredFontGetAscender (const struct KzuConfiguredFont *configuredFont, kzFloat *out_ascender)
 Returns the ascender of configured font. More...
 
kzsError kzuConfiguredFontGetGlyphIndex (const struct KzuConfiguredFont *configuredFont, kzUnicodeChar character, kzUint *out_glyphIndex)
 Returns the glyph index in the font for the given unicode code point. More...
 
kzsError kzuConfiguredFontGetCharacterMetrics (const struct KzuConfiguredFont *configuredFont, kzUint glyphIndex, kzFloat *out_advance, struct KzcRectangle *out_boundingBox)
 Returns the advance of given character using configured font. More...
 
kzsError kzuConfiguredFontGetKerning (const struct KzuConfiguredFont *configuredFont, kzUint previousGlyphIndex, kzUint glyphIndex, kzFloat *out_kerning)
 Returns the kerning of given character pair using configured font. More...
 
kzsError kzuConfiguredFontLoadCharacterGlyph (const struct KzuConfiguredFont *configuredFont, kzUint glyphIndex, kzUint *out_width, kzUint *out_height, const kanzi::byte **out_bitmapData, void **out_characterGlyph)
 Loads a bitmap data for a single character glyph using configured font. More...
 
kzsError kzuConfiguredFontReleaseCharacterGlyph (const struct KzuConfiguredFont *configuredFont, void *characterGlyph)
 Releases a loaded character glyph using configured font. More...
 
kzsError kzuConfiguredFontPrepareTextLayout (struct KzuTextLayout *textLayout, kanzi::Renderer *renderer)
 Prepares the given pre-layouted text for fast rendering using configured font. More...
 
kzsError kzuConfiguredFontDrawTextLayout (struct KzuTextLayout *textLayout, kanzi::Renderer *renderer, kzFloat x, kzFloat y)
 Draw the given pre-layouted text using configured font. More...
 
kzsError kzuConfiguredFontDrawTextLayout3D (struct KzuTextLayout *textLayout, kanzi::Renderer *renderer)
 Draw the given pre-layouted text in 3D space using configured font. More...
 
kzsError kzuConfiguredFontFreeTextLayoutData (struct KzuTextLayout *textLayout)
 Frees the data and resources created by the prepare function. More...
 

Variables

const KzuFontType KZU_FONT_TYPE_CONFIGURED
 Font type identifier for configured font objects. More...
 

Detailed Description

Configured font.

This font implementation wraps an existing font with given font configuration (size, color).

Copyright 2008-2017 by Rightware. All rights reserved.

Function Documentation

kzsError kzuConfiguredFontCreate ( const struct KzcMemoryManager memoryManager,
struct KzuFont targetFont,
kzFloat  size,
kanzi::ColorRGBA  color,
const kanzi::Domain domain,
kzString  name,
struct KzuConfiguredFont **  out_configuredFont 
)

Creates new configured font wrapping the given target font.

struct KzuConfiguredFont* kzuConfiguredFontFromFont ( struct KzuFont font)

Type cast from generic font to configured font.

struct KzuFont* kzuConfiguredFontToFont ( struct KzuConfiguredFont configuredFont)

Type cast from configured font to generic font.

kzsError kzuConfiguredFontSetSize ( struct KzuConfiguredFont configuredFont,
kzFloat  size 
)

Sets the size of configured font.

kzFloat kzuConfiguredFontGetSize ( const struct KzuConfiguredFont configuredFont)

Returns the size of configured font.

kzsError kzuConfiguredFontSetColor ( struct KzuConfiguredFont configuredFont,
kanzi::ColorRGBA  color 
)

Sets the color of the font.

kanzi::ColorRGBA kzuConfiguredFontGetColor ( const struct KzuConfiguredFont configuredFont)

Gets the color of the font.

kzsError kzuConfiguredFontGetLineHeight ( const struct KzuConfiguredFont configuredFont,
kzFloat out_lineHeight 
)

Returns the line height of configured font.

kzsError kzuConfiguredFontGetAscender ( const struct KzuConfiguredFont configuredFont,
kzFloat out_ascender 
)

Returns the ascender of configured font.

kzsError kzuConfiguredFontGetGlyphIndex ( const struct KzuConfiguredFont configuredFont,
kzUnicodeChar  character,
kzUint out_glyphIndex 
)

Returns the glyph index in the font for the given unicode code point.

kzsError kzuConfiguredFontGetCharacterMetrics ( const struct KzuConfiguredFont configuredFont,
kzUint  glyphIndex,
kzFloat out_advance,
struct KzcRectangle out_boundingBox 
)

Returns the advance of given character using configured font.

kzsError kzuConfiguredFontGetKerning ( const struct KzuConfiguredFont configuredFont,
kzUint  previousGlyphIndex,
kzUint  glyphIndex,
kzFloat out_kerning 
)

Returns the kerning of given character pair using configured font.

kzsError kzuConfiguredFontLoadCharacterGlyph ( const struct KzuConfiguredFont configuredFont,
kzUint  glyphIndex,
kzUint out_width,
kzUint out_height,
const kanzi::byte **  out_bitmapData,
void **  out_characterGlyph 
)

Loads a bitmap data for a single character glyph using configured font.

kzsError kzuConfiguredFontReleaseCharacterGlyph ( const struct KzuConfiguredFont configuredFont,
void *  characterGlyph 
)

Releases a loaded character glyph using configured font.

kzsError kzuConfiguredFontPrepareTextLayout ( struct KzuTextLayout textLayout,
kanzi::Renderer renderer 
)

Prepares the given pre-layouted text for fast rendering using configured font.

kzsError kzuConfiguredFontDrawTextLayout ( struct KzuTextLayout textLayout,
kanzi::Renderer renderer,
kzFloat  x,
kzFloat  y 
)

Draw the given pre-layouted text using configured font.

kzsError kzuConfiguredFontDrawTextLayout3D ( struct KzuTextLayout textLayout,
kanzi::Renderer renderer 
)

Draw the given pre-layouted text in 3D space using configured font.

kzsError kzuConfiguredFontFreeTextLayoutData ( struct KzuTextLayout textLayout)

Frees the data and resources created by the prepare function.

Variable Documentation

const KzuFontType KZU_FONT_TYPE_CONFIGURED

Font type identifier for configured font objects.