mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-24 09:14:09 +08:00
Add UCharGetType, UCharGetBreak, UCharGetBIDIType, and UCharGetMirror for completeness
This commit is contained in:
+23
-2
@@ -7421,7 +7421,19 @@ MG_EXPORT int GUIAPI WCS2MBSEx (PLOGFONT log_font, unsigned char* dest,
|
||||
WCS2MBSEx (log_font, dest, wcs, wcs_len, sizeof (wchar_t) == 4, \
|
||||
n, NULL)
|
||||
|
||||
/** The function determines whether a glyph is alphanumeric. */
|
||||
/** The function determines the general category (basic type) of a UNICODE character. */
|
||||
MG_EXPORT int GUIAPI UCharGetType(Uchar32 uc);
|
||||
|
||||
/** The function determines the break property of a UNICODE character. */
|
||||
MG_EXPORT int GUIAPI UCharGetBreak(Uchar32 uc);
|
||||
|
||||
/** The function determines the BIDI type of a UNICODE character. */
|
||||
MG_EXPORT unsigned int GUIAPI UCharGetBIDIType(Uchar32 uc);
|
||||
|
||||
/** The function returns the mirror character of a UNICODE character. */
|
||||
MG_EXPORT BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32* mirrored);
|
||||
|
||||
/** The function determines whether a character is alphanumeric. */
|
||||
MG_EXPORT BOOL GUIAPI IsUCharAlnum(Uchar32 uc);
|
||||
|
||||
/** The function determines whether a character is alphabetic (i.e. a letter). */
|
||||
@@ -10371,6 +10383,11 @@ typedef enum {
|
||||
* content language \a content_language, writing system \a writing_system,
|
||||
* white space rule \a space_rule, and transformation rule \a trans_rule.
|
||||
*
|
||||
* The implementation of this function conforms to UNICODE LINE BREAKING
|
||||
* ALGORITHM:
|
||||
*
|
||||
* https://www.unicode.org/reports/tr14/tr14-39.html
|
||||
*
|
||||
* The function will return if it encounters any hard line break or the null
|
||||
* character. The hard line break will be included in the returned glyphs if
|
||||
* there was one.
|
||||
@@ -10527,6 +10544,10 @@ typedef struct _GLYPHPOSORT
|
||||
* The y coordinate of the glyph position.
|
||||
*/
|
||||
int y;
|
||||
/**
|
||||
* Whether suppress the glyph.
|
||||
*/
|
||||
unsigned char suppressed:1;
|
||||
/**
|
||||
* The orientation of the glyph; can be one of the following values:
|
||||
* - GLYPH_ORIENTATION_UPRIGHT\n
|
||||
@@ -10534,7 +10555,7 @@ typedef struct _GLYPHPOSORT
|
||||
* - GLYPH_ORIENTATION_SIDEWAYS\n
|
||||
* the glyph rotates 90° clockwise from horizontal.
|
||||
*/
|
||||
int ort;
|
||||
unsigned char ort:2;
|
||||
} GLYPHPOSORT;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4413,6 +4413,29 @@ BOOL IsCompatibleCharset (const char* charset, CHARSETOPS* ops)
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
int GUIAPI UCharGetType(Uchar32 uc)
|
||||
{
|
||||
return TYPE(uc);
|
||||
}
|
||||
|
||||
/** The function determines the break type of a UNICODE character. */
|
||||
int GUIAPI UCharGetBreak(Uchar32 uc)
|
||||
{
|
||||
return PROP(uc);
|
||||
}
|
||||
|
||||
/** The function determines the BIDI type of a UNICODE character. */
|
||||
unsigned int GUIAPI UCharGetBIDIType(Uchar32 uc)
|
||||
{
|
||||
return unicode_bidi_glyph_type(uc);
|
||||
}
|
||||
|
||||
/** The function returns the mirror character of a UNICODE character. */
|
||||
BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32* mirrored)
|
||||
{
|
||||
return unicode_bidi_mirror_glyph (uc, mirrored);
|
||||
}
|
||||
|
||||
BOOL GUIAPI IsUCharAlnum(Uchar32 uc)
|
||||
{
|
||||
return ISALDIGIT(TYPE(uc));
|
||||
|
||||
Reference in New Issue
Block a user