diff --git a/include/gdi.h b/include/gdi.h index cba83472..b38fbbe5 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -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; /** diff --git a/src/font/charset.c b/src/font/charset.c index 4ad7d532..b4afd935 100644 --- a/src/font/charset.c +++ b/src/font/charset.c @@ -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));