MiniGUI API Reference (MiniGUI-Threads)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros | Typedefs | Enumerations | Functions
Glyph defines and operations

Macros

#define IS_MBC_GLYPH(glyph)   ((glyph) & 0x80000000)
 to judge wether the glyph is multibyte glyph More...
 
#define SET_MBC_GLYPH(glyph)   ((glyph) | 0x80000000)
 set the glyph with multibyte mask More...
 
#define REAL_GLYPH(glyph)   ((glyph) & 0x7FFFFFFF)
 get real glyph value from a glyph More...
 
#define SELECT_DEVFONT(plogfont, glyph)
 select a device font acording to the glyph value. More...
 

Typedefs

typedef struct _GLYPHMAPINFO GLYPHMAPINFO
 Data type of struct _GLYPHMAPINFO. More...
 
typedef struct _GLYPHINFO GLYPHINFO
 Data type of struct _GLYPHINFO. More...
 

Enumerations

Functions

MG_EXPORT Glyph32 GUIAPI GetGlyphValue (LOGFONT *logfont, const char *mchar, int mchar_len, const char *pre_mchar, int pre_len)
 Get the glyph value of a multi-byte character. More...
 
MG_EXPORT Glyph32 GUIAPI GetGlyphShape (LOGFONT *logfont, const char *mchar, int mchar_len, SHAPETYPE shape_type)
 Get the glyph shape of a character. More...
 
MG_EXPORT int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value, int *adv_x, int *adv_y)
 Draw a glyph. More...
 
MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT *logfont, Glyph32 glyph_value, GLYPHINFO *glyph_info)
 Retriev the information of a glyph. More...
 
MG_EXPORT int GUIAPI GetGlyphsExtent (HDC hdc, Glyph32 *glyphs, int nr_glyphs, SIZE *size)
 Get visual extent value of a glyph string. More...
 
MG_EXPORT int GUIAPI GetGlyphsExtentPoint (HDC hdc, Glyph32 *glyphs, int nr_glyphs, int max_extent, SIZE *size)
 Get the visual extent value of a glyph string. More...
 
MG_EXPORT int GUIAPI BIDIGetTextLogicalGlyphs (LOGFONT *log_font, const char *text, int text_len, Glyph32 **glyphs, GLYPHMAPINFO **glyphs_map)
 Get logical glyphs string of the text. More...
 
MG_EXPORT int GUIAPI BIDIGetTextVisualGlyphs (LOGFONT *log_font, const char *text, int text_len, Glyph32 **glyphs, GLYPHMAPINFO **glyphs_map)
 Get visual glyphs and glyph_map info relative with logical string byte index. More...
 
MG_EXPORT Glyph32 *GUIAPI BIDILogGlyphs2VisGlyphs (LOGFONT *log_font, Glyph32 *glyphs, int nr_glyphs, GLYPHMAPINFO *glyphs_map)
 Reorder the logical glyphs string to visual glyphs string. More...
 
MG_EXPORT void GUIAPI GetTextRangesLog2Vis (LOGFONT *log_font, char *text, int text_len, int start_index, int end_index, int **ranges, int *nr_ranges)
 Get a list of visual ranges corresponding to a given logical range. More...
 
MG_EXPORT void GUIAPI BIDIGetLogicalEmbeddLevels (LOGFONT *log_font, Glyph32 *glyphs, int nr_glyphs, Uint8 **embedding_level_list)
 Get the logical embedding levels for the logical glyph string and generate runs by embedding levels, the for reorder to get visual glyph string. More...
 
MG_EXPORT void GUIAPI BIDIGetVisualEmbeddLevels (LOGFONT *log_font, Glyph32 *glyphs, int nr_glyphs, Uint8 **embedding_level_list)
 Get the visual embedding levels for the given logical glyph string, then you can get the edge for visual glyphs. More...
 

Detailed Description

MiniGUI maintains some glyph defines and operations

