MiniGUI API Reference (MiniGUI-Processes)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
Rendering Text in Complex/Mixed Scripts

To lay out, shape, and render a text in mixed scripts, you should call GetUCharsUntilParagraphBoundary function first to convert a multi-byte string to a Unicode string under the specified white space rule, breaking rule, and transformation rule. For example, converting a general C string in UTF-8 or GB18030 to a Uchar32 string by calling this function. You can call CreateLogFontForMChar2UChar function to create a dummy logfont object for this purpose in order to expense a minimal memory. More...

Modules

 White Space Rules
 The white space rule indicates GetUCharsUntilParagraphBoundary.
 
 Glyph Rendering Flags
 The glyph rendering flags indicate GetGlyphsExtentFromUChars and CreateLayout how to lay out the text:
 

Data Structures

struct  _GLYPHEXTINFO
 
struct  _GLYPHPOS
 

Macros

#define GLYPHBMP_TYPE_MONO   0x00
 
#define GLYPHBMP_TYPE_GREY   0x01
 
#define GLYPHBMP_TYPE_GREY4b   0x02
 
#define GLYPHBMP_TYPE_SUBPIXEL   0x03
 
#define GLYPHBMP_TYPE_PRERENDER   0x04
 
#define UCHAR2ACHAR(uc)   ((uc) | 0x80000000)
 The macro to convert a Uchar32 value to Achar32 value. More...
 

Typedefs

typedef struct _ACHARMAPINFO ACHARMAPINFO
 Data type of struct _ACHARMAPINFO. More...
 
typedef struct _GLYPHINFO GLYPHINFO
 Data type of struct _GLYPHINFO. More...
 
typedef struct _GLYPHEXTINFO GLYPHEXTINFO
 
typedef struct _GLYPHPOS GLYPHPOS
 
typedef struct _TEXTRUNS TEXTRUNS
 
typedef struct _LAYOUT LAYOUT
 
typedef struct _LAYOUTLINE LAYOUTLINE
 
typedef int BOOL
 A type definition for boolean value. More...
 

Enumerations

enum  ACHARSHAPETYPE
 Achar32 shape type. More...
 

Functions

MG_EXPORT Achar32 GUIAPI GetACharValue (LOGFONT *logfont, const char *mchar, int mchar_len, const char *pre_mchar, int pre_len)
 Get the character value of a multi-byte character. More...
 
MG_EXPORT int GUIAPI GetNextUChar (LOGFONT *logfont, const char *mchar, int mchar_len, Uchar32 *uc)
 Get the Uchar32 value (Unicode code point) of a multi-byte character in specified LOGFONT object. More...
 
MG_EXPORT Uint32 GUIAPI GetACharType (LOGFONT *logfont, Achar32 chv)
 Retrieve the basic type, the general cateory of Unicode, and the break class of Unicode of an abstract character. More...
 
MG_EXPORT Achar32 GUIAPI GetShapedAChar (LOGFONT *logfont, const char *mchar, int mchar_len, ACHARSHAPETYPE shape_type)
 Get the glyph shape of a character. More...
 
MG_EXPORT BOOL GUIAPI GetMirrorAChar (LOGFONT *logfont, Achar32 chv, Achar32 *mirrored)
 Get the mirrored abstract character if possible. More...
 
MG_EXPORT BidiType GUIAPI GetACharBidiType (LOGFONT *log_font, Achar32 chv)
 Retrieve the BIDI type of an abstract character. More...
 
MG_EXPORT int GUIAPI BIDIGetTextLogicalAChars (LOGFONT *log_font, const char *text, int text_len, Achar32 **achars, ACHARMAPINFO **achars_map)
 Get logical achars string of the text. More...
 
