Namespace: dmGameSystem
Language: C++
Type: Defold C++
File: res_font.h
Source: engine/gamesys/src/dmsdk/gamesys/resources/res_font.h
Include: dmsdk/gamesys/resources/res_font.h
Font resource functions.
Type: STRUCT Used to retrieve the information of a font.
Members
m_Size (uint32_t) - The size of the font (in points)m_ShadowX (float) - The shadow distance in X-axis (in pixels)m_ShadowY (float) - The shadow distance in Y-axis (in pixels)m_ShadowBlur (uint32_t) - The shadow blur spread [0.255] (in pixels)m_ShadowAlpha (float) - The shadow alpha value [0..255]m_Alpha (float) - The alpha value [0..255]m_OutlineAlpha (float) - The outline alpha value [0..255]m_OutlineWidth (float) - The outline size (in pixels)m_OutputFormat (dmRenderDDF::FontTextureFormat) - The type of font (bitmap or distance field)m_RenderMode (dmRenderDDF::FontRenderMode) - Single or multi channelType: STRUCT Handle to font resource
Type: TYPEDEF
Parameters
ctx (void*) - The callback contextresult (int) - The result of the prewarming. Non zero if successfulerrmsg (const char*) - An error message if not successful.Type: FUNCTION Make sure each glyph in the text gets rasterized and put into the glyph cache
Parameters
font (FontResource*) - The font resourcetext (const char*) - The text (utf8)cbk (FPrewarmTextCallback) - The callback is called when the last item is donecbk_ctx (void*) - The callback contextReturns
result (dmResource::Result) - RESULT_OK if successfulType: FUNCTION add a ttf font to a font collection
Notes
Parameters
factory (dmResource::HFactory) - The factoryfont (FontResource*) - The font collection (.fontc)ttf_path (const char*) - The .ttf pathReturns
result (dmResource::Result) - RESULT_OK if successfulType: FUNCTION add a ttf font to a font collection
Notes
Parameters
factory (dmResource::HFactory) - The factoryfont (FontResource*) - The font collection (.fontc)ttf_hash (dmhash_t) - The ttf path hash (.ttf)Returns
result (dmResource::Result) - RESULT_OK if successfulType: FUNCTION
Parameters
font (FontResource*) - The font resourcehfont (HFont) - The font the glyph was created fromglyph_index (uint32_t) - The glyph indexReturns
result (bool) - true if the glyph already has rasterized bitmap dataType: FUNCTION
Parameters
font (FontResource*) - The font resourcehfont (HFont) - The font the glyph was created fromglyph (FontGlyph*) - The glyphReturns
result (dmResource::Result) - RESULT_OK if successfulType: FUNCTION
Parameters
resource (FontResource*) - The font resourceReturns
font_collection (HFontCollection*) - The font collection if successful. 0 otherwise.Type: FUNCTION
Parameters
font (FontResource*) - The font resourceReturns
result (dmRender::HFontMap) - Handle to a font if successful. 0 otherwise.Type: FUNCTION
Parameters
font (FontResource*) - The font resource to queryinfo (FontInfo*) - The output info (out)Returns
result (dmResource::Result) - RESULT_OK if successfulType: FUNCTION
Parameters
resource (FontResource*) - The font resourcefont (HFont) - The fontReturns
path_hash (dmhash_t) - The path hash to the associated TTFresource*Type: FUNCTION
Parameters
resource (FontResource*) - The font resourcefont (HFont) - The fontReturns
ttfresource (TTFResource*) - The ttfresource if successful. 0 otherwise.Type: FUNCTION remove a ttf font from a font collection
Parameters
factory (dmResource::HFactory) - The factoryfont (FontResource*) - The font collection (.fontc)ttf_hash (dmhash_t) - The ttf path hash (.ttf)Returns
result (dmResource::Result) - RESULT_OK if successfulType: CONSTANT The edge value of an sdf glyph bitmap