Macro Definition Documentation

#define IS_MBC_GLYPH (   glyph)    ((glyph) & 0x80000000)

to judge wether the glyph is multibyte glyph

Parameters
glyphglyph value

Definition at line 8580 of file gdi.h.

#define REAL_GLYPH (   glyph)    ((glyph) & 0x7FFFFFFF)

get real glyph value from a glyph

Parameters
glyphglyph value

Definition at line 8596 of file gdi.h.

#define SELECT_DEVFONT (   plogfont,
  glyph 
)
Value:
((glyph) & 0x80000000 ? \
(plogfont)->mbc_devfont : \
(plogfont)->sbc_devfont)

select a device font acording to the glyph value.

Parameters
plogfontpointer to a logical font.
glyphglyph value.

Definition at line 8607 of file gdi.h.

#define SET_MBC_GLYPH (   glyph)    ((glyph) | 0x80000000)

set the glyph with multibyte mask

Parameters
glyphglyph value

Definition at line 8588 of file gdi.h.

Typedef Documentation

typedef struct _GLYPHINFO GLYPHINFO

Data type of struct _GLYPHINFO.

typedef struct _GLYPHMAPINFO GLYPHMAPINFO

Data type of struct _GLYPHMAPINFO.

Enumeration Type Documentation

enum typedef enum SHAPETYPE

Data type of enum.

Definition at line 8616 of file gdi.h.

Function Documentation

void GUIAPI BIDIGetLogicalEmbeddLevels ( LOGFONT log_font,
Glyph32 *  glyphs,
int  nr_glyphs,
Uint8 **  embedding_level_list 
)

Get the logical embedding levels for the logical glyph string and generate runs by embedding levels, the for reorder to get visual glyph string.

Parameters
log_fontThe logical font.
glyphsThe pointer to the logical glyph string.
nr_glyphsThe length of the glyph string.
embedding_level_listThe logical embedding level.
Returns
None.
int GUIAPI BIDIGetTextLogicalGlyphs ( LOGFONT log_font,
const char *  text,
int  text_len,
Glyph32 **  glyphs,
GLYPHMAPINFO **  glyphs_map 
)

Get logical glyphs string of the text.

Parameters
log_fontThe logical font.
textThe logical text string.
text_lenThe lenght of the logical text string in bytes.
glyphsThe pointer to the logical glyph string.
glyphs_mapThe position map from the logical glyphs string to the logical text.
Returns
The length of the logical glyph string.
See also
GLYPHMAPINFO
int GUIAPI BIDIGetTextVisualGlyphs ( LOGFONT log_font,
const char *  text,
int  text_len,
Glyph32 **  glyphs,
GLYPHMAPINFO **  glyphs_map 
)

Get visual glyphs and glyph_map info relative with logical string byte index.

Parameters
log_fontThe logical font.
textThe logical text string.
text_lenThe length of the logical text string in bytes.
glyphsThe pointer to the visual glyph string.
glyphs_mapThe position map from visual glyphs string to the logical text.
Returns
The length of the visual glyph string.
void GUIAPI BIDIGetVisualEmbeddLevels ( LOGFONT log_font,
Glyph32 *  glyphs,
int  nr_glyphs,
Uint8 **  embedding_level_list 
)

Get the visual embedding levels for the given logical glyph string, then you can get the edge for visual glyphs.

Parameters
log_fontThe logical font.
glyphsThe pointer to the logical glyph string.
nr_glyphsThe length of the glyph string.
embedding_level_listThe embedding level logical to visual.
Returns
void.
Glyph32 *GUIAPI BIDILogGlyphs2VisGlyphs ( LOGFONT log_font,
Glyph32 *  glyphs,
int  nr_glyphs,
GLYPHMAPINFO glyphs_map 
)

Reorder the logical glyphs string to visual glyphs string.

This function reorders the logical glyphs string to visual glyphs string. If glyphs_map is not NULL, get the visual glyphs map info.

