MiniGUI API Reference (MiniGUI-Threads)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros | Functions
System charset and font operations

MiniGUI creates a few system fonts to draw menu text, window caption, or other general items. MiniGUI at least creates two system fonts: one mono-space logical font for single-byte charset, and one mono-space logical font for multi-byte charset. For the multi-byte charset, the width of one multi-byte character should be equal to the width of two single-byte characters. More...

Macros

#define SYSLOGFONT_DEFAULT   0
 
#define SYSLOGFONT_WCHAR_DEF   1
 
#define SYSLOGFONT_FIXED   2
 
#define SYSLOGFONT_CAPTION   3
 
#define SYSLOGFONT_MENU   4
 
#define SYSLOGFONT_CONTROL   5
 

Functions

static PLOGFONT GUIAPI GetSystemFont (int font_id)
 Get the system logical font through an font identifier. More...
 
MG_EXPORT int GUIAPI GetSysFontMaxWidth (int font_id)
 Get the maximal width of a single-byte character of a system font. More...
 
MG_EXPORT int GUIAPI GetSysFontAveWidth (int font_id)
 Get the average width of a single-byte character of a system font. More...
 
MG_EXPORT int GUIAPI GetSysFontHeight (int font_id)
 Get the height of a single-byte character of a system font. More...
 
const MG_EXPORT char *GUIAPI GetSysCharset (BOOL wchar)
 Get the current system charset. More...
 
MG_EXPORT int GUIAPI GetSysCharHeight (void)
 Get the height of a character of the default system font. More...
 
MG_EXPORT int GUIAPI GetSysCharWidth (void)
 Get the width of a single-byte character of the default system font. More...
 
MG_EXPORT int GUIAPI GetSysCCharWidth (void)
 Get the width of a multi-byte character of the default system font. More...
 

Detailed Description

MiniGUI creates a few system fonts to draw menu text, window caption, or other general items. MiniGUI at least creates two system fonts: one mono-space logical font for single-byte charset, and one mono-space logical font for multi-byte charset. For the multi-byte charset, the width of one multi-byte character should be equal to the width of two single-byte characters.

Macro Definition Documentation

◆ SYSLOGFONT_CAPTION

#define SYSLOGFONT_CAPTION   3
See also
GetSystemFont

Definition at line 8278 of file gdi.h.

◆ SYSLOGFONT_CONTROL

#define SYSLOGFONT_CONTROL   5
See also
GetSystemFont

Definition at line 8290 of file gdi.h.

◆ SYSLOGFONT_DEFAULT

#define SYSLOGFONT_DEFAULT   0
See also
GetSystemFont

Definition at line 8260 of file gdi.h.

◆ SYSLOGFONT_FIXED

#define SYSLOGFONT_FIXED   2
See also
GetSystemFont

Definition at line 8272 of file gdi.h.

◆ SYSLOGFONT_MENU

#define SYSLOGFONT_MENU   4
See also
GetSystemFont

Definition at line 8284 of file gdi.h.

◆ SYSLOGFONT_WCHAR_DEF

#define SYSLOGFONT_WCHAR_DEF   1
See also
GetSystemFont

Definition at line 8266 of file gdi.h.

Function Documentation

◆ GetSysCCharWidth()

int GUIAPI GetSysCCharWidth ( void  )

Get the width of a multi-byte character of the default system font.

This function returns the width of a multi-byte character of the default system font. MiniGUI uses mono-space font as the system default font.

Returns
The width of multi-byte character of the default system font.
See also
GetSysCharHeight, GetSysCharWidth

◆ GetSysCharHeight()

int GUIAPI GetSysCharHeight ( void  )

Get the height of a character of the default system font.

This function returns the height of a character of the system default font. MiniGUI uses mono-space font as the default system font.

Normally, the width of one multi-byte character is equal to the width of two single-byte character when using the default system font.

Returns
The character height of the default system font.
See also
GetSysCharWidth, GetSysCCharWidth

◆ GetSysCharset()

const char *GUIAPI GetSysCharset ( BOOL  wchar)

Get the current system charset.

This function gets the current system charset and returns the charset name. By default, the system charset is ISO8859-1 (for single-byte charset) or GB2312.1980-0 (for wide charset), but you can change it by modifying MiniGUI.cfg.

Parameters
wcharWhether to retrieve the wide charset supported currently.
Returns
The read-only buffer of charset name. If you pass wchar TRUE, This function may return NULL, if there is not any wide charset supported.

◆ GetSysCharWidth()

int GUIAPI GetSysCharWidth ( void  )

Get the width of a single-byte character of the default system font.

This function returns the width of a single-byte character of the default system font. MiniGUI uses mono-space font as the default system font, but you can specify a different font to output text in windows of MiniGUI.

Returns
The width of single-byte character of the default system font.
See also
GetSysCharHeight, GetSysCCharWidth, SelectFont, CreateLogFont

◆ GetSysFontAveWidth()

int GUIAPI GetSysFontAveWidth ( int  font_id)

Get the average width of a single-byte character of a system font.

This function returns the average width of a single-byte character of one system font.

Parameters
font_idThe identifier of a system font.
Returns
The average width of single-byte character of the default system font.
See also
GetSystemFont

◆ GetSysFontHeight()

int GUIAPI GetSysFontHeight ( int  font_id)

Get the height of a single-byte character of a system font.

This function returns the height of a single-byte character of one system font.

Parameters
font_idThe identifier of a system font.
Returns
The height of single-byte character of the default system font.
See also
GetSystemFont

◆ GetSysFontMaxWidth()

int GUIAPI GetSysFontMaxWidth ( int  font_id)

Get the maximal width of a single-byte character of a system font.

This function returns the maximal width of a single-byte character of one system font.

Parameters
font_idThe identifier of a system font.
Returns
The maximal width of single-byte character of the default system font.
See also
GetSystemFont

◆ GetSystemFont()

PLOGFONT GUIAPI GetSystemFont ( int  font_id)
inlinestatic

Get the system logical font through an font identifier.

This function returns the system logical font through the font identifier font_id.

Parameters
font_idThe identifier of a system font, can be one of the following values:
  • SYSLOGFONT_DEFAULT
    The default system logical font in single-byte charset, must be rbf.
  • SYSLOGFONT_WCHAR_DEF
    The default system logical font in multi-byte charset, must be rbf.
  • SYSLOGFONT_FIXED
    The fixed space system logical font.
  • SYSLOGFONT_CAPTION
    The system logical font used to draw caption text.
  • SYSLOGFONT_MENU
    The system logical font used to draw menu items.
  • SYSLOGFONT_CONTROL
    The system logical font used to draw controls.
Returns
The pointer to the system logical font. NULL on error.

Definition at line 8320 of file gdi.h.