mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-26 20:45:36 +08:00
Introduce the Mchar32 type, and distinguish glyph and character
This commit is contained in:
@@ -3216,7 +3216,7 @@ alExtra.(xwyan)
|
||||
* src/gui/lf_flat.c
|
||||
* src/gui/lf_skin.c
|
||||
|
||||
08/24: ENHANCEMENT #1: Add a new method for FONTOPS: get_glyph_type to return
|
||||
08/24: ENHANCEMENT #1: Add a new method for FONTOPS: get_char_type to return
|
||||
the glyph type the devfont can give us.
|
||||
* src/include/devfont.h
|
||||
* src/font/*.c
|
||||
|
||||
+5
-5
@@ -9709,18 +9709,18 @@ typedef enum {
|
||||
} GLYPHSHAPETYPE;
|
||||
|
||||
/**
|
||||
* \fn Glyph32 GUIAPI GetGlyphShape (LOGFONT* logfont, const char* mchar, \
|
||||
* \fn Glyph32 GUIAPI GetShapedGlyph (LOGFONT* logfont, const char* mchar, \
|
||||
* int mchar_len, GLYPHSHAPETYPE shape_type)
|
||||
* \brief Get the glyph shape of a character.
|
||||
*
|
||||
* \param logfont The logical font.
|
||||
* \param mchar The pointer to the multi-byte character.
|
||||
* \param mchar_len The length of \a mchar in bytes.
|
||||
* \param shape_type The shape type of \a mchar.
|
||||
* \param shape_type The requested shape type.
|
||||
*
|
||||
* \return The multi-byte character's glyph shape value.
|
||||
*/
|
||||
MG_EXPORT Glyph32 GUIAPI GetGlyphShape (LOGFONT* logfont, const char* mchar,
|
||||
MG_EXPORT Glyph32 GUIAPI GetShapedGlyph (LOGFONT* logfont, const char* mchar,
|
||||
int mchar_len, GLYPHSHAPETYPE shape_type);
|
||||
|
||||
/**
|
||||
@@ -9829,10 +9829,10 @@ typedef struct _GLYPHINFO {
|
||||
Uint32 mask;
|
||||
|
||||
/** The glyph type */
|
||||
Uint32 glyph_type;
|
||||
Uint32 char_type;
|
||||
|
||||
/** The BIDI glyph type */
|
||||
Uint32 bidi_glyph_type;
|
||||
Uint32 bidi_char_type;
|
||||
|
||||
#if 0 // VincentWei: removed since 3.4.0
|
||||
/** The height of the glyph */
|
||||
|
||||
+37
-37
@@ -174,19 +174,19 @@ static void update_glyph_info (HWND hWnd, PBIDISLEDITDATA sled)
|
||||
return;
|
||||
}
|
||||
|
||||
#define GLYPH_TYPE_RTL 1
|
||||
#define GLYPH_TYPE_LTR 0
|
||||
#define GLYPH_TYPE_UNKKOWN -1
|
||||
#define CHAR_TYPE_RTL 1
|
||||
#define CHAR_TYPE_LTR 0
|
||||
#define CHAR_TYPE_UNKKOWN -1
|
||||
|
||||
static int get_glyph_type (PBIDISLEDITDATA sled, int glyph_index)
|
||||
static int get_char_type (PBIDISLEDITDATA sled, int glyph_index)
|
||||
{
|
||||
if (glyph_index < 0 || glyph_index >= GLYPHSLEN)
|
||||
return GLYPH_TYPE_UNKKOWN;
|
||||
return CHAR_TYPE_UNKKOWN;
|
||||
|
||||
if (GLYPHSMAP[glyph_index].is_rtol)
|
||||
return GLYPH_TYPE_RTL;
|
||||
return CHAR_TYPE_RTL;
|
||||
else
|
||||
return GLYPH_TYPE_LTR;
|
||||
return CHAR_TYPE_LTR;
|
||||
}
|
||||
|
||||
|
||||
@@ -1073,8 +1073,8 @@ static int inline get_glyph_bidi_type (LOGFONT* logfont, Glyph32 glyph)
|
||||
if (IS_MBC_GLYPH(glyph)) {
|
||||
devfont = logfont->devfonts[1];
|
||||
|
||||
if (devfont->charset_ops->bidi_glyph_type) {
|
||||
return devfont->charset_ops->bidi_glyph_type (glyph);
|
||||
if (devfont->charset_ops->bidi_char_type) {
|
||||
return devfont->charset_ops->bidi_char_type (glyph);
|
||||
}
|
||||
else {
|
||||
return BIDI_TYPE_LTR;
|
||||
@@ -1085,8 +1085,8 @@ static int inline get_glyph_bidi_type (LOGFONT* logfont, Glyph32 glyph)
|
||||
}
|
||||
|
||||
}
|
||||
static int get_text_rl_type (PLOGFONT logfont, char* newtext, int l_glyph_type,
|
||||
int r_glyph_type, int line_type)
|
||||
static int get_text_rl_type (PLOGFONT logfont, char* newtext, int l_char_type,
|
||||
int r_char_type, int line_type)
|
||||
{
|
||||
int bidi_type;
|
||||
Glyph32 glyph;
|
||||
@@ -1101,36 +1101,36 @@ static int get_text_rl_type (PLOGFONT logfont, char* newtext, int l_glyph_type,
|
||||
{
|
||||
if (BIDI_IS_RTL(bidi_type))
|
||||
{
|
||||
return GLYPH_TYPE_RTL;
|
||||
return CHAR_TYPE_RTL;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GLYPH_TYPE_LTR;
|
||||
return CHAR_TYPE_LTR;
|
||||
}
|
||||
}
|
||||
|
||||
if (BIDI_IS_NUMBER(bidi_type))
|
||||
{
|
||||
return GLYPH_TYPE_LTR;
|
||||
return CHAR_TYPE_LTR;
|
||||
}
|
||||
|
||||
if (l_glyph_type == r_glyph_type)
|
||||
if (l_char_type == r_char_type)
|
||||
{
|
||||
return l_glyph_type;
|
||||
return l_char_type;
|
||||
}
|
||||
/*no left glyph*/
|
||||
else if (l_glyph_type == -1)
|
||||
else if (l_char_type == -1)
|
||||
{
|
||||
if (BIDI_IS_WEAK (bidi_type))
|
||||
return r_glyph_type;
|
||||
return r_char_type;
|
||||
else
|
||||
return line_type;
|
||||
}
|
||||
/*no right glyph*/
|
||||
else if (r_glyph_type == -1)
|
||||
else if (r_char_type == -1)
|
||||
{
|
||||
if (BIDI_IS_WEAK (bidi_type))
|
||||
return l_glyph_type;
|
||||
return l_char_type;
|
||||
else
|
||||
return line_type;
|
||||
}
|
||||
@@ -1150,7 +1150,7 @@ static int get_line_rl_type (GLYPHMAPINFO* map, int len)
|
||||
return map->is_rtol;
|
||||
map++;
|
||||
}
|
||||
return GLYPH_TYPE_UNKKOWN;
|
||||
return CHAR_TYPE_UNKKOWN;
|
||||
}
|
||||
|
||||
#define INSERTPOS_BEFORE(sled, cur_glyph_index) \
|
||||
@@ -1171,30 +1171,30 @@ get_insert_pos (PLOGFONT logfont, PBIDISLEDITDATA sled, char *newtext,
|
||||
int l_glyph_index = sled->editPos - 1;
|
||||
int r_glyph_index = sled->editPos;
|
||||
|
||||
int l_glyph_type = get_glyph_type (sled, l_glyph_index);
|
||||
int r_glyph_type = get_glyph_type (sled, r_glyph_index);
|
||||
int l_char_type = get_char_type (sled, l_glyph_index);
|
||||
int r_char_type = get_char_type (sled, r_glyph_index);
|
||||
|
||||
int line_type = get_line_rl_type (GLYPHSMAP, GLYPHSLEN);
|
||||
|
||||
*cur_type = get_text_rl_type (logfont, newtext, l_glyph_type,
|
||||
r_glyph_type, line_type);
|
||||
*cur_type = get_text_rl_type (logfont, newtext, l_char_type,
|
||||
r_char_type, line_type);
|
||||
|
||||
if (*cur_type == GLYPH_TYPE_RTL) {
|
||||
if (l_glyph_type == GLYPH_TYPE_RTL) {
|
||||
if (*cur_type == CHAR_TYPE_RTL) {
|
||||
if (l_char_type == CHAR_TYPE_RTL) {
|
||||
return INSERTPOS_BEFORE (sled, l_glyph_index);
|
||||
}
|
||||
else if (r_glyph_type == GLYPH_TYPE_RTL) {
|
||||
else if (r_char_type == CHAR_TYPE_RTL) {
|
||||
return INSERTPOS_AFTER (sled, r_glyph_index);
|
||||
}
|
||||
else {
|
||||
/*L|L, or L|0(must in a L line)*/
|
||||
if (l_glyph_type == GLYPH_TYPE_LTR) {
|
||||
if (l_char_type == CHAR_TYPE_LTR) {
|
||||
return INSERTPOS_AFTER (sled, l_glyph_index);
|
||||
}
|
||||
/*0|L*/
|
||||
else if (r_glyph_type == GLYPH_TYPE_LTR) {
|
||||
else if (r_char_type == CHAR_TYPE_LTR) {
|
||||
/*logical head in L line*/
|
||||
if (line_type == GLYPH_TYPE_LTR)
|
||||
if (line_type == CHAR_TYPE_LTR)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1210,21 +1210,21 @@ get_insert_pos (PLOGFONT logfont, PBIDISLEDITDATA sled, char *newtext,
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (l_glyph_type == GLYPH_TYPE_LTR) {
|
||||
if (l_char_type == CHAR_TYPE_LTR) {
|
||||
return INSERTPOS_AFTER (sled, l_glyph_index);
|
||||
}
|
||||
else if (r_glyph_type == GLYPH_TYPE_LTR) {
|
||||
else if (r_char_type == CHAR_TYPE_LTR) {
|
||||
return INSERTPOS_BEFORE (sled, r_glyph_index);
|
||||
}
|
||||
else {
|
||||
/*R|R or 0|R(must in R line)*/
|
||||
if (r_glyph_type == GLYPH_TYPE_RTL) {
|
||||
if (r_char_type == CHAR_TYPE_RTL) {
|
||||
return INSERTPOS_AFTER (sled, r_glyph_index);
|
||||
}
|
||||
/*R|0*/
|
||||
else if (l_glyph_type == GLYPH_TYPE_RTL) {
|
||||
else if (l_char_type == CHAR_TYPE_RTL) {
|
||||
/*logical head in R line*/
|
||||
if (line_type == GLYPH_TYPE_RTL) {
|
||||
if (line_type == CHAR_TYPE_RTL) {
|
||||
return 0;
|
||||
}
|
||||
/*logical tail in L line*/
|
||||
@@ -1324,7 +1324,7 @@ sleInsertText (HWND hWnd, PBIDISLEDITDATA sled, char *newtext,
|
||||
edtChangeCont (hWnd, sled);
|
||||
|
||||
/* RTL */
|
||||
if (cur_type == GLYPH_TYPE_RTL) {
|
||||
if (cur_type == CHAR_TYPE_RTL) {
|
||||
sled->editPos = get_text_glyph_index (sled, insert_pos);
|
||||
}
|
||||
else { /*LTR*/
|
||||
|
||||
@@ -271,30 +271,30 @@ static void set_keyboard_layout(HWND hDlg)
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (cur_type == GLYPH_TYPE_RTL) {
|
||||
if (l_glyph_type == GLYPH_TYPE_RTL)
|
||||
if (cur_type == CHAR_TYPE_RTL) {
|
||||
if (l_char_type == CHAR_TYPE_RTL)
|
||||
return INSERTPOS_BEFORE (sled, l_glyph_index);
|
||||
else if (r_glyph_type == GLYPH_TYPE_RTL)
|
||||
else if (r_char_type == CHAR_TYPE_RTL)
|
||||
return INSERTPOS_AFTER (sled, r_glyph_index);
|
||||
else
|
||||
{
|
||||
if (l_glyph_type == GLYPH_TYPE_LTR)
|
||||
if (l_char_type == CHAR_TYPE_LTR)
|
||||
return INSERTPOS_AFTER (sled, l_glyph_index);
|
||||
else if (l_glyph_type == GLYPH_TYPE_LTR)
|
||||
else if (l_char_type == CHAR_TYPE_LTR)
|
||||
return INSERTPOS_BEFORE (sled, r_glyph_index);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (l_glyph_type == GLYPH_TYPE_LTR)
|
||||
if (l_char_type == CHAR_TYPE_LTR)
|
||||
return INSERTPOS_AFTER (sled, l_glyph_index);
|
||||
else if (r_glyph_type == GLYPH_TYPE_LTR)
|
||||
else if (r_char_type == CHAR_TYPE_LTR)
|
||||
return INSERTPOS_BEFORE (sled, r_glyph_index);
|
||||
else {
|
||||
if (l_glyph_type == GLYPH_TYPE_RTL)
|
||||
if (l_char_type == CHAR_TYPE_RTL)
|
||||
return INSERTPOS_BEFORE (sled, l_glyph_index);
|
||||
else if (l_glyph_type == GLYPH_TYPE_RTL)
|
||||
else if (l_char_type == CHAR_TYPE_RTL)
|
||||
return INSERTPOS_AFTER (sled, r_glyph_index);
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -487,7 +487,7 @@ DEVFONT *CreateBMPDevFont (const char *bmpfont_name, const BITMAP* glyph_bmp,
|
||||
goto error_create;
|
||||
}
|
||||
|
||||
offset = (charset_ops->char_glyph_value) (NULL, 0,
|
||||
offset = (charset_ops->get_char_value) (NULL, 0,
|
||||
(const unsigned char*) start_mchar, 0);
|
||||
|
||||
bmpfont_info = build_bmpfont_info (bmpfont_name, glyph_bmp,
|
||||
@@ -550,7 +550,7 @@ BOOL AddGlyphsToBMPFont (DEVFONT* dev_font, BITMAP* glyph_bmp,
|
||||
return FALSE;
|
||||
|
||||
/* Insert a node in the avl tree */
|
||||
offset = (*dev_font->charset_ops->char_glyph_value) (NULL, 0,
|
||||
offset = (*dev_font->charset_ops->get_char_value) (NULL, 0,
|
||||
(const unsigned char*)start_mchar, 0);
|
||||
|
||||
if (look_up (root, offset) == NULL) {
|
||||
@@ -644,7 +644,7 @@ static int avl_look_up (DEVFONT *dev_font, char *start_mchar, int n)
|
||||
GLYPHTREENODE *p;
|
||||
int offset;
|
||||
|
||||
offset = (*dev_font->charset_ops->char_glyph_value) (NULL, 0,
|
||||
offset = (*dev_font->charset_ops->get_char_value) (NULL, 0,
|
||||
(const unsigned char*)start_mchar, n);
|
||||
offset += n;
|
||||
|
||||
|
||||
+59
-59
@@ -174,12 +174,12 @@ static unsigned short iso8859_68x_unicode_map [] =
|
||||
0xFEF7, 0xFEF8, 0xFEF9, 0xFEFA, /*0x130~0x133*/
|
||||
};
|
||||
|
||||
static Uchar32 iso8859_6_conv_to_uc32 (Glyph32 glyph_value)
|
||||
static Uchar32 iso8859_6_conv_to_uc32 (Mchar32 chv)
|
||||
{
|
||||
if (glyph_value < 0x81)
|
||||
return (Glyph32) (glyph_value);
|
||||
else if (glyph_value <= MAX_GLYPH_VALUE )
|
||||
return (Glyph32) iso8859_68x_unicode_map[glyph_value - 0x81];
|
||||
if (chv < 0x81)
|
||||
return (Mchar32) (chv);
|
||||
else if (chv <= MAX_GLYPH_VALUE )
|
||||
return (Mchar32) iso8859_68x_unicode_map[chv - 0x81];
|
||||
else
|
||||
return 0xFFFF;
|
||||
}
|
||||
@@ -212,8 +212,8 @@ static int iso8859_6_conv_from_uc32 (Uchar32 wc, unsigned char* mchar)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* must attetion the para s is arabic glyph value.*/
|
||||
static int is_arabic_glyph_vowel(Uint8 c)
|
||||
/* must attetion the para s is arabic chv value.*/
|
||||
static int is_arabic_char_vowel(Uint8 c)
|
||||
{
|
||||
|
||||
if ((c >= 0x81) && (c <= 0x86)) return 1;
|
||||
@@ -256,7 +256,7 @@ static int is_arabic_glyph_vowel(Uint8 c)
|
||||
|
||||
/* this define is relative with fontset 0xa1~0xa7.
|
||||
* it it used for ligature such as LAM+ALEF, one ligature
|
||||
* have two fontset glyphs.*/
|
||||
* have two fontset chvs.*/
|
||||
#define LAM_ALIF 0x12C //0xA1A5
|
||||
#define LAM_ALIF_F 0x12D //0xA1A6
|
||||
|
||||
@@ -272,15 +272,15 @@ static int is_arabic_glyph_vowel(Uint8 c)
|
||||
/* Because the get_ligature is close relative with fontset 6.8x, so
|
||||
* do it in the follow five functions, if the fontset is change, you only
|
||||
* need to implement follow five interface.
|
||||
* 1. get_vowel_glyph().
|
||||
* 2. get_twovowel_glyph().
|
||||
* 3. get_tadweel_glyph().
|
||||
* 4. get_ligature_glyph().
|
||||
* 5. get_punpoint_glyph().
|
||||
* 1. get_vowel_char().
|
||||
* 2. get_twovowel_char().
|
||||
* 3. get_tadweel_char().
|
||||
* 4. get_ligature_char().
|
||||
* 5. get_punpoint_char().
|
||||
* houhh 20080128.
|
||||
* */
|
||||
|
||||
static int fontset_68x_get_punpoint_glyph(Uint8 c)
|
||||
static int fontset_68x_get_punpoint_char(Uint8 c)
|
||||
{
|
||||
int ligature = -1;
|
||||
switch(c){
|
||||
@@ -293,7 +293,7 @@ static int fontset_68x_get_punpoint_glyph(Uint8 c)
|
||||
return ligature;
|
||||
}
|
||||
|
||||
static int fontset_68x_get_vowel_glyph(Uint8 c)
|
||||
static int fontset_68x_get_vowel_char(Uint8 c)
|
||||
{
|
||||
int ligature = -1;
|
||||
switch(c){
|
||||
@@ -310,7 +310,7 @@ static int fontset_68x_get_vowel_glyph(Uint8 c)
|
||||
return ligature;
|
||||
}
|
||||
|
||||
static int fontset_68x_get_twovowel_glyph(unsigned char c, unsigned char next, int* ignore)
|
||||
static int fontset_68x_get_twovowel_char(unsigned char c, unsigned char next, int* ignore)
|
||||
{
|
||||
int ligature = -1;
|
||||
if(c == SHADDA){
|
||||
@@ -326,12 +326,12 @@ static int fontset_68x_get_twovowel_glyph(unsigned char c, unsigned char next, i
|
||||
}
|
||||
else {
|
||||
*ignore = 0;
|
||||
ligature = fontset_68x_get_vowel_glyph(c);
|
||||
ligature = fontset_68x_get_vowel_char(c);
|
||||
}
|
||||
return ligature;
|
||||
}
|
||||
|
||||
static int fontset_68x_get_ligature_glyph(unsigned char c, BOOL prev_affects_joining, int* ignore)
|
||||
static int fontset_68x_get_ligature_char(unsigned char c, BOOL prev_affects_joining, int* ignore)
|
||||
{
|
||||
int ligature = -1;
|
||||
if(prev_affects_joining){
|
||||
@@ -355,7 +355,7 @@ static int fontset_68x_get_ligature_glyph(unsigned char c, BOOL prev_affects_joi
|
||||
return ligature;
|
||||
}
|
||||
|
||||
static int fontset_68x_get_tadweel_glyph(unsigned char c, unsigned char next, int* ignore)
|
||||
static int fontset_68x_get_tadweel_char(unsigned char c, unsigned char next, int* ignore)
|
||||
{
|
||||
int ligature = -1;
|
||||
if(c == SHADDA){
|
||||
@@ -400,12 +400,12 @@ int get_ligature(const unsigned char* mchar, int len, BOOL prev_affects_joining,
|
||||
|
||||
cur_char = *mchar;
|
||||
|
||||
ligature = fontset_68x_get_punpoint_glyph(cur_char);
|
||||
ligature = fontset_68x_get_punpoint_char(cur_char);
|
||||
if(ligature > 0) return ligature;
|
||||
|
||||
if(len == 1){
|
||||
if (ISARABIC_VOWEL(cur_char)){
|
||||
ligature = fontset_68x_get_vowel_glyph(cur_char);
|
||||
ligature = fontset_68x_get_vowel_char(cur_char);
|
||||
}
|
||||
else if(cur_char == TADWEEL){
|
||||
ligature = TADWEEL;
|
||||
@@ -414,16 +414,16 @@ int get_ligature(const unsigned char* mchar, int len, BOOL prev_affects_joining,
|
||||
else if(len > 1){
|
||||
next = *(mchar+1);
|
||||
if (ISARABIC_VOWEL(cur_char)){ /* two VOWEL, one must be SHADDA first. */
|
||||
ligature = fontset_68x_get_twovowel_glyph(cur_char, next, ignore);
|
||||
ligature = fontset_68x_get_twovowel_char(cur_char, next, ignore);
|
||||
}
|
||||
else if (cur_char == LAM) { /* LAM+ALEF+HAMAZ+MADDA ligature. */
|
||||
ligature = fontset_68x_get_ligature_glyph(next, prev_affects_joining, ignore);
|
||||
ligature = fontset_68x_get_ligature_char(next, prev_affects_joining, ignore);
|
||||
}
|
||||
else if(cur_char == TADWEEL){ /* TADWEEL combine with VOWEL*/
|
||||
if(len > 2) next_next = *(mchar+2);
|
||||
else next_next = 0;
|
||||
|
||||
ligature = fontset_68x_get_tadweel_glyph(next, next_next, ignore);
|
||||
ligature = fontset_68x_get_tadweel_char(next, next_next, ignore);
|
||||
if(ligature == -1 && cur_char == TADWEEL){
|
||||
ligature = TADWEEL;
|
||||
}
|
||||
@@ -454,15 +454,15 @@ static int iso8859_6_len_first_char (const unsigned char* mstr, int len)
|
||||
|
||||
#define ISARABIC_LIG_HALF(s) ((s == 0xa5) || (s == 0xa6))
|
||||
|
||||
static unsigned int iso8859_6_glyph_type (Glyph32 glyph_value)
|
||||
static unsigned int iso8859_6_char_type (Mchar32 chv)
|
||||
{
|
||||
unsigned int ch_type = MCHAR_TYPE_UNKNOWN;
|
||||
|
||||
if (is_arabic_glyph_vowel (glyph_value)) { /* is vowel */
|
||||
if (is_arabic_char_vowel (chv)) { /* is vowel */
|
||||
ch_type = MCHAR_TYPE_VOWEL;
|
||||
}
|
||||
else{
|
||||
ch_type = sb_glyph_type (glyph_value);
|
||||
ch_type = sb_char_type (chv);
|
||||
}
|
||||
|
||||
return ch_type;
|
||||
@@ -586,9 +586,9 @@ static Uint32 __mg_iso8859_68x_type[] = {
|
||||
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
|
||||
};
|
||||
|
||||
static unsigned int iso8859_6_bidi_glyph_type (Glyph32 glyph_value)
|
||||
static unsigned int iso8859_6_bidi_char_type (Mchar32 chv)
|
||||
{
|
||||
return __mg_iso8859_68x_type [REAL_GLYPH(glyph_value)];
|
||||
return __mg_iso8859_68x_type [chv];
|
||||
}
|
||||
|
||||
static int get_table_index(Uint8 c)
|
||||
@@ -655,7 +655,7 @@ static int get_next_char(const unsigned char* mchar, int len)
|
||||
#ifndef _DEBUG
|
||||
static
|
||||
#endif
|
||||
Glyph32 iso8859_6_char_glyph_value (const unsigned char* prev_mchar,
|
||||
Mchar32 iso8859_6_get_char_value (const unsigned char* prev_mchar,
|
||||
int prev_len, const unsigned char* mchar, int len)
|
||||
{
|
||||
BOOL next_affects_joining = FALSE, prev_affects_joining = FALSE;
|
||||
@@ -669,7 +669,7 @@ Glyph32 iso8859_6_char_glyph_value (const unsigned char* prev_mchar,
|
||||
|
||||
char_index = get_table_index(*mchar);
|
||||
|
||||
/*current glyph has no transfiguration and has no ligature*/
|
||||
/*current chv has no transfiguration and has no ligature*/
|
||||
if (char_index < 0 && !ISARABIC_PUNC(*mchar)
|
||||
&& !ISARABIC_VOWEL(*mchar) && !(*mchar == TADWEEL)) {
|
||||
return *mchar;
|
||||
@@ -772,57 +772,57 @@ static const unsigned char* iso8859_6_get_next_word (const unsigned char* mstr,
|
||||
|
||||
/*if cur_len>1, search ligature shape,
|
||||
* else search letter or phonetic symbol shape*/
|
||||
static Glyph32 iso8859_6_glyph_shape (const unsigned char* cur_mchar,
|
||||
static Mchar32 iso8859_6_get_shaped_char_value (const unsigned char* cur_mchar,
|
||||
int cur_len, int shape_type)
|
||||
{
|
||||
Glyph32 glyph_value = -1;
|
||||
Mchar32 chv = -1;
|
||||
int ignore;
|
||||
int index;
|
||||
|
||||
if (cur_len > 1)
|
||||
{
|
||||
if (shape_type == GLYPH_ISOLATED)
|
||||
glyph_value = get_ligature (cur_mchar, cur_len, FALSE, &ignore);
|
||||
chv = get_ligature (cur_mchar, cur_len, FALSE, &ignore);
|
||||
else if (shape_type != GLYPH_INITIAL) {
|
||||
/* LAM+ALEF+HAMAZ+MADDA ligature. */
|
||||
if (*cur_mchar == LAM)
|
||||
glyph_value = fontset_68x_get_ligature_glyph(*(cur_mchar+1), TRUE, &ignore);
|
||||
chv = fontset_68x_get_ligature_char(*(cur_mchar+1), TRUE, &ignore);
|
||||
}
|
||||
}
|
||||
|
||||
if (glyph_value == -1 || glyph_value == 0) {
|
||||
if (chv == -1 || chv == 0) {
|
||||
if (ISARABIC_VOWEL(*cur_mchar)){
|
||||
glyph_value = fontset_68x_get_vowel_glyph(*cur_mchar);
|
||||
chv = fontset_68x_get_vowel_char(*cur_mchar);
|
||||
}
|
||||
|
||||
if (glyph_value == 0 || glyph_value == -1) {
|
||||
if (chv == 0 || chv == -1) {
|
||||
index = get_table_index(*cur_mchar);
|
||||
if (index >=0)
|
||||
{
|
||||
switch (shape_type) {
|
||||
case GLYPH_ISOLATED:
|
||||
glyph_value = shape_info[index].isolated;
|
||||
chv = shape_info[index].isolated;
|
||||
break;
|
||||
case GLYPH_FINAL:
|
||||
glyph_value = shape_info[index].final;
|
||||
chv = shape_info[index].final;
|
||||
break;
|
||||
case GLYPH_INITIAL:
|
||||
glyph_value = shape_info[index].initial;
|
||||
chv = shape_info[index].initial;
|
||||
break;
|
||||
case GLYPH_MEDIAL:
|
||||
glyph_value = shape_info[index].medial;
|
||||
chv = shape_info[index].medial;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
glyph_value = *cur_mchar;
|
||||
chv = *cur_mchar;
|
||||
}
|
||||
}
|
||||
|
||||
if (glyph_value == 0)
|
||||
glyph_value =-1;
|
||||
if (chv == 0)
|
||||
chv =-1;
|
||||
|
||||
return glyph_value;
|
||||
return chv;
|
||||
}
|
||||
|
||||
static const BIDICHAR_MIRROR_MAP __mg_iso8859_68x_mirror_table [] =
|
||||
@@ -839,10 +839,10 @@ static const BIDICHAR_MIRROR_MAP __mg_iso8859_68x_mirror_table [] =
|
||||
// {0x00BB, 0x00AB}
|
||||
};
|
||||
|
||||
static BOOL iso8859_6_bidi_mirror_glyph (Glyph32 glyph, Glyph32* mirrored)
|
||||
static BOOL iso8859_6_bidi_mirror_char (Mchar32 chv, Mchar32* mirrored)
|
||||
{
|
||||
return get_mirror_glyph (__mg_iso8859_68x_mirror_table,
|
||||
TABLESIZE (__mg_iso8859_68x_mirror_table), glyph, mirrored);
|
||||
return get_mirror_char (__mg_iso8859_68x_mirror_table,
|
||||
TABLESIZE (__mg_iso8859_68x_mirror_table), chv, mirrored);
|
||||
}
|
||||
|
||||
static CHARSETOPS CharsetOps_iso8859_6 = {
|
||||
@@ -851,16 +851,16 @@ static CHARSETOPS CharsetOps_iso8859_6 = {
|
||||
FONT_CHARSET_ISO8859_6,
|
||||
0,
|
||||
iso8859_6_len_first_char,
|
||||
iso8859_6_char_glyph_value,
|
||||
iso8859_6_glyph_shape,
|
||||
iso8859_6_glyph_type,
|
||||
iso8859_6_get_char_value,
|
||||
iso8859_6_get_shaped_char_value,
|
||||
iso8859_6_char_type,
|
||||
sb_nr_chars_in_str,
|
||||
iso8859_6_is_this_charset,
|
||||
sb_len_first_substr,
|
||||
iso8859_6_get_next_word,
|
||||
sb_pos_first_char,
|
||||
iso8859_6_bidi_glyph_type,
|
||||
iso8859_6_bidi_mirror_glyph,
|
||||
iso8859_6_bidi_char_type,
|
||||
iso8859_6_bidi_mirror_char,
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
iso8859_6_conv_to_uc32,
|
||||
iso8859_6_conv_from_uc32
|
||||
@@ -868,14 +868,14 @@ static CHARSETOPS CharsetOps_iso8859_6 = {
|
||||
};
|
||||
|
||||
#ifdef _DEBUG
|
||||
int iso8859_6_test_glyph_value (int char_index, Glyph32 glyph_value)
|
||||
int iso8859_6_test_chv (int char_index, Mchar32 chv)
|
||||
{
|
||||
int i = 0;
|
||||
for (i = 0; i<SHAPENUMBER; i++) {
|
||||
if (shape_info[i].isolated == glyph_value ||
|
||||
shape_info[i].initial == glyph_value ||
|
||||
shape_info[i].medial == glyph_value ||
|
||||
shape_info[i].final == glyph_value )
|
||||
if (shape_info[i].isolated == chv ||
|
||||
shape_info[i].initial == chv ||
|
||||
shape_info[i].medial == chv ||
|
||||
shape_info[i].final == chv )
|
||||
if( char_index == i)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ static TYPERUN* get_runtype_link (const CHARSETOPS* charset_ops, Glyph32* glyphs
|
||||
last = list;
|
||||
|
||||
for (i = 0; i < len; i++){
|
||||
if ((type = charset_ops->bidi_glyph_type (glyphs[i])) != last->type){
|
||||
if ((type = charset_ops->bidi_char_type (glyphs[i])) != last->type){
|
||||
link = calloc(1, sizeof(TYPERUN));
|
||||
link->type = type;
|
||||
link->pos = i;
|
||||
@@ -487,7 +487,7 @@ bidi_resolveMirrorChar (const CHARSETOPS* charset_ops, Glyph32* glyphs, int len,
|
||||
for (i = POS (pp); i < POS (pp) + LEN (pp); i++)
|
||||
{
|
||||
Glyph32 mirrored_ch;
|
||||
if (charset_ops->bidi_mirror_glyph && charset_ops->bidi_mirror_glyph (glyphs[i], &mirrored_ch))
|
||||
if (charset_ops->bidi_mirror_char && charset_ops->bidi_mirror_char (glyphs[i], &mirrored_ch))
|
||||
glyphs[i] = mirrored_ch;
|
||||
}
|
||||
}
|
||||
@@ -757,10 +757,10 @@ BOOL GetGlyphBIDIType (LOGFONT* log_font, Glyph32 glyph_value,
|
||||
DEVFONT* devfont = SELECT_DEVFONT(log_font, glyph_value);
|
||||
|
||||
if (devfont == NULL ||
|
||||
devfont->charset_ops->bidi_glyph_type == NULL)
|
||||
devfont->charset_ops->bidi_char_type == NULL)
|
||||
return FALSE;
|
||||
|
||||
*bidi_type = devfont->charset_ops->bidi_glyph_type (glyph_value);
|
||||
*bidi_type = devfont->charset_ops->bidi_char_type (glyph_value);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
+304
-338
File diff suppressed because it is too large
Load Diff
@@ -272,7 +272,7 @@ get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
|
||||
static int
|
||||
load_or_search_glyph (FTINSTANCEINFO* ft_inst_info, FT_Face* face,
|
||||
FT_ULong uni_char, int glyph_type)
|
||||
FT_ULong uni_char, int char_type)
|
||||
{
|
||||
/* no need to lock/unlock in this function */
|
||||
|
||||
@@ -281,10 +281,10 @@ load_or_search_glyph (FTINSTANCEINFO* ft_inst_info, FT_Face* face,
|
||||
int ft_load_flags = FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
|
||||
|
||||
//setting load_flags
|
||||
if (glyph_type == DEVFONTGLYPHTYPE_MONOBMP)
|
||||
if (char_type == DEVFONTGLYPHTYPE_MONOBMP)
|
||||
ft_load_flags |= FT_LOAD_TARGET_MONO;
|
||||
else {
|
||||
if (glyph_type == DEVFONTGLYPHTYPE_SUBPIXEL
|
||||
if (char_type == DEVFONTGLYPHTYPE_SUBPIXEL
|
||||
&& ft_inst_info->ft_lcdfilter != FT_LCD_FILTER_NONE)
|
||||
ft_load_flags |= FT_LOAD_TARGET_LCD;
|
||||
else
|
||||
|
||||
@@ -211,7 +211,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (glyph_value >= RBFONT_INFO_P (devfont)->nr_glyphs)
|
||||
glyph_value = devfont->charset_ops->def_glyph_value;
|
||||
glyph_value = devfont->charset_ops->def_char_value;
|
||||
|
||||
bitmap_size = ((RBFONT_INFO_P (devfont)->width + 7) >> 3)
|
||||
* RBFONT_INFO_P (devfont)->height;
|
||||
|
||||
@@ -101,7 +101,7 @@ static int test_correctness ()
|
||||
if (index < 0) /* not a letter.*/
|
||||
continue;
|
||||
|
||||
glyph_value = iso8859_6_char_glyph_value (NULL, 0, c, 1);
|
||||
glyph_value = iso8859_6_get_char_value (NULL, 0, c, 1);
|
||||
fprintf (stderr, "%x 's glyph value = %x\n", *c, glyph_value);
|
||||
|
||||
if (!iso8859_6_test_glyph_value (index, glyph_value)) {
|
||||
|
||||
+2
-2
@@ -256,7 +256,7 @@ int GUIAPI MB2WCEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
||||
return 0;
|
||||
else {
|
||||
if (dest) {
|
||||
glyph_value = devfont->charset_ops->char_glyph_value(NULL, 0, mchar, n);
|
||||
glyph_value = devfont->charset_ops->get_char_value(NULL, 0, mchar, n);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uc32 = devfont->charset_ops->conv_to_uc32 (glyph_value);
|
||||
else
|
||||
@@ -371,7 +371,7 @@ int GUIAPI MBS2WCSEx (PLOGFONT log_font, void* dest, BOOL wc32,
|
||||
}
|
||||
}
|
||||
else {
|
||||
glyph_value = devfont->charset_ops->char_glyph_value (NULL, 0, mstr, left);
|
||||
glyph_value = devfont->charset_ops->get_char_value (NULL, 0, mstr, left);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
uc32 = devfont->charset_ops->conv_to_uc32 (glyph_value);
|
||||
else
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
typedef struct _bidichar_type_map
|
||||
{
|
||||
Uint32 type; // Type of Unicode characters
|
||||
Glyph32 glyph; // Starting index of Unicode character
|
||||
Uchar32 chv; // Starting index of Unicode character
|
||||
Uint8 count; // Total number of Unicode characters of same type starting from glyphn
|
||||
} BIDICHAR_TYPE_MAP;
|
||||
|
||||
|
||||
+2
-2
@@ -62,8 +62,8 @@ extern "C" {
|
||||
typedef struct _TYPERUN TYPERUN;
|
||||
|
||||
typedef struct _BIDICHAR_MIRROR_MAP {
|
||||
Glyph32 glyph;
|
||||
Glyph32 mirrored;
|
||||
Mchar32 chv;
|
||||
Mchar32 mirrored;
|
||||
} BIDICHAR_MIRROR_MAP;
|
||||
|
||||
Glyph32* __mg_charset_bidi_glyphs_reorder (const CHARSETOPS* charset_ops,
|
||||
|
||||
+39
-29
@@ -133,6 +133,11 @@ static inline long get_opened_file_size (FILE* fp)
|
||||
return size;
|
||||
}
|
||||
|
||||
typedef unsigned int Mchar32;
|
||||
#define IS_MBCHV(chv) ((chv) & 0x80000000)
|
||||
#define SET_MBCHV(chv) ((chv) | 0x80000000)
|
||||
#define REAL_CHV(chv) ((chv) & 0x7FFFFFFF)
|
||||
|
||||
/** The character set operation structure. */
|
||||
struct _CHARSETOPS
|
||||
{
|
||||
@@ -146,34 +151,33 @@ struct _CHARSETOPS
|
||||
const char* name;
|
||||
|
||||
/** Default character. */
|
||||
Glyph32 def_glyph_value;
|
||||
Mchar32 def_char_value;
|
||||
|
||||
/** The method to get the length of the first character function. */
|
||||
/** The method to get the length of the first character. */
|
||||
int (*len_first_char) (const unsigned char* mstr, int mstrlen);
|
||||
|
||||
/** The method to get character offset function. */
|
||||
Glyph32 (*char_glyph_value) (const unsigned char* pre_mchar, int pre_len,
|
||||
const unsigned char* cur_mchar, int cur_len);
|
||||
/** The method to get the character index. */
|
||||
Mchar32 (*get_char_value) (const unsigned char* pre_mchar, int pre_len,
|
||||
const unsigned char* cur_mchar, int cur_len);
|
||||
|
||||
/** The method to get the require shape type glyph value. */
|
||||
Glyph32 (*glyph_shape) (const unsigned char* cur_mchar, int cur_len, int shape_type);
|
||||
/** The method to get the require shape type of a mchar. */
|
||||
Mchar32 (*get_shaped_char_value) (const unsigned char* cur_mchar, int cur_len,
|
||||
int shape_type);
|
||||
|
||||
/** The method to get the type of one glyph. */
|
||||
unsigned int (*glyph_type) (Glyph32 glyph_value);
|
||||
/** The method to get the type of one character. */
|
||||
unsigned int (*char_type) (Mchar32 chv);
|
||||
|
||||
/** The method to get character number in the string function. */
|
||||
int (*nr_chars_in_str) (const unsigned char* mstr, int mstrlen);
|
||||
|
||||
/** The method to judge the \a charset is belong to the character set
|
||||
* function.
|
||||
*/
|
||||
/** The method to judge a given charset name is belong to the character set */
|
||||
int (*is_this_charset) (const unsigned char* charset);
|
||||
|
||||
/** The method to get the length of the first substring. */
|
||||
int (*len_first_substr) (const unsigned char* mstr, int mstrlen);
|
||||
|
||||
/** The method to get next word in the specitied length string function. */
|
||||
const unsigned char* (*get_next_word) (const unsigned char* mstr,
|
||||
const unsigned char* (*get_next_word) (const unsigned char* mstr,
|
||||
int strlen, WORDINFO* word_info);
|
||||
|
||||
/** The method to get the position of the first character in the
|
||||
@@ -181,16 +185,15 @@ struct _CHARSETOPS
|
||||
*/
|
||||
int (*pos_first_char) (const unsigned char* mstr, int mstrlen);
|
||||
|
||||
/** The method to get the BIDI type of one glyph. */
|
||||
unsigned int (*bidi_glyph_type) (Glyph32 glyph_value);
|
||||
/** The method to get the BIDI type of one character. */
|
||||
unsigned int (*bidi_char_type) (Mchar32 chv);
|
||||
|
||||
/** Get mirrored glyph
|
||||
*/
|
||||
BOOL (*bidi_mirror_glyph) (Glyph32 glyph, Glyph32* mirrored);
|
||||
/** Get mirrored character */
|
||||
BOOL (*bidi_mirror_char) (Mchar32 chv, Mchar32* mirrored);
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
/** The method to convert \a mchar to 32 bit UNICODE function. */
|
||||
Uchar32 (*conv_to_uc32) (Glyph32 glyph_value);
|
||||
/** The method to convert a mchar32 value to 32 bit UNICODE function. */
|
||||
Uchar32 (*conv_to_uc32) (Mchar32 chv);
|
||||
|
||||
/** The method to convert \a wc to multily byte character function. */
|
||||
int (*conv_from_uc32) (Uchar32 wc, unsigned char* mchar);
|
||||
@@ -229,7 +232,7 @@ struct _FONTOPS
|
||||
int (*get_font_descent) (LOGFONT* logfont, DEVFONT* devfont);
|
||||
|
||||
/** The method to judge the glyph is exist function. */
|
||||
BOOL (*is_glyph_existed) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
BOOL (*is_glyph_existed) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value);
|
||||
|
||||
/** The method to get character advance function. */
|
||||
@@ -241,16 +244,16 @@ struct _FONTOPS
|
||||
Glyph32 galph_value, int* px, int* py, int* pwidth, int* pheight);
|
||||
|
||||
/** The method to get mono-bitmap function. */
|
||||
const void* (*get_glyph_monobitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const void* (*get_glyph_monobitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value, SIZE* sz, int* pitch, unsigned short* scale);
|
||||
|
||||
/** The method to get grey bitmap, pitch and scale function */
|
||||
const void* (*get_glyph_greybitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const void* (*get_glyph_greybitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 galph_value, SIZE* sz, int* pitch, unsigned short* scale);
|
||||
|
||||
/** The method to get the pre-rendered bitmap of one glyph. */
|
||||
int (*get_glyph_prbitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glaph_value, BITMAP *bmp);
|
||||
int (*get_glyph_prbitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value, BITMAP *bmp);
|
||||
|
||||
/* The method to preproccess start string output fuction, call this
|
||||
* function before output a string, can be NULL.
|
||||
@@ -258,7 +261,7 @@ struct _FONTOPS
|
||||
void (*start_str_output) (LOGFONT* logfont, DEVFONT* devfont);
|
||||
|
||||
/** The method to instance new device font function, can be NULL. */
|
||||
DEVFONT* (*new_instance) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
DEVFONT* (*new_instance) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
BOOL need_sbc_font);
|
||||
|
||||
/** The method to delete instance of device font function, can be NULL. */
|
||||
@@ -267,13 +270,20 @@ struct _FONTOPS
|
||||
int (*is_rotatable) (LOGFONT* logfont, DEVFONT* devfont, int rot_desired);
|
||||
|
||||
/** The method to load data of a devfont from font file
|
||||
* FIXME real_fontname: return real name in file by a char point
|
||||
**/
|
||||
//void* (*load_font_data) (char* fontname, char* filename, char* real_fontname);
|
||||
* FIXME real_fontname: return real name in file by a char point
|
||||
*/
|
||||
void* (*load_font_data) (DEVFONT* devfont, const char* fontname, const char* filename);
|
||||
|
||||
/** The method to unload data of a devfont*/
|
||||
void (*unload_font_data) (DEVFONT* devfont, void* data);
|
||||
|
||||
/**
|
||||
* The method to get the glyph value according to the character value.
|
||||
* If it is NULL, the glyph value will be equal to the character value.
|
||||
*
|
||||
* Since 3.4.0.
|
||||
*/
|
||||
Glyph32 (*get_glyph_value) (LOGFONT* logfont, DEVFONT* devfont, Mchar32 chv);
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -46,6 +46,7 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Glyph32 _gdi_select_glyph_dfi(LOGFONT* lf, Glyph32 gv);
|
||||
Glyph32 _gdi_get_glyph_value(LOGFONT* lf, Mchar32 chv);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+69
-69
@@ -63,7 +63,7 @@ static Glyph32* _gdi_get_glyphs_string(PDC pdc, const unsigned char* text,
|
||||
int i = 0;
|
||||
int len_cur_char;
|
||||
int left_bytes = text_len;
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
Glyph32 glyph_value;
|
||||
DEVFONT* sbc_devfont = pdc->pLogFont->devfonts[0];
|
||||
DEVFONT* mbc_devfont = pdc->pLogFont->devfonts[1];
|
||||
@@ -77,14 +77,14 @@ static Glyph32* _gdi_get_glyphs_string(PDC pdc, const unsigned char* text,
|
||||
len_cur_char = mbc_devfont->charset_ops->len_first_char
|
||||
((const unsigned char*)text, left_bytes);
|
||||
if (len_cur_char > 0) {
|
||||
glyph_value = mbc_devfont->charset_ops->char_glyph_value
|
||||
glyph_value = mbc_devfont->charset_ops->get_char_value
|
||||
(prev_mchar, prev_len, text, left_bytes);
|
||||
|
||||
logical_glyphs[i++]
|
||||
= _gdi_select_glyph_dfi(pdc->pLogFont, glyph_value);
|
||||
glyph_type = (*mbc_devfont->charset_ops->glyph_type)
|
||||
char_type = (*mbc_devfont->charset_ops->char_type)
|
||||
(glyph_value);
|
||||
if (!(glyph_type & MCHAR_TYPE_NOSPACING_MARK)){
|
||||
if (!(char_type & MCHAR_TYPE_NOSPACING_MARK)){
|
||||
prev_mchar = text;
|
||||
prev_len = len_cur_char;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ static Glyph32* _gdi_get_glyphs_string(PDC pdc, const unsigned char* text,
|
||||
((const unsigned char*)text, left_bytes);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
glyph_value = sbc_devfont->charset_ops->char_glyph_value
|
||||
glyph_value = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, text, left_bytes);
|
||||
logical_glyphs[i++] = glyph_value;
|
||||
text += len_cur_char;
|
||||
@@ -118,12 +118,12 @@ static Glyph32* _gdi_get_glyphs_string(PDC pdc, const unsigned char* text,
|
||||
return logical_glyphs;
|
||||
}
|
||||
|
||||
static unsigned int inline get_glyph_type(LOGFONT* logfont, Glyph32 glyph_value)
|
||||
static unsigned int inline get_char_type(LOGFONT* logfont, Glyph32 glyph_value)
|
||||
{
|
||||
if (IS_MBC_GLYPH (glyph_value))
|
||||
return logfont->devfonts[1]->charset_ops->glyph_type(glyph_value);
|
||||
return logfont->devfonts[1]->charset_ops->char_type(glyph_value);
|
||||
else
|
||||
return logfont->devfonts[0]->charset_ops->glyph_type(glyph_value);
|
||||
return logfont->devfonts[0]->charset_ops->char_type(glyph_value);
|
||||
}
|
||||
|
||||
static int inline get_glyph_advance_in_dc (PDC pdc, Glyph32 glyph_value)
|
||||
@@ -139,7 +139,7 @@ static int jump_vowels_ltr (PDC pdc, Glyph32* glyphs, int glyph_num, Glyph32* bi
|
||||
int cur_advance = 0;
|
||||
for (i=0; i<glyph_num; i++)
|
||||
{
|
||||
if (!check_vowel(get_glyph_type (pdc->pLogFont, glyphs[i])))
|
||||
if (!check_vowel(get_char_type (pdc->pLogFont, glyphs[i])))
|
||||
return i;
|
||||
cur_advance = get_glyph_advance_in_dc (pdc, glyphs[i]);
|
||||
if (cur_advance > max_advance)
|
||||
@@ -156,7 +156,7 @@ static int output_visual_glyphs_ltr (PDC pdc, Glyph32* visual_glyphs,
|
||||
{
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
Glyph32 glyph_value;
|
||||
Glyph32 biggest_vowel = 0;
|
||||
|
||||
@@ -179,8 +179,8 @@ static int output_visual_glyphs_ltr (PDC pdc, Glyph32* visual_glyphs,
|
||||
if (vowel_num < nr_glyphs - i)
|
||||
{
|
||||
glyph_value = *(visual_glyphs);
|
||||
glyph_type = get_glyph_type (pdc->pLogFont, glyph_value);
|
||||
if (!cb_one_glyph (context, glyph_value, glyph_type)){
|
||||
char_type = get_char_type (pdc->pLogFont, glyph_value);
|
||||
if (!cb_one_glyph (context, glyph_value, char_type)){
|
||||
goto end;
|
||||
}
|
||||
outed_num++;
|
||||
@@ -193,8 +193,8 @@ static int output_visual_glyphs_ltr (PDC pdc, Glyph32* visual_glyphs,
|
||||
/*first output the biggest vowel*/
|
||||
if (vowel_num)
|
||||
{
|
||||
glyph_type = get_glyph_type (pdc->pLogFont, biggest_vowel);
|
||||
if (!cb_one_glyph (context, biggest_vowel, glyph_type)){
|
||||
char_type = get_char_type (pdc->pLogFont, biggest_vowel);
|
||||
if (!cb_one_glyph (context, biggest_vowel, char_type)){
|
||||
goto end;
|
||||
}
|
||||
outed_num++;
|
||||
@@ -208,8 +208,8 @@ static int output_visual_glyphs_ltr (PDC pdc, Glyph32* visual_glyphs,
|
||||
glyph_value = *(visual_glyphs - j);
|
||||
if (glyph_value != biggest_vowel)
|
||||
{
|
||||
glyph_type = get_glyph_type (pdc->pLogFont, glyph_value);
|
||||
if (!cb_one_glyph (context, glyph_value, glyph_type)){
|
||||
char_type = get_char_type (pdc->pLogFont, glyph_value);
|
||||
if (!cb_one_glyph (context, glyph_value, char_type)){
|
||||
goto end;
|
||||
}
|
||||
outed_num++;
|
||||
@@ -233,7 +233,7 @@ static int output_vowels_rtl (PDC pdc, Glyph32* end_glyph, int left_num,
|
||||
{
|
||||
int i = 0;
|
||||
Glyph32 glyph_value;
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
int old_text_align = pdc->ta_flags;
|
||||
int old_bkmode = pdc->bkmode;
|
||||
|
||||
@@ -242,10 +242,10 @@ static int output_vowels_rtl (PDC pdc, Glyph32* end_glyph, int left_num,
|
||||
*outed_num = 0;
|
||||
for (i=0; i<left_num; i++) {
|
||||
glyph_value = *end_glyph--;
|
||||
glyph_type = get_glyph_type (pdc->pLogFont, glyph_value);
|
||||
char_type = get_char_type (pdc->pLogFont, glyph_value);
|
||||
|
||||
if (check_vowel(glyph_type)) {
|
||||
if (cb_one_glyph(context, glyph_value, glyph_type)) {
|
||||
if (check_vowel(char_type)) {
|
||||
if (cb_one_glyph(context, glyph_value, char_type)) {
|
||||
(*outed_num) ++;
|
||||
}
|
||||
}
|
||||
@@ -263,23 +263,23 @@ static int output_unowned_vowels_rtl (PDC pdc, Glyph32* end_glyph, int left_num,
|
||||
int i = 0;
|
||||
Glyph32 glyph_value = INV_GLYPH_VALUE;
|
||||
Glyph32 biggest_vowel = INV_GLYPH_VALUE;
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
int cur_advance = 0;
|
||||
int max_advance = 0;
|
||||
int bkmode = pdc->bkmode;
|
||||
int old_text_align = pdc->ta_flags;
|
||||
|
||||
*outed_num = 0;
|
||||
if (!check_vowel(get_glyph_type (pdc->pLogFont, *end_glyph)))
|
||||
if (!check_vowel(get_char_type (pdc->pLogFont, *end_glyph)))
|
||||
return 0;
|
||||
|
||||
pdc->ta_flags = (old_text_align & ~TA_RIGHT) | TA_LEFT;
|
||||
for (i=0; i<left_num; i++)
|
||||
{
|
||||
glyph_value = end_glyph [-i];
|
||||
glyph_type = get_glyph_type (pdc->pLogFont, glyph_value);
|
||||
char_type = get_char_type (pdc->pLogFont, glyph_value);
|
||||
|
||||
if (!check_vowel(glyph_type))
|
||||
if (!check_vowel(char_type))
|
||||
break;
|
||||
|
||||
cur_advance = get_glyph_advance_in_dc (pdc, glyph_value);
|
||||
@@ -292,8 +292,8 @@ static int output_unowned_vowels_rtl (PDC pdc, Glyph32* end_glyph, int left_num,
|
||||
|
||||
/*output the biggest_vowel*/
|
||||
if(max_advance){
|
||||
glyph_type = get_glyph_type (pdc->pLogFont, biggest_vowel);
|
||||
if (cb_one_glyph(context, biggest_vowel, glyph_type)){
|
||||
char_type = get_char_type (pdc->pLogFont, biggest_vowel);
|
||||
if (cb_one_glyph(context, biggest_vowel, char_type)){
|
||||
(*outed_num) ++;
|
||||
}
|
||||
}
|
||||
@@ -306,8 +306,8 @@ static int output_unowned_vowels_rtl (PDC pdc, Glyph32* end_glyph, int left_num,
|
||||
glyph_value = *end_glyph--;
|
||||
if (glyph_value != biggest_vowel)
|
||||
{
|
||||
glyph_type = get_glyph_type (pdc->pLogFont, glyph_value);
|
||||
if (cb_one_glyph(context, glyph_value, glyph_type))
|
||||
char_type = get_char_type (pdc->pLogFont, glyph_value);
|
||||
if (cb_one_glyph(context, glyph_value, char_type))
|
||||
{
|
||||
(*outed_num) ++;
|
||||
}
|
||||
@@ -322,7 +322,7 @@ static int output_visual_glyphs_rtl (PDC pdc, Glyph32* visual_glyphs,
|
||||
int nr_glyphs, CB_ONE_GLYPH cb_one_glyph, void* context)
|
||||
{
|
||||
int cur = nr_glyphs - 1;
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
Glyph32 glyph_value;
|
||||
int vowel_num;
|
||||
int outed_vowel_num;
|
||||
@@ -339,10 +339,10 @@ static int output_visual_glyphs_rtl (PDC pdc, Glyph32* visual_glyphs,
|
||||
|
||||
while (cur >= 0) {
|
||||
glyph_value = visual_glyphs[cur];
|
||||
glyph_type = get_glyph_type (pdc->pLogFont, glyph_value);
|
||||
char_type = get_char_type (pdc->pLogFont, glyph_value);
|
||||
|
||||
/*output the letter*/
|
||||
if (!cb_one_glyph(context, glyph_value, glyph_type)){
|
||||
if (!cb_one_glyph(context, glyph_value, char_type)){
|
||||
return outed_glyph_num;
|
||||
}
|
||||
outed_glyph_num ++;
|
||||
@@ -380,7 +380,7 @@ static int _gdi_output_glyphs_direct(PDC pdc, const unsigned char* text,
|
||||
int text_len, CB_ONE_GLYPH cb_one_glyph, void* context,
|
||||
BOOL if_break, BOOL if_draw)
|
||||
{
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
Glyph32 glyph_value;
|
||||
DEVFONT* sbc_devfont = pdc->pLogFont->devfonts[0];
|
||||
DEVFONT* mbc_devfont = pdc->pLogFont->devfonts[1];
|
||||
@@ -404,7 +404,7 @@ static int _gdi_output_glyphs_direct(PDC pdc, const unsigned char* text,
|
||||
len_cur_char = mbc_devfont->charset_ops->len_first_char
|
||||
((const unsigned char*)text, left_bytes);
|
||||
if (len_cur_char > 0) {
|
||||
glyph_value = mbc_devfont->charset_ops->char_glyph_value
|
||||
glyph_value = mbc_devfont->charset_ops->get_char_value
|
||||
(prev_mchar, prev_len, text, left_bytes);
|
||||
|
||||
glyph_value = _gdi_select_glyph_dfi(pdc->pLogFont, glyph_value);
|
||||
@@ -416,16 +416,16 @@ static int _gdi_output_glyphs_direct(PDC pdc, const unsigned char* text,
|
||||
((const unsigned char*)text, left_bytes);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
glyph_value = sbc_devfont->charset_ops->char_glyph_value
|
||||
glyph_value = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, text, left_bytes);
|
||||
}
|
||||
else break;
|
||||
|
||||
do_glyph:
|
||||
if (IS_MBC_GLYPH (glyph_value))
|
||||
glyph_type = mbc_devfont->charset_ops->glyph_type (glyph_value);
|
||||
char_type = mbc_devfont->charset_ops->char_type (glyph_value);
|
||||
else
|
||||
glyph_type = sbc_devfont->charset_ops->glyph_type (glyph_value);
|
||||
char_type = sbc_devfont->charset_ops->char_type (glyph_value);
|
||||
|
||||
if(if_break){
|
||||
DRAWTEXTEX2_CTXT _txt;
|
||||
@@ -436,7 +436,7 @@ do_glyph:
|
||||
_txt.nFormat = ctxt->nFormat;
|
||||
_txt.only_extent = TRUE;
|
||||
_txt.tab_width = ctxt->tab_width;
|
||||
if (!cb_one_glyph(&_txt, glyph_value, glyph_type)){
|
||||
if (!cb_one_glyph(&_txt, glyph_value, char_type)){
|
||||
break;
|
||||
}
|
||||
line_width += _txt.advance;
|
||||
@@ -446,7 +446,7 @@ do_glyph:
|
||||
}
|
||||
|
||||
if(if_draw) {
|
||||
if (!cb_one_glyph(ctxt, glyph_value, glyph_type)){
|
||||
if (!cb_one_glyph(ctxt, glyph_value, char_type)){
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -468,7 +468,7 @@ Glyph32* _gdi_bidi_reorder (PDC pdc, const unsigned char* text, int text_len,
|
||||
DEVFONT* mbc_devfont = pdc->pLogFont->devfonts[1];
|
||||
Glyph32 *logical_glyphs = NULL;
|
||||
|
||||
if (mbc_devfont && mbc_devfont->charset_ops->bidi_glyph_type) {
|
||||
if (mbc_devfont && mbc_devfont->charset_ops->bidi_char_type) {
|
||||
logical_glyphs = _gdi_get_glyphs_string (pdc, text, text_len, nr_glyphs);
|
||||
if (*nr_glyphs > 0)
|
||||
__mg_charset_bidi_glyphs_reorder (mbc_devfont->charset_ops,
|
||||
@@ -482,7 +482,7 @@ int _gdi_reorder_text (PDC pdc, const unsigned char* text, int text_len,
|
||||
BOOL direction, CB_ONE_GLYPH cb_one_glyph, void* context)
|
||||
{
|
||||
int i = 0;
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
Glyph32 glyph_value;
|
||||
DEVFONT* sbc_devfont = pdc->pLogFont->devfonts[0];
|
||||
DEVFONT* mbc_devfont = pdc->pLogFont->devfonts[1];
|
||||
@@ -491,7 +491,7 @@ int _gdi_reorder_text (PDC pdc, const unsigned char* text, int text_len,
|
||||
int nr_glyphs = 0;
|
||||
Glyph32 *logical_glyphs = NULL;
|
||||
|
||||
if (mbc_devfont->charset_ops->bidi_glyph_type) {
|
||||
if (mbc_devfont->charset_ops->bidi_char_type) {
|
||||
|
||||
logical_glyphs = _gdi_bidi_reorder (pdc, text, text_len, &nr_glyphs);
|
||||
if (!logical_glyphs || nr_glyphs <= 0)
|
||||
@@ -523,27 +523,27 @@ int _gdi_reorder_text (PDC pdc, const unsigned char* text, int text_len,
|
||||
else {
|
||||
if (!direction) { /* right to left, reverse text.*/
|
||||
for (i = text_len - 1; i >= 0; i--) {
|
||||
if (!(glyph_value = sbc_devfont->charset_ops->char_glyph_value
|
||||
if (!(glyph_value = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, text + i, 1)))
|
||||
return (text_len-i-1);
|
||||
|
||||
glyph_type = sbc_devfont->charset_ops->glyph_type
|
||||
char_type = sbc_devfont->charset_ops->char_type
|
||||
(glyph_value);
|
||||
|
||||
if (!cb_one_glyph (context, glyph_value, glyph_type))
|
||||
if (!cb_one_glyph (context, glyph_value, char_type))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < text_len; i++) {
|
||||
if (!(glyph_value = sbc_devfont->charset_ops->char_glyph_value
|
||||
if (!(glyph_value = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, text + i, 1)))
|
||||
return i;
|
||||
|
||||
glyph_type = sbc_devfont->charset_ops->glyph_type
|
||||
char_type = sbc_devfont->charset_ops->char_type
|
||||
(glyph_value);
|
||||
|
||||
if(!cb_one_glyph (context, glyph_value, glyph_type))
|
||||
if(!cb_one_glyph (context, glyph_value, char_type))
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -558,7 +558,7 @@ _gdi_get_glyphs_string_charbreak(PDC pdc, const unsigned char* text,
|
||||
int i = 0;
|
||||
int len_cur_char;
|
||||
int left_bytes = text_len;
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
Glyph32 glyph_value;
|
||||
DEVFONT* sbc_devfont = pdc->pLogFont->devfonts[0];
|
||||
DEVFONT* mbc_devfont = pdc->pLogFont->devfonts[1];
|
||||
@@ -581,16 +581,16 @@ _gdi_get_glyphs_string_charbreak(PDC pdc, const unsigned char* text,
|
||||
else len_cur_char = 0;
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
glyph_value = mbc_devfont->charset_ops->char_glyph_value
|
||||
glyph_value = mbc_devfont->charset_ops->get_char_value
|
||||
(prev_mchar, prev_len, text, left_bytes);
|
||||
|
||||
prev_mchar = text;
|
||||
prev_len = len_cur_char;
|
||||
logical_glyphs[i++] = _gdi_select_glyph_dfi(pdc->pLogFont, glyph_value);
|
||||
|
||||
glyph_type = (*mbc_devfont->charset_ops->glyph_type)
|
||||
char_type = (*mbc_devfont->charset_ops->char_type)
|
||||
(glyph_value);
|
||||
if (!(glyph_type & MCHAR_TYPE_NOSPACING_MARK)){
|
||||
if (!(char_type & MCHAR_TYPE_NOSPACING_MARK)){
|
||||
prev_mchar = text;
|
||||
}
|
||||
else{
|
||||
@@ -607,7 +607,7 @@ _gdi_get_glyphs_string_charbreak(PDC pdc, const unsigned char* text,
|
||||
((const unsigned char*)text, left_bytes);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
glyph_value = sbc_devfont->charset_ops->char_glyph_value
|
||||
glyph_value = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, text, left_bytes);
|
||||
logical_glyphs[i++] = glyph_value;
|
||||
line_width += _gdi_get_glyph_advance (pdc, logical_glyphs[i-1],
|
||||
@@ -825,7 +825,7 @@ _gdi_output_glyphs_direct_sbc_rtol_break(PDC pdc, const unsigned char* text,
|
||||
DRAWTEXTEX2_CTXT* ctxt = (DRAWTEXTEX2_CTXT*)context;
|
||||
int nr_glyphs = 0;
|
||||
int i = 0;
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
Glyph32 glyph_value;
|
||||
DEVFONT* sbc_devfont = pdc->pLogFont->devfonts[0];
|
||||
|
||||
@@ -846,13 +846,13 @@ _gdi_output_glyphs_direct_sbc_rtol_break(PDC pdc, const unsigned char* text,
|
||||
if(ctxt->nCount <= 0) return 0;
|
||||
|
||||
for (i = ctxt->nCount - 1; i >= 0; i--) {
|
||||
glyph_value = sbc_devfont->charset_ops->char_glyph_value
|
||||
glyph_value = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, text + i, 1);
|
||||
|
||||
glyph_type = sbc_devfont->charset_ops->glyph_type
|
||||
char_type = sbc_devfont->charset_ops->char_type
|
||||
(glyph_value);
|
||||
|
||||
if(!cb_one_glyph (context, glyph_value, glyph_type))
|
||||
if(!cb_one_glyph (context, glyph_value, char_type))
|
||||
break;
|
||||
}
|
||||
return nr_glyphs;
|
||||
@@ -868,7 +868,7 @@ int _gdi_reorder_text_break (PDC pdc, const unsigned char* text,
|
||||
int nr_glyphs = text_len;
|
||||
Glyph32 *logical_glyphs = NULL;
|
||||
|
||||
if (mbc_devfont->charset_ops->bidi_glyph_type){
|
||||
if (mbc_devfont->charset_ops->bidi_char_type){
|
||||
|
||||
logical_glyphs = _gdi_get_glyphs_string_break(pdc, text, text_len,
|
||||
&nr_glyphs, context);
|
||||
@@ -1009,16 +1009,16 @@ int GUIAPI GetGlyphsExtentPoint(
|
||||
PDC pdc = dc_HDC2PDC(hdc);
|
||||
PLOGFONT log_font = pdc->pLogFont;
|
||||
DEVFONT* devfont = NULL;
|
||||
unsigned int glyph_type = 0;
|
||||
unsigned int char_type = 0;
|
||||
|
||||
size->cx = 0;
|
||||
size->cy = 0;
|
||||
|
||||
while(i < nr_glyphs){
|
||||
devfont = SELECT_DEVFONT(log_font, glyphs[i]);
|
||||
glyph_type = devfont->charset_ops->glyph_type(glyphs[i]);
|
||||
char_type = devfont->charset_ops->char_type(glyphs[i]);
|
||||
|
||||
if (check_zero_width (glyph_type)) {
|
||||
if (check_zero_width (char_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else {
|
||||
@@ -1058,7 +1058,7 @@ int GUIAPI GetGlyphsExtent(
|
||||
int i = 0;
|
||||
int advance = 0;
|
||||
int adv_x, adv_y;
|
||||
unsigned int glyph_type;
|
||||
unsigned int char_type;
|
||||
Glyph32 glyph_value = INV_GLYPH_VALUE;
|
||||
PDC pdc = dc_HDC2PDC(hdc);
|
||||
PLOGFONT log_font = pdc->pLogFont;
|
||||
@@ -1068,9 +1068,9 @@ int GUIAPI GetGlyphsExtent(
|
||||
size->cy = 0;
|
||||
while (i < nr_glyphs) {
|
||||
devfont = SELECT_DEVFONT(log_font, glyphs[i]);
|
||||
glyph_type = devfont->charset_ops->glyph_type(glyphs[i]);
|
||||
char_type = devfont->charset_ops->char_type(glyphs[i]);
|
||||
|
||||
if (check_zero_width (glyph_type)) {
|
||||
if (check_zero_width (char_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else {
|
||||
@@ -1361,7 +1361,7 @@ void GUIAPI BIDIGetTextRangesLog2Vis(LOGFONT* log_font,
|
||||
*nr_ranges = 0;
|
||||
/* it is not bidi string. */
|
||||
if (!log_font->devfonts[1] || (log_font->devfonts[1] &&
|
||||
!log_font->devfonts[1]->charset_ops->bidi_glyph_type)) {
|
||||
!log_font->devfonts[1]->charset_ops->bidi_char_type)) {
|
||||
*ranges = NULL;
|
||||
return;
|
||||
}
|
||||
@@ -1457,7 +1457,7 @@ int GUIAPI BIDIGetTextVisualGlyphs(LOGFONT* log_font,
|
||||
glyphs, glyphs_map);
|
||||
|
||||
if (nr_glyphs > 0 && mbc_devfont
|
||||
&& mbc_devfont->charset_ops->bidi_glyph_type) {
|
||||
&& mbc_devfont->charset_ops->bidi_char_type) {
|
||||
__mg_charset_bidi_glyphs_reorder (mbc_devfont->charset_ops,
|
||||
*glyphs, nr_glyphs, -1,
|
||||
*glyphs_map, bidi_reverse_map);
|
||||
@@ -1472,7 +1472,7 @@ Glyph32* GUIAPI BIDILogGlyphs2VisGlyphs(LOGFONT* log_font,
|
||||
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||
|
||||
if (nr_glyphs > 0 && mbc_devfont
|
||||
&& mbc_devfont->charset_ops->bidi_glyph_type) {
|
||||
&& mbc_devfont->charset_ops->bidi_char_type) {
|
||||
__mg_charset_bidi_glyphs_reorder (mbc_devfont->charset_ops,
|
||||
glyphs, nr_glyphs, -1,
|
||||
glyphs_map, bidi_reverse_map);
|
||||
@@ -1490,7 +1490,7 @@ BOOL GUIAPI BIDILogGlyphs2VisGlyphsEx(LOGFONT* log_font,
|
||||
DEVFONT* mbc_devfont = log_font->devfonts[1];
|
||||
|
||||
if (nr_glyphs > 0 && mbc_devfont
|
||||
&& mbc_devfont->charset_ops->bidi_glyph_type) {
|
||||
&& mbc_devfont->charset_ops->bidi_char_type) {
|
||||
__mg_charset_bidi_glyphs_reorder (mbc_devfont->charset_ops,
|
||||
glyphs, nr_glyphs, pel,
|
||||
extra, cb_reorder_extra);
|
||||
@@ -1510,7 +1510,7 @@ void GUIAPI BIDIGetLogicalEmbedLevelsEx(LOGFONT* log_font,
|
||||
if (*embedding_levels == NULL)
|
||||
*embedding_levels = malloc(nr_glyphs * sizeof (Uint8));
|
||||
|
||||
if (mbc_devfont && mbc_devfont->charset_ops->bidi_glyph_type) {
|
||||
if (mbc_devfont && mbc_devfont->charset_ops->bidi_char_type) {
|
||||
__mg_charset_bidi_get_embeddlevels (mbc_devfont->charset_ops,
|
||||
glyphs, nr_glyphs, pel, *embedding_levels, 0);
|
||||
}
|
||||
@@ -1528,7 +1528,7 @@ void GUIAPI BIDIGetVisualEmbedLevelsEx(LOGFONT* log_font,
|
||||
if (*embedding_levels == NULL)
|
||||
*embedding_levels = malloc(nr_glyphs * sizeof (Uint8));
|
||||
|
||||
if (mbc_devfont && mbc_devfont->charset_ops->bidi_glyph_type) {
|
||||
if (mbc_devfont && mbc_devfont->charset_ops->bidi_char_type) {
|
||||
__mg_charset_bidi_get_embeddlevels (mbc_devfont->charset_ops,
|
||||
glyphs, nr_glyphs, pel, *embedding_levels, 1);
|
||||
}
|
||||
|
||||
@@ -100,14 +100,14 @@ static inline BOOL is_utf16_logfont (PDC pdc)
|
||||
#endif
|
||||
|
||||
static BOOL cb_drawtextex2 (void* context, Glyph32 glyph_value,
|
||||
unsigned int glyph_type)
|
||||
unsigned int char_type)
|
||||
{
|
||||
DRAWTEXTEX2_CTXT* ctxt = (DRAWTEXTEX2_CTXT*)context;
|
||||
int adv_x = 0, adv_y = 0;
|
||||
BBOX bbox;
|
||||
int bkmode;
|
||||
|
||||
switch (glyph_type & GLYPHTYPE_MCHAR_MASK) {
|
||||
switch (char_type & GLYPHTYPE_MCHAR_MASK) {
|
||||
case MCHAR_TYPE_ZEROWIDTH:
|
||||
case MCHAR_TYPE_CR:
|
||||
adv_x = adv_y = 0;
|
||||
|
||||
@@ -89,7 +89,7 @@ void _gdi_calc_glyphs_size_from_two_points (PDC pdc, int x0, int y0,
|
||||
int x1, int y1, SIZE* size);
|
||||
|
||||
typedef BOOL (*CB_ONE_GLYPH) (void* context, Glyph32 glyph_value,
|
||||
unsigned int glyph_type);
|
||||
unsigned int char_type);
|
||||
|
||||
int _gdi_output_visual_glyphs(PDC pdc, Glyph32* visual_glyphs, int nr_glyphs,
|
||||
BOOL direction, CB_ONE_GLYPH cb_one_glyph, void* context);
|
||||
|
||||
@@ -1785,7 +1785,7 @@ int _gdi_draw_one_glyph (PDC pdc, Glyph32 glyph_value, BOOL direction,
|
||||
logfont = pdc->pLogFont;
|
||||
devfont = SELECT_DEVFONT (logfont, glyph_value);
|
||||
|
||||
glyph_bmptype = devfont->font_ops->get_glyph_type (logfont, devfont)
|
||||
glyph_bmptype = devfont->font_ops->get_char_type (logfont, devfont)
|
||||
& DEVFONTGLYPHTYPE_MASK_BMPTYPE;
|
||||
|
||||
// VincentWei: only use auto bold when the weight of devfont does not
|
||||
|
||||
@@ -316,14 +316,16 @@ static int get_next_glyph(struct glyph_break_ctxt* gbctxt,
|
||||
((const unsigned char*)mstr, mstr_len);
|
||||
|
||||
if (mclen > 0) {
|
||||
*gv = gbctxt->mbc_devfont->charset_ops->char_glyph_value
|
||||
Mchar32 chv = gbctxt->mbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, (Uint8*)mstr, mclen);
|
||||
*gv = _gdi_select_glyph_dfi(gbctxt->lf, *gv);
|
||||
|
||||
if (gbctxt->mbc_devfont->charset_ops->conv_to_uc32)
|
||||
*uc = gbctxt->mbc_devfont->charset_ops->conv_to_uc32(*gv);
|
||||
*uc = gbctxt->mbc_devfont->charset_ops->conv_to_uc32(chv);
|
||||
else
|
||||
*uc = REAL_GLYPH(*gv);
|
||||
*uc = chv;
|
||||
|
||||
chv = SET_MBCHV(chv);
|
||||
*gv = _gdi_get_glyph_value(gbctxt->lf, chv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,12 +334,15 @@ static int get_next_glyph(struct glyph_break_ctxt* gbctxt,
|
||||
((const unsigned char*)mstr, mstr_len);
|
||||
|
||||
if (mclen > 0) {
|
||||
*gv = gbctxt->sbc_devfont->charset_ops->char_glyph_value
|
||||
Mchar32 chv = gbctxt->sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, (Uint8*)mstr, mclen);
|
||||
|
||||
if (gbctxt->sbc_devfont->charset_ops->conv_to_uc32)
|
||||
*uc = gbctxt->sbc_devfont->charset_ops->conv_to_uc32(*gv);
|
||||
*uc = gbctxt->sbc_devfont->charset_ops->conv_to_uc32(chv);
|
||||
else
|
||||
*uc = REAL_GLYPH(*gv);
|
||||
*uc = chv;
|
||||
|
||||
*gv = _gdi_get_glyph_value(gbctxt->lf, chv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+52
-20
@@ -87,7 +87,7 @@ Glyph32 GUIAPI GetGlyphValue (LOGFONT* logfont, const char* mchar,
|
||||
((const unsigned char*)mchar, mchar_len);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
gv = mbc_devfont->charset_ops->char_glyph_value
|
||||
gv = mbc_devfont->charset_ops->get_char_value
|
||||
((Uint8*)pre_mchar, pre_len, (Uint8*)mchar, mchar_len);
|
||||
|
||||
dfi = 1;
|
||||
@@ -109,14 +109,14 @@ Glyph32 GUIAPI GetGlyphValue (LOGFONT* logfont, const char* mchar,
|
||||
((const unsigned char*)mchar, mchar_len);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
gv = sbc_devfont->charset_ops->char_glyph_value
|
||||
gv = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, (Uint8*)mchar, mchar_len);
|
||||
}
|
||||
|
||||
return gv;
|
||||
}
|
||||
|
||||
Glyph32 GUIAPI GetGlyphShape (LOGFONT* logfont, const char* mchar,
|
||||
Glyph32 GUIAPI GetShapedGlyph (LOGFONT* logfont, const char* mchar,
|
||||
int mchar_len, GLYPHSHAPETYPE shape_type)
|
||||
{
|
||||
int len_cur_char;
|
||||
@@ -133,11 +133,11 @@ Glyph32 GUIAPI GetGlyphShape (LOGFONT* logfont, const char* mchar,
|
||||
int i, dfi;
|
||||
DEVFONT* df;
|
||||
|
||||
if (mbc_devfont->charset_ops->glyph_shape)
|
||||
glyph_value = mbc_devfont->charset_ops->glyph_shape(
|
||||
if (mbc_devfont->charset_ops->get_shaped_char_value)
|
||||
glyph_value = mbc_devfont->charset_ops->get_shaped_char_value(
|
||||
(const unsigned char*)mchar, mchar_len, shape_type);
|
||||
else
|
||||
glyph_value = mbc_devfont->charset_ops->char_glyph_value
|
||||
glyph_value = mbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, (Uint8*)mchar, len_cur_char);
|
||||
|
||||
dfi = 1;
|
||||
@@ -158,11 +158,11 @@ Glyph32 GUIAPI GetGlyphShape (LOGFONT* logfont, const char* mchar,
|
||||
((const unsigned char*)mchar, mchar_len);
|
||||
|
||||
if (len_cur_char > 0) {
|
||||
if (sbc_devfont->charset_ops->glyph_shape)
|
||||
glyph_value = sbc_devfont->charset_ops->glyph_shape(
|
||||
if (sbc_devfont->charset_ops->get_shaped_char_value)
|
||||
glyph_value = sbc_devfont->charset_ops->get_shaped_char_value(
|
||||
(const unsigned char*)mchar, mchar_len, shape_type);
|
||||
else
|
||||
glyph_value = sbc_devfont->charset_ops->char_glyph_value
|
||||
glyph_value = sbc_devfont->charset_ops->get_char_value
|
||||
(NULL, 0, (Uint8*)mchar, len_cur_char);
|
||||
|
||||
}
|
||||
@@ -176,8 +176,8 @@ BOOL GUIAPI GetMirrorGlyph (LOGFONT* logfont, Glyph32 gv,
|
||||
*mirrored = INV_GLYPH_VALUE;
|
||||
|
||||
DEVFONT* devfont = SELECT_DEVFONT(logfont, gv);
|
||||
if (devfont->charset_ops->bidi_mirror_glyph) {
|
||||
return devfont->charset_ops->bidi_mirror_glyph(gv, mirrored);
|
||||
if (devfont->charset_ops->bidi_mirror_char) {
|
||||
return devfont->charset_ops->bidi_mirror_char(gv, mirrored);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -187,7 +187,7 @@ int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
|
||||
int* adv_x, int* adv_y)
|
||||
{
|
||||
int advance;
|
||||
int glyph_type;
|
||||
int char_type;
|
||||
|
||||
PDC pdc = dc_HDC2PDC(hdc);
|
||||
DEVFONT* devfont = SELECT_DEVFONT(pdc->pLogFont, glyph_value);
|
||||
@@ -196,8 +196,8 @@ int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
|
||||
coor_LP2SP (pdc, &x, &y);
|
||||
pdc->rc_output = pdc->DevRC;
|
||||
|
||||
glyph_type = devfont->charset_ops->glyph_type (glyph_value);
|
||||
if (check_zero_width(glyph_type)) {
|
||||
char_type = devfont->charset_ops->char_type (glyph_value);
|
||||
if (check_zero_width(char_type)) {
|
||||
if (adv_x) *adv_x = 0;
|
||||
if (adv_y) *adv_y = 0;
|
||||
advance = 0;
|
||||
@@ -223,7 +223,7 @@ unsigned int GUIAPI GetGlyphType (LOGFONT* logfont, Glyph32 glyph_value)
|
||||
/* get the relative device font */
|
||||
DEVFONT* devfont = SELECT_DEVFONT(logfont, glyph_value);
|
||||
glyph_value = REAL_GLYPH (glyph_value);
|
||||
return devfont->charset_ops->glyph_type (glyph_value);
|
||||
return devfont->charset_ops->char_type (glyph_value);
|
||||
}
|
||||
|
||||
int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
||||
@@ -236,16 +236,16 @@ int GUIAPI GetGlyphInfo (LOGFONT* logfont, Glyph32 glyph_value,
|
||||
|
||||
/* get glyph type */
|
||||
if (glyph_info->mask & GLYPH_INFO_TYPE)
|
||||
glyph_info->glyph_type = devfont->charset_ops->glyph_type (glyph_value);
|
||||
glyph_info->char_type = devfont->charset_ops->char_type (glyph_value);
|
||||
|
||||
/* get glyph type */
|
||||
if (glyph_info->mask & GLYPH_INFO_BIDI_TYPE) {
|
||||
if (devfont->charset_ops->bidi_glyph_type) {
|
||||
glyph_info->bidi_glyph_type
|
||||
= devfont->charset_ops->bidi_glyph_type (glyph_value);
|
||||
if (devfont->charset_ops->bidi_char_type) {
|
||||
glyph_info->bidi_char_type
|
||||
= devfont->charset_ops->bidi_char_type (glyph_value);
|
||||
}
|
||||
else {
|
||||
glyph_info->bidi_glyph_type = BIDI_TYPE_INVALID;
|
||||
glyph_info->bidi_char_type = BIDI_TYPE_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2962,3 +2962,35 @@ Glyph32 _gdi_select_glyph_dfi(LOGFONT* lf, Glyph32 gv)
|
||||
return SET_GLYPH_DFI(gv, dfi);
|
||||
}
|
||||
|
||||
Glyph32 _gdi_get_glyph_value(LOGFONT* lf, Mchar32 chv)
|
||||
{
|
||||
Glyph32 gv = INV_GLYPH_VALUE;
|
||||
int i, dfi = 0;
|
||||
DEVFONT* df;
|
||||
|
||||
if (IS_MBCHV(chv)) {
|
||||
for (i = 1; i < MAXNR_DEVFONTS; i++) {
|
||||
if ((df = lf->devfonts[i])) {
|
||||
if (df->font_ops->get_glyph_value)
|
||||
gv = df->font_ops->get_glyph_value(lf, df, chv);
|
||||
else
|
||||
gv = REAL_CHV(chv);
|
||||
|
||||
if (df->font_ops->is_glyph_existed(lf, df, gv)) {
|
||||
dfi = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dfi == 0) {
|
||||
if (REAL_CHV(chv) < 0x80)
|
||||
dfi = 0;
|
||||
else
|
||||
dfi = 1;
|
||||
}
|
||||
|
||||
return SET_GLYPH_DFI(gv, dfi);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,14 +116,14 @@ typedef struct _TABBEDTEXTOUT_CTXT
|
||||
} TABBEDTEXTOUT_CTXT;
|
||||
|
||||
static BOOL cb_tabbedtextout (void* context, Glyph32 glyph_value,
|
||||
unsigned int glyph_type)
|
||||
unsigned int char_type)
|
||||
{
|
||||
TABBEDTEXTOUT_CTXT* ctxt = (TABBEDTEXTOUT_CTXT*)context;
|
||||
int adv_x, adv_y;
|
||||
BBOX bbox;
|
||||
int bkmode = ctxt->pdc->bkmode;
|
||||
|
||||
switch (glyph_type & GLYPHTYPE_MCHAR_MASK) {
|
||||
switch (char_type & GLYPHTYPE_MCHAR_MASK) {
|
||||
case MCHAR_TYPE_ZEROWIDTH:
|
||||
adv_x = adv_y = 0;
|
||||
break;
|
||||
@@ -196,13 +196,13 @@ typedef struct _TABBEDTEXTOUTEX_CTXT
|
||||
} TABBEDTEXTOUTEX_CTXT;
|
||||
|
||||
static BOOL cb_tabbedtextoutex (void* context, Glyph32 glyph_value,
|
||||
unsigned int glyph_type)
|
||||
unsigned int char_type)
|
||||
{
|
||||
TABBEDTEXTOUTEX_CTXT* ctxt = (TABBEDTEXTOUTEX_CTXT*)context;
|
||||
int adv_x, adv_y;
|
||||
int tab_pos = ctxt->nTabOrig;
|
||||
|
||||
switch (glyph_type & GLYPHTYPE_MCHAR_MASK) {
|
||||
switch (char_type & GLYPHTYPE_MCHAR_MASK) {
|
||||
case MCHAR_TYPE_ZEROWIDTH:
|
||||
adv_x = adv_y = 0;
|
||||
break;
|
||||
@@ -533,7 +533,7 @@ int GUIAPI GetTabbedTextExtentPoint (HDC hdc, const char* text,
|
||||
size->cx = size->cy = 0;
|
||||
|
||||
/* This function does not support BIDI */
|
||||
if (mbc_devfont && pdc->bidi_flags && mbc_devfont->charset_ops->bidi_glyph_type)
|
||||
if (mbc_devfont && pdc->bidi_flags && mbc_devfont->charset_ops->bidi_char_type)
|
||||
return -1;
|
||||
|
||||
_gdi_start_new_line (pdc);
|
||||
@@ -566,11 +566,11 @@ int GUIAPI GetTabbedTextExtentPoint (HDC hdc, const char* text,
|
||||
}
|
||||
|
||||
if (devfont) {
|
||||
int glyph_type;
|
||||
int char_type;
|
||||
|
||||
glyph_value = devfont->charset_ops->char_glyph_value
|
||||
glyph_value = devfont->charset_ops->get_char_value
|
||||
(NULL, 0, (const unsigned char*)text, len_cur_char);
|
||||
glyph_type = devfont->charset_ops->glyph_type (glyph_value);
|
||||
char_type = devfont->charset_ops->char_type (glyph_value);
|
||||
|
||||
if (devfont == mbc_devfont) {
|
||||
int i, dfi;
|
||||
@@ -589,7 +589,7 @@ int GUIAPI GetTabbedTextExtentPoint (HDC hdc, const char* text,
|
||||
glyph_value = SET_GLYPH_DFI(glyph_value, dfi);
|
||||
}
|
||||
|
||||
switch (glyph_type & GLYPHTYPE_MCHAR_MASK) {
|
||||
switch (char_type & GLYPHTYPE_MCHAR_MASK) {
|
||||
case MCHAR_TYPE_ZEROWIDTH:
|
||||
case MCHAR_TYPE_VOWEL:
|
||||
break;
|
||||
|
||||
+12
-12
@@ -106,16 +106,16 @@ typedef struct _DRAW_GLYPHS_CTXT {
|
||||
int advance;
|
||||
} DRAW_GLYPHS_CTXT;
|
||||
|
||||
static BOOL cb_draw_glyph (void* context, Glyph32 glyph_value, unsigned int glyph_type)
|
||||
static BOOL cb_draw_glyph (void* context, Glyph32 glyph_value, unsigned int char_type)
|
||||
{
|
||||
DRAW_GLYPHS_CTXT* ctxt = (DRAW_GLYPHS_CTXT*)context;
|
||||
int adv_x, adv_y;
|
||||
int bkmode;
|
||||
|
||||
if (check_zero_width(glyph_type)) {
|
||||
if (check_zero_width(char_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else if (check_vowel(glyph_type)) {
|
||||
else if (check_vowel(char_type)) {
|
||||
bkmode = GetBkMode (ctxt->hdc);
|
||||
//SetBkMode (ctxt->hdc, BM_TRANSPARENT);
|
||||
DrawGlyph (ctxt->hdc, ctxt->x, ctxt->y, glyph_value, &adv_x, &adv_y);
|
||||
@@ -163,16 +163,16 @@ typedef struct _TEXTOUT_CTXT
|
||||
} TEXTOUT_CTXT;
|
||||
|
||||
static BOOL cb_textout (void* context, Glyph32 glyph_value,
|
||||
unsigned int glyph_type)
|
||||
unsigned int char_type)
|
||||
{
|
||||
TEXTOUT_CTXT* ctxt = (TEXTOUT_CTXT*)context;
|
||||
int adv_x, adv_y;
|
||||
int bkmode;
|
||||
|
||||
if (check_zero_width (glyph_type)) {
|
||||
if (check_zero_width (char_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else if (check_vowel(glyph_type)) {
|
||||
else if (check_vowel(char_type)) {
|
||||
if (!ctxt->only_extent) {
|
||||
bkmode = ctxt->pdc->bkmode;
|
||||
//ctxt->pdc->bkmode = BM_TRANSPARENT;
|
||||
@@ -326,7 +326,7 @@ typedef struct _TEXTOUTOMITTED_CTXT
|
||||
Uint32 max_extent;
|
||||
} TEXTOUTOMITTED_CTXT;
|
||||
|
||||
static BOOL cb_textout_omitted (void* context, Glyph32 glyph_value, unsigned int glyph_type)
|
||||
static BOOL cb_textout_omitted (void* context, Glyph32 glyph_value, unsigned int char_type)
|
||||
{
|
||||
TEXTOUTOMITTED_CTXT* ctxt = (TEXTOUTOMITTED_CTXT*)context;
|
||||
int adv_x, adv_y;
|
||||
@@ -334,10 +334,10 @@ static BOOL cb_textout_omitted (void* context, Glyph32 glyph_value, unsigned int
|
||||
//BBOX bbox;
|
||||
int bkmode = ctxt->pdc->bkmode;
|
||||
|
||||
if (check_zero_width(glyph_type)) {
|
||||
if (check_zero_width(char_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else if (check_vowel(glyph_type)) {
|
||||
else if (check_vowel(char_type)) {
|
||||
//ctxt->pdc->bkmode = BM_TRANSPARENT;
|
||||
_gdi_draw_one_glyph (ctxt->pdc, glyph_value,
|
||||
(ctxt->pdc->ta_flags & TA_X_MASK) != TA_RIGHT,
|
||||
@@ -463,7 +463,7 @@ int GUIAPI GetTextExtentPoint (HDC hdc, const char* text, int len,
|
||||
size->cx = size->cy = 0;
|
||||
|
||||
/* This function does not support BIDI */
|
||||
if (mbc_devfont && pdc->bidi_flags && mbc_devfont->charset_ops->bidi_glyph_type)
|
||||
if (mbc_devfont && pdc->bidi_flags && mbc_devfont->charset_ops->bidi_char_type)
|
||||
return -1;
|
||||
|
||||
_gdi_start_new_line(pdc);
|
||||
@@ -482,7 +482,7 @@ int GUIAPI GetTextExtentPoint (HDC hdc, const char* text, int len,
|
||||
int i, dfi;
|
||||
DEVFONT* df;
|
||||
|
||||
glyph_value = (*mbc_devfont->charset_ops->char_glyph_value)(NULL,
|
||||
glyph_value = (*mbc_devfont->charset_ops->get_char_value)(NULL,
|
||||
0, (const unsigned char*)text, 0);
|
||||
|
||||
dfi = 1;
|
||||
@@ -505,7 +505,7 @@ int GUIAPI GetTextExtentPoint (HDC hdc, const char* text, int len,
|
||||
if ((len_cur_char = sbc_devfont->charset_ops->len_first_char
|
||||
((const unsigned char*)text, left_bytes)) > 0) {
|
||||
|
||||
glyph_value = (*sbc_devfont->charset_ops->char_glyph_value)(
|
||||
glyph_value = (*sbc_devfont->charset_ops->get_char_value)(
|
||||
NULL, 0, (const unsigned char*)text, 0);
|
||||
advance_cur_char = _gdi_get_glyph_advance (pdc, glyph_value,
|
||||
(pdc->ta_flags & TA_X_MASK) == TA_LEFT,
|
||||
|
||||
Reference in New Issue
Block a user