Parameters
log_fontThe logical font.
glyphsThe pointer to the glyph string.
nr_glyphsThe length of the glyph string.
glyphs_mapThe position map from the logical glyph string to the visual glyph string.
Returns
The pointer to the visual glyph string.
int GUIAPI DrawGlyph ( HDC  hdc,
int  x,
int  y,
Glyph32  glyph_value,
int *  adv_x,
int *  adv_y 
)

Draw a glyph.

This function draws a glyph to the specific postion of a DC.

Parameters
hdcThe device context.
xThe output start x position.
yThe output start y position.
glyph_valueThe glyph value.
adv_xThe pointer used to return the advance in x-coordinate of the glyph, can be NULL.
adv_yThe pointer used to return the advance in y-coordinate of the glyph, can be NULL.
Returns
The advance on baseline.
int GUIAPI GetGlyphInfo ( LOGFONT logfont,
Glyph32  glyph_value,
GLYPHINFO glyph_info 
)

Retriev the information of a glyph.

This function retrieves the information of a glyph.

Parameters
logfontThe logical font.
glyph_valueThe glyph value.
glyph_infoThe glyph information will be returned through this struct.
Note
You must set glyph_info->mask to indicate what you want.
Returns
The advance of the glyph string on baseline.
See also
GLYPHINFO
int GUIAPI GetGlyphsExtent ( HDC  hdc,
Glyph32 *  glyphs,
int  nr_glyphs,
SIZE size 
)

Get visual extent value of a glyph string.

This function gets the extent value of a glyph string on a DC.

Parameters
hdcThe device context.
glyphsInput glyph string, input.
nr_glyphsInput glyph string len, input.
sizeOuput the fit glyph's extent value, Output.
Returns
The extent of the glyph string.
int GUIAPI GetGlyphsExtentPoint ( HDC  hdc,
Glyph32 *  glyphs,
int  nr_glyphs,
int  max_extent,
SIZE size 
)

Get the visual extent value of a glyph string.

This function gets the visual extent value of a glpyh string.

Parameters
hdcThe device context.
glyphsThe pointer to the glyph string.
nr_glyphsThe length of the glyph string len.
max_extentThe maximal output extent value.
sizeThe real extent of all visual glyphs in the glyph string.
Returns
The the index of the last glyph which can be fit to the extent.
Glyph32 GUIAPI GetGlyphShape ( LOGFONT logfont,
const char *  mchar,
int  mchar_len,
SHAPETYPE  shape_type 
)

Get the glyph shape of a character.

Parameters
logfontThe logical font.
mcharThe pointer to the multi-byte character.
mchar_lenThe length of mchar in bytes.
shape_typeThe shape type of mchar.
Returns
The multi-byte character's glyph shape value.
Glyph32 GUIAPI GetGlyphValue ( LOGFONT logfont,
const char *  mchar,
int  mchar_len,
const char *  pre_mchar,
int  pre_len 
)

Get the glyph value of a multi-byte character.

Parameters
logfontThe logical font.
mcharThe pointer to the multi-byte character.
mchar_lenThe length of mchar in bytes.
pre_mcharThe pointer to the multi-byte character before mchar.
pre_lenThe length of per_mchar in bytes.
Returns
The glyph value of the multi-byte character.
void GUIAPI GetTextRangesLog2Vis ( LOGFONT log_font,
char *  text,
int  text_len,
int  start_index,
int  end_index,
int **  ranges,
int *  nr_ranges 
)

Get a list of visual ranges corresponding to a given logical range.

Parameters
log_fontThe logical font.
textThe pointer to the logical text string.
text_lenThe length of the logical text string in bytes.
start_indexThe start index of the logical range.
end_indexThe end index of the logical range.
rangesThe pointer to store a pointer to an array of arranges.
nr_rangesThe number of ranges stored in ranges.
Returns
None.