MG_EXPORT void GUIAPI BIDIGetTextRangesLog2Vis (LOGFONT *log_font, const 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 int GUIAPI BIDIGetTextVisualAChars (LOGFONT *log_font, const char *text, int text_len, Achar32 **achars, ACHARMAPINFO **achars_map)
 Get visual achars and glyph_map info relative with logical string byte index. More...
 
MG_EXPORT BOOL GUIAPI BIDILogAChars2VisACharsEx (LOGFONT *log_font, Achar32 *achars, int nr_achars, int pel, void *extra, CB_REVERSE_ARRAY cb_reverse_extra)
 Reorder the specified logical glyph string in visual order and reorder an extra array to reflect the visule order of the achars. More...
 
MG_EXPORT Achar32 *GUIAPI BIDILogAChars2VisAChars (LOGFONT *log_font, Achar32 *achars, int nr_achars, ACHARMAPINFO *achars_map)
 Reorder the specified logical glyph string in visual order and reorder glyph map if specified. More...
 
MG_EXPORT int GUIAPI GetACharsExtent (HDC hdc, Achar32 *achars, int nr_achars, SIZE *size)
 Get visual extent value of an achar string. More...
 
MG_EXPORT int GUIAPI GetACharsExtentPoint (HDC hdc, Achar32 *achars, int nr_achars, int max_extent, SIZE *size)
 Get the visual extent value of an achar string. More...
 
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 GetGlyphValueAlt (LOGFONT *logfont, Achar32 chv)
 Get the LOGFONT glyph value of an abstract 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 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 an glyph string. More...
 
MG_EXPORT int GUIAPI GetGlyphInfo (LOGFONT *logfont, Glyph32 glyph_value, GLYPHINFO *glyph_info)
 Retrieve the information of a glyph. More...
 
MG_EXPORT int GUIAPI GetUCharsUntilParagraphBoundary (LOGFONT *logfont, const char *mstr, int mstr_len, Uint8 wsr, Uchar32 **uchars, int *nr_uchars)
 Convert a multi-byte character string to a Unicode character (Uchar32) string until the end of text (null character) or an explicit paragraph boundary encountered. More...
 
MG_EXPORT Uchar32 GUIAPI AChar2UChar (LOGFONT *logfont, Achar32 chv)
 Get Uchar32 value (Unicode wide character value) from a LOGFONT abstract character value. More...
 
MG_EXPORT int GUIAPI AChars2UChars (LOGFONT *logfont, const Achar32 *chs, Uchar32 *ucs, int n)
 Convert an Achar32 array to Unicode character array. More...
 
MG_EXPORT BOOL GUIAPI UChar2AChar (LOGFONT *logfont, Uchar32 uc, Achar32 *ac)
 Get the LOGFONT Achar32 value from a Unicode character value. More...
 
MG_EXPORT int GUIAPI UChars2AChars (LOGFONT *logfont, const Uchar32 *ucs, Achar32 *acs, int n)
 Convert an Uchar32 array to Unicode character array. More...
 
MG_EXPORT int GUIAPI GetGlyphsExtentFromUChars (LOGFONT *logfont_upright, const Achar32 *uchars, int nr_uchars, const BreakOppo *break_oppos, Uint32 render_flags, int x, int y, int letter_spacing, int word_spacing, int tab_size, int max_extent, SIZE *line_size, Glyph32 *glyphs, GLYPHEXTINFO *glyph_ext_info, GLYPHPOS *glyph_pos, LOGFONT **logfont_sideways)
 Get the visual extent info of all glyphs fitting in the specified maximal output extent. More...
 
MG_EXPORT TEXTRUNS *GUIAPI CreateTextRuns (const Uchar32 *ucs, int nr_ucs, LanguageCode lang_code, ParagraphDir base_dir, const char *logfont_name, RGBCOLOR color, RGBCOLOR bg_color, BreakOppo *break_oppos)
 Split a Uchar32 paragraph string in mixed scripts into text runs. More...
 
MG_EXPORT BOOL GUIAPI SetFontNameInTextRuns (TEXTRUNS *truns, int start_index, int length, const char *logfont_name)
 Set logfont name of text runs. More...
 
const MG_EXPORT char *GUIAPI GetFontNameInTextRuns (const TEXTRUNS *truns, int index)
 
MG_EXPORT BOOL GUIAPI SetTextColorInTextRuns (TEXTRUNS *truns, int start_index, int length, RGBCOLOR color)
 Set text color in a TEXTRUNS object. More...
 
MG_EXPORT RGBCOLOR GUIAPI GetTextColorInTextRuns (const TEXTRUNS *truns, int index)
 
MG_EXPORT BOOL GUIAPI SetBackgroundColorInTextRuns (TEXTRUNS *truns, int start_index, int length, RGBCOLOR color)
 Set background color in a TEXTRUNS object. More...
 
MG_EXPORT RGBCOLOR GUIAPI GetBackgroundColorInTextRuns (const TEXTRUNS *truns, int index)
 
MG_EXPORT BOOL GUIAPI DestroyTextRuns (TEXTRUNS *truns)
 Destroy the glyph run info object. It also frees all data allocated for shapping and layouting the glyphs. More...
 
MG_EXPORT BOOL GUIAPI InitBasicShapingEngine (TEXTRUNS *truns)
 Initialize the base shaping engine for a TEXTRUNS object. More...
 
MG_EXPORT BOOL GUIAPI InitComplexShapingEngine (TEXTRUNS *truns)
 Initialize the complex shaping engine for a TEXTRUNS object. More...
 
MG_EXPORT LAYOUT *GUIAPI CreateLayout (const TEXTRUNS *truns, Uint32 render_flags, const BreakOppo *break_oppos, BOOL persist_lines, int max_line_extent, int indent, int letter_spacing, int word_spacing, int tab_size, int *tabs, int nr_tabs)
 Create layout information structure for laying out a paragraph. More...
 
MG_EXPORT BOOL GUIAPI DestroyLayout (LAYOUT *layout)
 Destroy the specified layout information structure. More...
 
MG_EXPORT LAYOUTLINE *GUIAPI LayoutNextLine (LAYOUT *layout, LAYOUTLINE *prev_line, int max_extent, BOOL last_line, CB_GLYPH_LAID_OUT cb_laid_out, GHANDLE ctxt)
 Layout the next line of a paragraph according to the layout information. More...
 
MG_EXPORT BOOL GUIAPI GetLayoutLineSize (const LAYOUTLINE *line, SIZE *line_size)
 Get the size of a layout line. More...
 
MG_EXPORT int GUIAPI CalcLayoutBoundingRect (LAYOUT *layout, int max_line_extent, int max_height, int line_height, int x, int y, RECT *bounding)
 Calculate the bounding rectangle of a layout. More...
 
MG_EXPORT int DrawLayoutLine (HDC hdc, const LAYOUTLINE *line, int x, int y)
 Draw a laid out line at the specific position. More...
 

Detailed Description

To lay out, shape, and render a text in mixed scripts, you should call GetUCharsUntilParagraphBoundary function first to convert a multi-byte string to a Unicode string under the specified white space rule, breaking rule, and transformation rule. For example, converting a general C string in UTF-8 or GB18030 to a Uchar32 string by calling this function. You can call CreateLogFontForMChar2UChar function to create a dummy logfont object for this purpose in order to expense a minimal memory.

If the text is in simple scripts, like Latin or Chinese, you can call GetGlyphsExtentFromUChars function to lay out the paragraph. This function returns a glyph string which can fit in a line with the specified maximal extent and rendering flags. After this, you call DrawGlyphStringEx function to draw the glyph string to the specific position of a DC.

If the text is in complex and/or mixed scripts, like Arabic, Thai, and Indic, you should create a TEXTRUNS object first by calling CreateTextRuns function, then initialize the shaping engine for laying out the text.

MiniGUI provides two types of shaping engine. One is the basic shaping engine. The corresponding function is InitBasicShapingEngine. The other is called complex shaping engine, which is based on HarfBuzz. The corresponding function is InitComplexShapingEngine. The latter one can give you a better shaping result.

After this, you should call CreateLayout to create a layout object for laying out the text, then call LayoutNextLine to lay out the lines one by one.

You can render the laid out lines by calling DrawLayoutLine function.

Finally, you call DestroyLayout and DestroyTextRuns to destroy the layout object and text runs object.

Before rendering the glyphs laid out, you can also call GetLayoutLineRect to get the line rectangle, or call CalcLayoutBoundingRect to get the bounding rectangle of one paragraph.

These new APIs provide a very flexible implementation for your apps to process the complex scripts.

Note that MiniGUI uses Achar32 type for an abstract character index value under a certain charset/encoding, and uses Glyph32 type for the glyph index value in a device font.

Under Unicode charset or encodings, the abstract character index value will be identical to the Unicode code point, i.e., Achar32 is equivalent to Uchar32 under this situation.

Macro Definition Documentation

◆ GLYPHBMP_TYPE_GREY

#define GLYPHBMP_TYPE_GREY   0x01

The type of glyph bitmap: grey (8-bit)

Definition at line 12959 of file gdi.h.

◆ GLYPHBMP_TYPE_GREY4b

#define GLYPHBMP_TYPE_GREY4b   0x02

The type of glyph bitmap: grey (4-bit)

Definition at line 12961 of file gdi.h.

◆ GLYPHBMP_TYPE_MONO

#define GLYPHBMP_TYPE_MONO   0x00

The type of glyph bitmap: monochrome

Definition at line 12957 of file gdi.h.

◆ GLYPHBMP_TYPE_PRERENDER

#define GLYPHBMP_TYPE_PRERENDER   0x04

The type of glyph bitmap: pre-rendered BITMAP object

Definition at line 12965 of file gdi.h.

◆ GLYPHBMP_TYPE_SUBPIXEL

#define GLYPHBMP_TYPE_SUBPIXEL   0x03

The type of glyph bitmap: subpixel

Definition at line 12963 of file gdi.h.

◆ UCHAR2ACHAR

#define UCHAR2ACHAR (   uc)    ((uc) | 0x80000000)

The macro to convert a Uchar32 value to Achar32 value.

Note
The converted Achar32 value should be used only with LOGFONT objects in Unicode charset (encodings like UTF-8, UTF-16LE, and UTF-16BE).
See also
UChar2AChar, UChars2AChars

Since 4.0.0

Definition at line 13207 of file gdi.h.

Typedef Documentation

◆ ACHARMAPINFO

typedef struct _ACHARMAPINFO ACHARMAPINFO

Data type of struct _ACHARMAPINFO.

◆ BOOL

typedef BOOL

A type definition for boolean value.

The prototype of callback function for LayoutNextLine.

This callback function will be called by LayoutNextLine when a glyph is laid out.

Parameters
ctxtThe context value passed to LayoutNextLine.
glyph_valueThe glyph value.
glyph_posThe glyph position and orientation information.
render_dataThe shaping data of the glyph.
See also
LayoutNextLine, GLYPHPOS, RENDERDATA

Since 4.0.0

Definition at line 343 of file common.h.

◆ GLYPHEXTINFO

typedef struct _GLYPHEXTINFO GLYPHEXTINFO

The glyph extent information.

◆ GLYPHINFO

typedef struct _GLYPHINFO GLYPHINFO

Data type of struct _GLYPHINFO.

◆ GLYPHPOS

typedef struct _GLYPHPOS GLYPHPOS

The glyph position information.

◆ LAYOUT

typedef struct _LAYOUT LAYOUT

The type for a layout object. The fields in this structure are invisible to users.

Definition at line 13954 of file gdi.h.

◆ LAYOUTLINE

typedef struct _LAYOUTLINE LAYOUTLINE

The type for a layout line object. The fields in this structure are invisible to users.

Definition at line 13960 of file gdi.h.

◆ TEXTRUNS

typedef struct _TEXTRUNS TEXTRUNS

The type for a text runs object. The fields in this structure are invisible to users.

Definition at line 13723 of file gdi.h.

Enumeration Type Documentation

◆ ACHARSHAPETYPE

enum typedef enum ACHARSHAPETYPE

Achar32 shape type.

Definition at line 12456 of file gdi.h.

Function Documentation

◆ AChar2UChar()

AChar2UChar ( LOGFONT logfont,
Achar32  chv 
)

Get Uchar32 value (Unicode wide character value) from a LOGFONT abstract character value.

Only valid for UNICODE.

Parameters
logfontThe LOGFONT object
chvThe LOGFONT character value.
Returns
The Uchar32 value (Unicode code point) of the abstract character.
Note
Only available when support for UNICODE is enabled.

Since 4.0.0

◆ AChars2UChars()

int AChars2UChars ( LOGFONT logfont,
const Achar32 *  achs,
Uchar32 *  ucs,
int  n 
)

Convert an Achar32 array to Unicode character array.

Only valid for UNICODE.

Parameters
logfontThe LOGFONT object
achsThe array of the abstract character values.
ucsThe buffer to store the converted Uchar32 characters.
nThe length of the Achar32 array.
Returns
The number of characters converted successfully.
Note
Only available when support for UNICODE is enabled.

Since 4.0.0

◆ BIDIGetTextLogicalAChars()

int GUIAPI BIDIGetTextLogicalAChars ( LOGFONT log_font,
const char *  text,
int  text_len,
Achar32 **  achars,
ACHARMAPINFO **  achars_map 
)

Get logical achars string of the text.

Parameters
log_fontThe logical font.
textThe logical text string.
text_lenThe lenght of the logical text string in bytes.
acharsThe pointer to the logical glyph string.
achars_mapThe position map from the logical achars string to the logical text.
Returns
The length of the logical glyph string.
Note
This is an API of the legacy implementation of bidirectional algorithm. It is used to support text in ISO8859-6 and ISO8859-8 charsets (for Arabic and Hebrew languages respectively). New apps should enable the support for Unicode charset, and use the new implementation of Unicode Bidirectional Algorithm (UBA).
See also
UBidiReorderLine, GetShapedGlyphsBasic, GetShapedGlyphsComplex, Operators for Unicode character and string, ACHARMAPINFO

◆ BIDIGetTextRangesLog2Vis()

void GUIAPI BIDIGetTextRangesLog2Vis ( LOGFONT log_font,
const 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.
Note
This is an API of the legacy implementation of bidirectional algorithm. It is used to support text in ISO8859-6 and ISO8859-8 charsets (for Arabic and Hebrew languages respectively). New apps should enable the support for Unicode charset, and use the new implementation of Unicode Bidirectional Algorithm (UBA).
See also
UBidiReorderLine, GetShapedGlyphsBasic, GetShapedGlyphsComplex, Operators for Unicode character and string

◆ BIDIGetTextVisualAChars()

int GUIAPI BIDIGetTextVisualAChars ( LOGFONT log_font,
const char *  text,
int  text_len,
Achar32 **  achars,
ACHARMAPINFO **  achars_map 
)

Get visual achars 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.
acharsThe pointer to the visual glyph string.
achars_mapThe position map from visual achars string to the logical text.
Returns
The length of the visual glyph string.
Note
This is an API of the legacy implementation of bidirectional algorithm. It is used to support text in ISO8859-6 and ISO8859-8 charsets (for Arabic and Hebrew languages respectively). New apps should enable the support for Unicode charset, and use the new implementation of Unicode Bidirectional Algorithm (UBA).
See also
UBidiReorderLine, GetShapedGlyphsBasic, GetShapedGlyphsComplex, Operators for Unicode character and string

◆ BIDILogAChars2VisAChars()

BOOL GUIAPI BIDILogAChars2VisAChars ( LOGFONT log_font,
Achar32 *  achars,
int  nr_achars,
ACHARMAPINFO achars_map 
)

Reorder the specified logical glyph string in visual order and reorder glyph map if specified.

This function reorders the logical glyph string in place to visual order. If achars_map is not NULL, it also reorders the map to reflect the visual order.

Parameters
log_fontThe logical font.
acharsThe pointer to the glyph string.
nr_acharsThe length of the glyph string.
achars_mapThe position map returned by BIDIGetTextLogicalAChars; can be NULL.
Returns
The pointer to the visual achars; NULL when error.
Note
This is an API of the legacy implementation of bidirectional algorithm. It is used to support text in ISO8859-6 and ISO8859-8 charsets (for Arabic and Hebrew languages respectively). New apps should enable the support for Unicode charset, and use the new implementation of Unicode Bidirectional Algorithm (UBA).
See also
UBidiReorderLine, GetShapedGlyphsBasic, GetShapedGlyphsComplex, Operators for Unicode character and string

◆ BIDILogAChars2VisACharsEx()

BOOL GUIAPI BIDILogAChars2VisACharsEx ( LOGFONT log_font,
Achar32 *  achars,
int  nr_achars,
int  pel,
void *  extra,
CB_REVERSE_ARRAY  cb_reverse_extra 
)

Reorder the specified logical glyph string in visual order and reorder an extra array to reflect the visule order of the achars.

This function reorders the logical glyph string in place to visual order. If extra and cb_reverse_extra are both not NULL, it also reorders the array pointed by extra by calling the callback function cb_reverse_extra.

Parameters
log_fontThe logical font.
acharsThe pointer to the glyph string.
nr_acharsThe length of the glyph string.
pelThe paragraph embedding level, can be one of the following values:
  • 0: Level 0 (left to right)
  • 1: Level 1 (right to left)
  • others: Determine according to the heuristic given in steps P2 and P3 of the Unicode bidirectional algorithm.
extraThe pointer to the extra array to reorder; can be NULL.
cb_reverse_extraThe callback function to reverse the extra array.
Returns
TRUE on success, otherwise FALSE.
Note
This is an API of the legacy implementation of bidirectional algorithm. It is used to support text in ISO8859-6 and ISO8859-8 charsets (for Arabic and Hebrew languages respectively). New apps should enable the support for Unicode charset, and use the new implementation of Unicode Bidirectional Algorithm (UBA).
See also
UBidiReorderLine, GetShapedGlyphsBasic, GetShapedGlyphsComplex, Operators for Unicode character and string

◆ CalcLayoutBoundingRect()

int GUIAPI CalcLayoutBoundingRect ( LAYOUT layout,
int  max_line_extent,
int  max_height,
int  line_height,
int  x,
int  y,
RECT bounding 
)

Calculate the bounding rectangle of a layout.

This function calculates the bounding rectangle of the specific layout object layout.

Parameters
layoutThe LAYOUT object.
max_line_extentThe maximal line extent; only effective if the line extent mode of the layout object is variable.
max_heightThe maximal height of the lines; no limit if it is less than 0.
line_heightThe line height. If it is less than 0, this function will try to determine the line height automatically.
xThe x-position of first line.
yThe y-position of first line.
boundingThe buffer to receive the result.
Returns
The number of lines laid out.
Note
The position coordinates of the first line are with respect to the top-left corner of the output rectangle if the writing mode is GRF_WRITING_MODE_HORIZONTAL_TB or GRF_WRITING_MODE_VERTICAL_LR, the bottom-left corner if the writing mode is GRF_WRITING_MODE_HORIZONTAL_BT, the top-right corner if the writing mode is GRF_WRITING_MODE_VERTICAL_RL.
See also
CreateLayout, DestroyLayout, LayoutNextLine GetLayoutLineRect

Since 4.0.0

◆ CreateLayout()

LAYOUT *GUIAPI CreateLayout ( const TEXTRUNS truns,
Uint32  render_flags,
const BreakOppo break_oppos,
BOOL  persist_lines,
int  max_line_extent,
int  indent,
int  letter_spacing,
int  word_spacing,
int  tab_size,
int *  tabs,
int  nr_tabs 
)

Create layout information structure for laying out a paragraph.

This function creates a LAYOUT object for laying out a TEXTRUNS object truns, which represents a Uchar32 paragraph in mixed scripts ready to lay out.

Parameters
trunsThe TEXTRUNS object.
render_flagsThe render flags; see glyph_render_flags.
break_opposThe breaking opportunities of the paragraph.
persist_linesWhether to persist the lines laid out.
max_line_extentThe fixed maximal line extent.
indentThe indentation value.
letter_spacingThis parameter specifies additional spacing (commonly called tracking) between adjacent glyphs.
word_spacingThis parameter specifies the additional spacing between words.
tab_sizeThe tab size used to render preserved tab characters.
tabsThe array of the tab stops; can be NULL.
nr_tabsThe length of the tab stops array.
Returns
The LAYOUT object; NULL for error.
See also
CreateTextRuns, InitBasicShapingEngine, InitComplexShapingEngine, UStrGetBreaks, LayoutNextLine

Since 4.0.0

◆ CreateTextRuns()

TEXTRUNS *GUIAPI CreateTextRuns ( const Uchar32 *  ucs,
int  nr_ucs,
LanguageCode  lang_code,
ParagraphDir  base_dir,
const char *  logfont_name,
RGBCOLOR  color,
RGBCOLOR  bg_color,
BreakOppo break_oppos 
)

Split a Uchar32 paragraph string in mixed scripts into text runs.

This function splits the Uchar32 paragraph ucs in mixed scripts into text runs, and returns a TEXTRUNS object.

Parameters
ucsThe Uchar32 string returned by GetUCharsUntilParagraphBoundary.
nr_ucsThe length of the Uchar32 string.
lang_codeThe language code.
base_dirThe base direction of the paragraph.
logfont_nameThe default logfont name. You can change the font of some text in the paragraph by calling SetFontNameInTextRuns.
colorThe default text color. You can change the text color of some text in the paragraph by calling SetTextColorInTextRuns.
bg_colorThe default background color. You can change the background color of some text in the paragraph by calling SetBackgroundColorInTextRuns. If the background is transparent, please pass MakeRGBA(0,0,0,0) for this argument.
break_opposIf not NULL, the break opportunities will be tailored according to the script type of every text run. Please skip the first entry when you pass the pointer.
Returns
The TEXTRUNS object create; NULL for failure.
Note
This function assumes that you passed one paragraph of the logical Unicode string. Therefore, you'd better to call this function after calling GetUCharsUntilParagraphBoundary.
Only available when support for UNICODE is enabled.
See also
GetUCharsUntilParagraphBoundary, UStrGetBreaks, SetFontNameInTextRuns, SetTextColorInTextRuns

Since 4.0.0

◆ DestroyLayout()

BOOL GUIAPI DestroyLayout ( LAYOUT layout)

Destroy the specified layout information structure.

This function destroy the specific layout information object layout.

Parameters
layoutThe LAYOUT object.
Returns
TRUE for success, FALSE otherwise.
See also
CreateLayout

Since 4.0.0

◆ DestroyTextRuns()

BOOL GUIAPI DestroyTextRuns ( TEXTRUNS truns)

Destroy the glyph run info object. It also frees all data allocated for shapping and layouting the glyphs.

This function destroies the specific TEXTRUNS object truns.

Parameters
trunsThe TEXTRUNS object.
Returns
TRUE for success, FALSE otherwise.
Note
Only available when support for UNICODE is enabled.
See also
CreateTextRuns

Since 4.0.0

◆ DrawGlyph()

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.

◆ DrawLayoutLine()

DrawLayoutLine ( HDC  hdc,
const LAYOUTLINE line,
int  x,
int  y 
)

Draw a laid out line at the specific position.

This function draws a laied out line at the specified position.

Parameters
hdcThe device context.
lineThe laid out LAYOUTLINE object. It should be one returned by LayoutNextLine.
xThe buffer contained the x-corrdinate of the output position of the first glyph in the line. The x-corrdinate of the next line will be returned through this buffer as well.
yThe buffer contained the y-corrdinate of the output position of the first glyph in the line. The y-corrdinate of the next line will be returned through this buffer as well.
Returns
The number of glyphs drawn.
Note
The position coordinates of the first line are with respect to the top-left corner of the output rectangle if the writing mode is GRF_WRITING_MODE_HORIZONTAL_TB or GRF_WRITING_MODE_VERTICAL_LR, the bottom-left corner if the writing mode is GRF_WRITING_MODE_HORIZONTAL_BT, the top-right corner if the writing mode is GRF_WRITING_MODE_VERTICAL_RL.
See also
CreateLayout, DestroyLayout, LayoutNextLine

Since 4.0.0

◆ GetACharBidiType()

BidiType GUIAPI GetACharBidiType ( LOGFONT logfont,
Achar32  chv 
)

Retrieve the BIDI type of an abstract character.

This function retrieves the BIDI type of an abstract character.

Parameters
logfontThe logical font.
chvThe abstract character value.
Returns
The BIDI type of chv; BIDI_TYPE_INVALID on failure.
Note
This is an API of the legacy implementation of bidirectional algorithm. It is used to support text in ISO8859-6 and ISO8859-8 charsets (for Arabic and Hebrew languages respectively). New apps should enable the support for Unicode charset, and use the new implementation of Unicode Bidirectional Algorithm (UBA).
See also
UBidiReorderLine, GetShapedGlyphsBasic, GetShapedGlyphsComplex, Operators for Unicode character and string, GetACharType, BIDI types

◆ GetACharsExtent()

int GUIAPI GetACharsExtent ( HDC  hdc,
Achar32 *  achars,
int  nr_achars,
SIZE size 
)

Get visual extent value of an achar string.

This function gets the extent value of an achar string on a DC. Note that this function will ignore all breaks in the achar string.

Parameters
hdcThe device context.
acharsThe pointer to the achar string.
nr_acharsThe length of the achar string.
sizeThe buffer restoring the extents of the achar strings.
Returns
The extent of the achar string.

◆ GetACharsExtentPoint()

int GUIAPI GetACharsExtentPoint ( HDC  hdc,
Achar32 *  achars,
int  nr_achars,
int  max_extent,
SIZE size 
)

Get the visual extent value of an achar string.

This function gets the visual extent value of a glpyh string. Note that this function ignore all breaks in the achar string.

Parameters
hdcThe device context.
acharsThe pointer to the achar string.
nr_acharsThe length of the achar string len.
max_extentThe maximal output extent value.
sizeThe real extent of all visual achars in the achar string.
Returns
The the index of the last achar which can be fit to the extent.
See also
GetACharsExtentPointEx

◆ GetACharType()

Uint32 GUIAPI GetACharType ( LOGFONT logfont,
Achar32  chv 
)

Retrieve the basic type, the general cateory of Unicode, and the break class of Unicode of an abstract character.

This function retrieves the basic type, the general category defined by Unicode terms, and the break class defined by Unicode of an abstract character.

Parameters
logfontThe logical font.
chvAn Achar32 value.
Returns
The type of the specified Achar32 value. You can use the following macros to extract the basic type, the break type, and the bidi type respectively:
Note
The basic type is defined by MiniGUI for basic rendering for some complex shaping glyphs.
The general category and the break class are only available when the support for Unicode is enabled.
See also
GetACharBidiType, Abstract Character Types

◆ GetACharValue()

Achar32 GUIAPI GetACharValue ( LOGFONT logfont,
const char *  mchar,
int  mchar_len,
const char *  pre_mchar,
int  pre_len 
)

Get the character 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 abstract character value of the multi-byte character.

◆ GetBackgroundColorInTextRuns()

MG_EXPORT RGBCOLOR GUIAPI GetBackgroundColorInTextRuns ( const TEXTRUNS truns,
int  index 
)

Get the background color of a specific character in a TEXTRUNS object.

Since 4.0.0

◆ GetFontNameInTextRuns()

const MG_EXPORT char* GUIAPI GetFontNameInTextRuns ( const TEXTRUNS truns,
int  index 
)

Get the font name of a specific character in a TEXTRUNS object.

Since 4.0.0

◆ GetGlyphInfo()

int GUIAPI GetGlyphInfo ( LOGFONT logfont,
Glyph32  glyph_value,
GLYPHINFO glyph_info 
)

Retrieve 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
0 if success, otherwise on failure.
See also
GLYPHINFO

◆ GetGlyphsExtent()

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. Note that this function will ignore all special types in the glyph string.

Parameters
hdcThe device context.
glyphsThe pointer to the glyph string.
nr_glyphsThe length of the glyph string.
sizeThe buffer restoring the extents of the glyph string.
Returns
The extent of the glyph string.
See also
GetGlyphsExtentFromUChars

◆ GetGlyphsExtentFromUChars()

int GUIAPI GetGlyphsExtentFromUChars ( LOGFONT logfont_upright,
const Achar32 *  uchars,
int  nr_uchars,
const BreakOppo break_oppos,
Uint32  render_flags,
int  x,
int  y,
int  letter_spacing,
int  word_spacing,
int  tab_size,
int  max_extent,
SIZE line_size,
Glyph32 *  glyphs,
GLYPHEXTINFO glyph_ext_info,
GLYPHPOS glyph_pos,
LOGFONT **  logfont_sideways 
)

Get the visual extent info of all glyphs fitting in the specified maximal output extent.

This function gets the visual extent information of a glyph string which can fit a line with the specified maximal extent.

Parameters
logfont_uprightThe logfont used to render the uchar string. Note that the charset/encoding of this logfont should be Unicode, such as UTF-8, UTF-16LE, and UTF-16BE.
ucharsThe pointer to the achar string.
nr_ucharsThe number of the glyphs.
break_opposThe pointer to the break opportunities array of the glyphs. It should be returned by UStrGetBreaks. However, the caller should skip the first unit (the break opportunity before the first glyph) when passing the pointer to this function.
render_flagsThe render flags; see glyph_render_flags.
xThe x-position of first glyph.
yThe y-position of first glyph.
letter_spacingThis parameter specifies additional spacing (commonly called tracking) between adjacent glyphs.
word_spacingThis parameter specifies the additional spacing between words.
tab_sizeThe tab size used to render preserved tab characters.
max_extentThe maximal output extent value. No limit when it is < 0.
line_sizeThe buffer to store the line extent info; can be NULL.
glyphsThe buffer to store the glyphs, which can fit in the max extent; cannot be NULL.
glyph_ext_infoThe buffer to store the extent info of all glyphs which can fit in the max extent; can be NULL.
glyph_posThe buffer to store the positions and orientations of all glyphs which can fit in the max extent; cannot be NULL.
logfont_sidewaysThe buffer to store the LOGFONT object created by this function for sideways glyphs if text orientation specified in render_flags is mixed (GRF_TEXT_ORIENTATION_MIXED) or sideways (GRF_TEXT_ORIENTATION_SIDEWAYS). If *logfont_sidways is not NULL, this function will try to use this LOGFONT object for sideways glyphs.
Returns
The number of achars which can be fit to the maximal extent. The glyphs and the extent info of every glyphs which are fit in the maximal extent will be returned through glyphs and glyph_ext_info (if it was not NULL), and the line extent info will be returned through line_size if it was not NULL. Note the function will return immediately if it encounters a mandatory breaking.
Note
Only available when support for UNICODE is enabled.
This function ignore the special types (such as diacritic mark, vowel, contextual form, ligature, and so on) of the Unicode characters. Please see GetShapedGlyphsBasic and GetShapedGlyphsComplex for the purpose of shaping glyphs according to the language, the script (writing system), and the contextual shaping features.
Any invisible format character including SOFT HYPHEN (U+00AD) will be ignored (suppressed).
The LOGFONT object logfont_upright should have the rotation be 0° for upright glyphs and logfont_sideways will have the rotation be 90° for sideways glyphs.
The position coordinates of the first glyph are with respect to the top-left corner of the output rectangle if the writing mode is GRF_WRITING_MODE_HORIZONTAL_TB or GRF_WRITING_MODE_VERTICAL_LR, otherwise they are with respect to the top-right corner of the output rectangle. However, the positions contained in glyph_pos are always with respect to the top-left corner of the resulting output line rectangle.
See also
UStrGetBreaks, DrawGlyphStringEx, GLYPHEXTINFO, Glyph Rendering Flags

Since 4.0.0

◆ GetGlyphsExtentPoint()

int GUIAPI GetGlyphsExtentPoint ( HDC  hdc,
Glyph32 *  glyphs,
int  nr_glyphs,
int  max_extent,
SIZE size 
)

Get the visual extent value of an glyph string.

This function gets the visual extent value of a glpyh string. Note that this function ignore all special types in the glyph 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.
See also
GetGlyphsExtentFromUChars

◆ GetGlyphValue()

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.

◆ GetGlyphValueAlt()

Glyph32 GUIAPI GetGlyphValueAlt ( LOGFONT logfont,
Achar32  chv 
)

Get the LOGFONT glyph value of an abstract character.

Parameters
logfontThe logical font.
chvThe value of the abstract character.
Returns
The glyph value of the abstract character; INV_GLYPH_VALUE on failure.

◆ GetLayoutLineSize()

BOOL GUIAPI GetLayoutLineSize ( const LAYOUTLINE line,
SIZE line_size 
)

Get the size of a layout line.

This function gets the size of the specific layout line object line.

Parameters
lineThe layout line object.
line_sizeThe buffer to store the result.
Returns
TRUE for success, FALSE otherwise.
See also
CreateLayout, DestroyLayout, LayoutNextLine

Since 4.0.0

◆ GetMirrorAChar()

BOOL GUIAPI GetMirrorAChar ( LOGFONT logfont,
Achar32  chv,
Achar32 *  mirrored 
)

Get the mirrored abstract character if possible.

Parameters
logfontThe logical font.
chvThe abstract character value.
mirroredThe buffer to store the mirrored Achar32 value if the multi-byte character has a mirrored character.
Returns
TRUE if success, FALSE on failure.
Note
This is an API of the legacy implementation of bidirectional algorithm. It is used to support text in ISO8859-6 and ISO8859-8 charsets (for Arabic and Hebrew languages respectively). New apps should enable the support for Unicode charset, and use the new implementation of Unicode Bidirectional Algorithm (UBA).
See also
UBidiReorderLine, GetShapedGlyphsBasic, GetShapedGlyphsComplex, Operators for Unicode character and string

◆ GetNextUChar()

int GUIAPI GetNextUChar ( LOGFONT logfont,
const char *  mchar,
int  mchar_len,
Uchar32 *  uc 
)

Get the Uchar32 value (Unicode code point) of a multi-byte character in specified LOGFONT object.

This function get the Uchar32 value of a mutil-byte character in specified LOGFONT object logfont, which is under speicific charset/encoding.

Parameters
logfontThe logical font.
mcharThe pointer to the multi-byte character.
mchar_lenThe length of mchar in bytes.
ucThe buffer to receive the Uchar32 value.
Returns
The number of bytes consumed, i.e., the lenght of the multi-byte character.

◆ GetShapedAChar()

Achar32 GUIAPI GetShapedAChar ( LOGFONT logfont,
const char *  mchar,
int  mchar_len,
ACHARSHAPETYPE  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 requested shape type.
Returns
The shaped character value.
Note
This is an API of the legacy implementation of bidirectional algorithm. It is used to support text in ISO8859-6 and ISO8859-8 charsets (for Arabic and Hebrew languages respectively). New apps should enable the support for Unicode charset, and use the new implementation of Unicode Bidirectional Algorithm (UBA).
See also
UBidiReorderLine, GetShapedGlyphsBasic, GetShapedGlyphsComplex, Operators for Unicode character and string

◆ GetTextColorInTextRuns()

MG_EXPORT RGBCOLOR GUIAPI GetTextColorInTextRuns ( const TEXTRUNS truns,
int  index 
)

Get the text color of a specific character in a TEXTRUNS object.

Since 4.0.0

◆ GetUCharsUntilParagraphBoundary()

int GUIAPI GetUCharsUntilParagraphBoundary ( LOGFONT logfont,
const char *  mstr,
int  mstr_len,
Uint8  wsr,
Uchar32 **  uchars,
int *  nr_uchars 
)

Convert a multi-byte character string to a Unicode character (Uchar32) string until the end of text (null character) or an explicit paragraph boundary encountered.

This function calculates and allocates the Uchar32 string from a multi-byte string until it encounters the end of text (null character) or an explicit paragraph boundary. It also processes the text according to the specified white space rule wsr and the text transformation rule ctr.

The implementation of this function conforms to the CSS Text Module Level 3:

https://www.w3.org/TR/css-text-3/

Note that you are responsible for freeing the Uchar32 string allocated by this function.

Parameters
logfontThe logfont used to parse the string.
mstrThe pointer to the multi-byte string.
mstr_lenThe length of mstr in bytes.
wsrThe white space rule; see white_space_rules.
ucharsThe pointer to a buffer to store the address of the Uchar32 array which contains the Unicode character values.
nr_ucharsThe buffer to store the number of the allocated Uchar32 array.
Returns
The number of the bytes consumed in mstr; zero on error.
Note
Only available when support for UNICODE is enabled.
See also
DrawGlyphStringEx, White Space Rules, Character Transformation Rules

Since 4.0.0

◆ InitBasicShapingEngine()

BOOL GUIAPI InitBasicShapingEngine ( TEXTRUNS truns)

Initialize the base shaping engine for a TEXTRUNS object.

This function initializes the base shaping engine for the specific TEXTRUNS object truns.

The basic shaping engine performs the basic shaping process according to the Unicode character properties if the script type (writing system) is Arabic. This includes the mirroring/brackets subsititions, and the mandatory ligatures.

For the better shaping glyphs, you can call InitComplexShapingEngine to perform the shaping process based on the data contained in the OpenType Layout tables in the underlaying OpenType fonts or TrueType fonts. MiniGUI uses LGPL'd HarfBuzz to implement the complex shaping engine.

After initializing the shapping engine, you can call CreateLayout to layout the Uchar32 paragraph string.

Parameters
trunsThe TEXTRUNS object.
Returns
TRUE for success, FALSE otherwise.
Note
Only available when support for UNICODE is enabled.
See also
InitComplexShapingEngine, CreateLayout

Since 4.0.0

◆ InitComplexShapingEngine()

BOOL GUIAPI InitComplexShapingEngine ( TEXTRUNS truns)

Initialize the complex shaping engine for a TEXTRUNS object.

This function initializes the complex shaping engine for the specific TEXTRUNS object truns.

The complex shaping engine performs the complex shaping process according to the data contained in the OpenType Layout tables (GSUB, GPOS, and so on) contained in a OpenType font. The complex shaping engine is implemented based on HarfBuzz.

You can call InitBasicShapingEngine to initialize the basic shaping process which shapes the glyphs based on the Unicode character properties instead.

After initializing the shapping engine, you can call CreateLayout to layout the Uchar32 paragraph string.

Parameters
trunsThe TEXTRUNS object.
Returns
TRUE for success, FALSE otherwise.
Note
Only available when the support for UNICODE (_MGCHARSET_UNICODE) and the support for complex scripts (_MGCOMPLEX_SCRIPTS) are enabled.
You must use TrueType/OpenType vector fonts for the complex shaping engine.
See also
InitBasicShapingEngine, CreateLayout

Since 4.0.0

◆ LayoutNextLine()

LAYOUTLINE *GUIAPI LayoutNextLine ( LAYOUT layout,
LAYOUTLINE prev_line,
int  max_extent,
BOOL  last_line,
CB_GLYPH_LAID_OUT  cb_laid_out,
GHANDLE  ctxt 
)

Layout the next line of a paragraph according to the layout information.

This function lays out the next line of in a LAYOUTLINE object layout. If prev_line is NULL, the function will returns the first line.

You can pass the maximal extent of the next line via max_extent to control the output extent of every line. The function will wrap or ellipsize the line according to the rendering flags of the LAYOUT object. You can also control whether to render the next line as the last line of the LAYOUT object via last_line parameter.

The line size will be returned through line_size if it is not NULL. When there is a glyph positioned, the function will call cb_laid_out with the context ctxt. You can draw the glyph to a DC or do anything you want.

The previous line will be release if the LAYOUTLINE object is not persisted. In this way, you can save memory use of the LAYOUTLINE object.

Parameters
layoutThe LAYOUT object.
prev_lineNULL or the previous line object returned by this function.
max_extentThe maximal extent of the next line; No limit if it is less than 0. This parameter is only effective when the line extent mode of the layout object is variable.
last_lineWhether try to lay out all left characters in one line.
cb_laid_outThe callback for one laid out glyph.
ctxtThe context will be passed to cb_laid_out. This parameter is only effective when cb_laid_out is not NULL.
Returns
NULL for no line, otherwise the next line object.
See also
CreateLayout, DestroyLayout, CreateTextRuns

Since 4.0.0

◆ SetBackgroundColorInTextRuns()

MG_EXPORT BOOL GUIAPI SetBackgroundColorInTextRuns ( TEXTRUNS truns,
int  start_index,
int  length,
RGBCOLOR  color 
)

Set background color in a TEXTRUNS object.

This function set a new background color for all text or a part of the text in a TEXTRUNS object truns.

Parameters
trunsThe TEXTRUNS object.
start_indexThe start index of the text which will use the new font name.
lengthThe length of the text which will use the new font name.
colorThe new background color.
Returns
TRUE for success, otherwise FALSE.
Note
If you use the value returned by MakeRGBA(0,0,0,0), the background will be transparent.

Since 4.0.0

◆ SetFontNameInTextRuns()

MG_EXPORT BOOL GUIAPI SetFontNameInTextRuns ( TEXTRUNS truns,
int  start_index,
int  length,
const char *  logfont_name 
)

Set logfont name of text runs.

This function set a new LOGFONT name for all text or a part of the text in a TEXTRUNS object.

Parameters
trunsThe TEXTRUNS object.
start_indexThe start index of the text which will use the new font name.
lengthThe length of the text which will use the new font name.
logfont_nameThe new logfont name.
Returns
TRUE for success, otherwise FALSE.

Since 4.0.0

◆ SetTextColorInTextRuns()

MG_EXPORT BOOL GUIAPI SetTextColorInTextRuns ( TEXTRUNS truns,
int  start_index,
int  length,
RGBCOLOR  color 
)

Set text color in a TEXTRUNS object.

This function set a new text color for all text or a part of the text in a TEXTRUNS object truns.

Parameters
trunsThe TEXTRUNS object.
start_indexThe start index of the text which will use the new font name.
lengthThe length of the text which will use the new font name.
colorThe new text color.
Returns
TRUE for success, otherwise FALSE.

Since 4.0.0

◆ UChar2AChar()

BOOL UChar2AChar ( LOGFONT logfont,
Uchar32  uc,
Achar32 *  ac 
)

Get the LOGFONT Achar32 value from a Unicode character value.

This function converts a Unicode character value uc to the abstract character value which is defined by the charset of the LOGFONT object logfont.

Parameters
logfontThe LOGFONT object
ucThe Unicode character value.
acThe buffer to store the converted Achar32 value.
Returns
TRUE for success, otherwise FALSE. When the return value is FALSE, it means that the charset of the LOGFONT object does not contain a code point for the Unicode character.
Note
Only available when support for UNICODE is enabled.
See also
UChars2AChars, UCHAR2ACHAR

Since 4.0.0

◆ UChars2AChars()

int UChars2AChars ( LOGFONT logfont,
const Uchar32 *  ucs,
Achar32 *  acs,
int  n 
)

Convert an Uchar32 array to Unicode character array.

Only valid for UNICODE.

Parameters
logfontThe LOGFONT object
ucsThe array of the Unicode characters.
acsThe buffer to store the converted abstract characters.
nThe length of the Uchar32 array.
Returns
The number of characters converted successfully.
Note
Only available when support for UNICODE is enabled.
See also
UChar2AChar, UCHAR2ACHAR

Since 4.0.0