mGPlus API Reference  v1.4.0
A MiniGUI component which provides support for advanced 2D graphics functions
Functions
Glyph

Functions

MGPLUS_EXPORT HFONT MGPlusCreateFont (const char *font_name, unsigned face_index, MPGlyphRendering ren_type, unsigned int width, unsigned int height, BOOL flip_y)
 Create ttf font. More...
 
MGPLUS_EXPORT MPStatus MGPlusDeleteFont (HFONT hfont)
 Delete font. More...
 
MGPLUS_EXPORT HPATH MGPlusGetGlyphPath (int x, int y, LPGLYPHDATA lpdata)
 Get the Glyph outline path. More...
 
MGPLUS_EXPORT MPStatus MGPlusGetGlyphOutline (HFONT hfont, unsigned uchar, LPGLYPHMETRICS lpgm, LPGLYPHDATA lpdata)
 Get the font path or LPGLYPHMETERICS info through uFormat. More...
 
MGPLUS_EXPORT MPStatus MGPlusDrawGlyph (HGRAPHICS graphics, HFONT hfont, int x, int y, LPGLYPHDATA lpdata, ARGB color)
 Draw glyph path. More...
 

Detailed Description

MGPlus maintains some glyph defines and operations

Function Documentation

HFONT MGPlusCreateFont ( const char *  font_name,
unsigned  face_index,
MPGlyphRendering  ren_type,
unsigned int  width,
unsigned int  height,
BOOL  flip_y 
)

Create ttf font.

This function get the glyph outline path from outline's data buffer.

Parameters
font_nameThe create font name.
face_indexThe font's face index.
ren_typeThe font render type.
widthThe font width.
heightThe font height.
flip_yThe glyph's y-coor flip, if true, flip the y coordinate.
Returns
If success, it returns the font handle.
HPATH MGPlusDeleteFont ( HFONT  hfont)

Delete font.

This function destroy the special font.

Parameters
hfontThe handle pointer of font.
Returns
If success, it returns MP_OK.
MGPLUS_EXPORT MPStatus MGPlusDrawGlyph ( HGRAPHICS  graphics,
HFONT  hfont,
int  x,
int  y,
LPGLYPHDATA  lpdata,
ARGB  color 
)

Draw glyph path.

This function draw glyph at x/y position with glyph data, user should be special render glyph color.

Parameters
graphicsThe graphic handler.
hfontThe pointer of font.
xThe x coordinate of glyph.
yThe y coordinate of glyph.
lpdataThe glyph data pointer.
colorThe render glyph color.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
MPStatus MGPlusGetGlyphOutline ( HFONT  hfont,
unsigned  uchar,
LPGLYPHMETRICS  lpgm,
LPGLYPHDATA  lpdata 
)

Get the font path or LPGLYPHMETERICS info through uFormat.

This function get the font path from the glyph data.

Parameters
hfontThe pointer of font.
ucharThe query character.
lpgmThe LPGLYPHMETRICS pointer.
lpdataThe glyph data pointer.
Returns
Get Status, MP_GENERIC_ERROR indicates an error.
HPATH MGPlusGetGlyphPath ( int  x,
int  y,
LPGLYPHDATA  lpdata 
)

Get the Glyph outline path.

This function get the glyph outline path from outline's data buffer.

Parameters
xThe x coordinate of glyph.
yThe y coordinate of glyph.
lpdataThe pointer of glyph outline data.
Returns
If success, it returns the path.