mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-25 19:13:46 +08:00
call REAL_GLYPH for devfont operators
This commit is contained in:
+4
-2
@@ -3574,9 +3574,11 @@ static unsigned int unicode_glyph_type (Glyph32 glyph_value)
|
||||
basic_type = TYPE(glyph_value);
|
||||
break_type = PROP(glyph_value);
|
||||
|
||||
if (ISZEROWIDTHTYPE(basic_type)) {
|
||||
if (glyph_value != 0x00AD && ISZEROWIDTHTYPE (basic_type))
|
||||
mchar_type = MCHAR_TYPE_ZEROWIDTH;
|
||||
else if ((glyph_value >= 0x1160 && glyph_value < 0x1200)
|
||||
|| glyph_value == 0x200B)
|
||||
mchar_type = MCHAR_TYPE_ZEROWIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
return (break_type << 24) | (basic_type << 16) | mchar_type;
|
||||
|
||||
+11
-5
@@ -294,7 +294,7 @@ static void start_str_output (LOGFONT* logfont, DEVFONT* devfont)
|
||||
/* call this function before getting the bitmap/pixmap of the char
|
||||
* to get the bbox of the char */
|
||||
static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value,
|
||||
Glyph32 glyph_value,
|
||||
int* px, int* py, int* pwidth, int* pheight)
|
||||
{
|
||||
TT_UShort uni_char;
|
||||
@@ -304,6 +304,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
TT_Glyph_Metrics metrics;
|
||||
TT_BBox bbox;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
TTFINSTANCEINFO* ttf_inst_info = TTF_INST_INFO_P (devfont);
|
||||
TTFGLYPHINFO* ttf_glyph_info = ttf_inst_info->ttf_glyph_info;
|
||||
|
||||
@@ -440,12 +441,13 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
/* call this function to get the bitmap/pixmap of the char */
|
||||
static const void*
|
||||
char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, BOOL is_grey)
|
||||
Glyph32 glyph_value, int* pitch, BOOL is_grey)
|
||||
{
|
||||
TT_Raster_Map Raster;
|
||||
TT_Error error;
|
||||
TTFINSTANCEINFO* ttf_inst_info = TTF_INST_INFO_P (devfont);
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
/* now allocate the raster bitmap */
|
||||
Raster.rows = ttf_inst_info->cur_height;
|
||||
Raster.width = ttf_inst_info->cur_width;
|
||||
@@ -538,15 +540,17 @@ char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (scale) *scale = 1;
|
||||
return char_bitmap_pixmap (logfont, devfont, glyph_value, pitch, FALSE);
|
||||
}
|
||||
|
||||
static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (scale) *scale = 1;
|
||||
return char_bitmap_pixmap (logfont, devfont, glyph_value, pitch, TRUE);
|
||||
}
|
||||
@@ -554,12 +558,13 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
/* call this function after getting the bitmap/pixmap of the char
|
||||
* to get the advance of the char */
|
||||
static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* px, int* py)
|
||||
Glyph32 glyph_value, int* px, int* py)
|
||||
{
|
||||
TT_Pos vec_x, vec_y;
|
||||
TTFINSTANCEINFO* ttf_inst_info = TTF_INST_INFO_P (devfont);
|
||||
TTFGLYPHINFO* ttf_glyph_info = TTF_GLYPH_INFO_P (devfont);
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (ttf_inst_info->rotation) {
|
||||
vec_x = ttf_inst_info->cur_advance;
|
||||
vec_y = 0;
|
||||
@@ -754,6 +759,7 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
||||
TTFINSTANCEINFO* ttf_inst_info = TTF_INST_INFO_P (devfont);
|
||||
TTFGLYPHINFO* ttf_glyph_info = ttf_inst_info->ttf_glyph_info;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uni_char = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
|
||||
+12
-5
@@ -346,7 +346,7 @@ load_or_search_glyph (FTINSTANCEINFO* ft_inst_info, FT_Face* face,
|
||||
* to get the bbox of the char */
|
||||
static int
|
||||
get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value,
|
||||
Glyph32 glyph_value,
|
||||
int* px, int* py, int* pwidth, int* pheight)
|
||||
{
|
||||
|
||||
@@ -358,6 +358,7 @@ get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
bbox.xMin = bbox.yMin = 32000;
|
||||
bbox.xMax = bbox.yMax = -32000;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
uni_char = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
@@ -482,7 +483,7 @@ error:
|
||||
/* call this function to get the bitmap/pixmap of the char */
|
||||
static const void*
|
||||
char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, BOOL is_grey)
|
||||
Glyph32 glyph_value, int* pitch, BOOL is_grey)
|
||||
{
|
||||
FT_BitmapGlyph glyph_bitmap;
|
||||
FT_Bitmap* source;
|
||||
@@ -491,6 +492,8 @@ char_bitmap_pixmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
BYTE* buffer = NULL;
|
||||
FTINSTANCEINFO* ft_inst_info = FT_INST_INFO_P (devfont);
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
|
||||
FT_LOCK(&ft_lock);
|
||||
|
||||
if (IS_SUBPIXEL(logfont))
|
||||
@@ -610,17 +613,19 @@ error:
|
||||
|
||||
static const void*
|
||||
get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (scale) *scale = 1;
|
||||
return char_bitmap_pixmap (logfont, devfont, glyph_value, pitch, FALSE);
|
||||
}
|
||||
|
||||
static const void*
|
||||
get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch,
|
||||
Glyph32 glyph_value, int* pitch,
|
||||
unsigned short* scale)
|
||||
{
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (scale) *scale = 1;
|
||||
return char_bitmap_pixmap (logfont, devfont, glyph_value, pitch, TRUE);
|
||||
}
|
||||
@@ -643,11 +648,12 @@ start_str_output (LOGFONT* logfont, DEVFONT* devfont)
|
||||
* to get the advance of the char */
|
||||
static int
|
||||
get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* px, int* py)
|
||||
Glyph32 glyph_value, int* px, int* py)
|
||||
{
|
||||
FT_Fixed advance;
|
||||
FTINSTANCEINFO* ft_inst_info = FT_INST_INFO_P (devfont);
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (ft_inst_info->use_kerning
|
||||
&& ft_inst_info->prev_index && ft_inst_info->cur_index) {
|
||||
if (ft_inst_info->is_index_old) {
|
||||
@@ -876,6 +882,7 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
||||
FT_UInt uni_char;
|
||||
FTINSTANCEINFO* ft_inst_info = FT_INST_INFO_P (devfont);
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
uni_char = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
|
||||
+7
-2
@@ -329,12 +329,13 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
unsigned int uc16;
|
||||
QPF_GLYPH* glyph;
|
||||
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
uc16 = glyph_value;
|
||||
@@ -370,6 +371,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
unsigned int uc16;
|
||||
QPF_GLYPH* glyph;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (scale)
|
||||
*scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
@@ -400,6 +402,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
QPF_GLYPH* glyph;
|
||||
unsigned short scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
@@ -452,6 +455,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
QPF_GLYPH* glyph;
|
||||
int advance;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
@@ -498,6 +502,7 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
||||
unsigned int uc16;
|
||||
QPF_GLYPH* glyph;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uc16 = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
|
||||
@@ -204,13 +204,13 @@ static int get_font_descent (LOGFONT* logfont, DEVFONT* devfont)
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
int bitmap_size;
|
||||
Glyph32 glyph_tmp = glyph_value;
|
||||
|
||||
if (glyph_tmp >= RBFONT_INFO_P (devfont)->nr_glyphs)
|
||||
glyph_tmp = devfont->charset_ops->def_glyph_value;
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (glyph_value >= RBFONT_INFO_P (devfont)->nr_glyphs)
|
||||
glyph_value = devfont->charset_ops->def_glyph_value;
|
||||
|
||||
bitmap_size = ((RBFONT_INFO_P (devfont)->width + 7) >> 3)
|
||||
* RBFONT_INFO_P (devfont)->height;
|
||||
@@ -220,12 +220,13 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
if (scale)
|
||||
*scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_tmp;
|
||||
return RBFONT_INFO_P (devfont)->data + bitmap_size * glyph_value;
|
||||
}
|
||||
|
||||
static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Glyph32 glyph_value)
|
||||
{
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (glyph_value > RBFONT_INFO_P(devfont)->nr_glyphs)
|
||||
return FALSE;
|
||||
else
|
||||
|
||||
@@ -334,6 +334,7 @@ static int get_glyph_width (LOGFONT* logfont, DEVFONT* devfont,
|
||||
SeLogFont selogfont;
|
||||
int width;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -440,6 +441,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
printf("in get_glyph_greybitmap....\n");
|
||||
#endif
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -466,7 +468,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
seunichar16 wc;
|
||||
SeLogFont selogfont;
|
||||
@@ -476,6 +478,7 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
printf("in get_char_bitmap....\n");
|
||||
#endif
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -505,6 +508,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
if(px == 0 && py == 0 && pwidth == 0 && pheight == 0)
|
||||
return 1;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -534,6 +538,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
SeLogFont selogfont;
|
||||
int x = *px;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (devfont->charset_ops->conv_to_uc32)
|
||||
wc = (*devfont->charset_ops->conv_to_uc32)(glyph_value);
|
||||
else
|
||||
@@ -558,6 +563,7 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
||||
int uni_char;
|
||||
int x, y, width, height;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if(devfont->charset_ops->conv_to_uc32)
|
||||
uni_char = (*devfont->charset_ops->conv_to_uc32) (glyph_value);
|
||||
else
|
||||
|
||||
+6
-1
@@ -275,12 +275,13 @@ print_bitmap(char* bits, int width, int height, int pitch)
|
||||
#endif
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
unsigned int uc16;
|
||||
UPFGLYPH* glyph;
|
||||
Uint8 * p_upf;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir;
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
@@ -328,6 +329,7 @@ static const void* get_glyph_greybitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
UPFGLYPH* glyph;
|
||||
Uint8 * p_upf;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir;
|
||||
|
||||
if (scale)
|
||||
@@ -369,6 +371,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
unsigned short scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
Uint8 * p_upf;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir;
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
@@ -426,6 +429,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
Uint8 * p_upf;
|
||||
int advance;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir;
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
@@ -485,6 +489,7 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
||||
UPFGLYPH* glyph;
|
||||
Uint8 * p_upf;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
p_upf = (Uint8 *)UPFONT_INFO_P (devfont)->root_dir;
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
@@ -111,6 +111,7 @@ static int get_ch_width (LOGFONT* logfont, DEVFONT* devfont,
|
||||
if (vbf_info->bits_offset == NULL)
|
||||
return vbf_info->max_width * scale;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
return vbf_info->advance_x [glyph_value - vbf_info->first_glyph] * scale;
|
||||
}
|
||||
|
||||
@@ -165,6 +166,7 @@ static int get_glyph_bbox (LOGFONT* logfont, DEVFONT* devfont,
|
||||
VBFINFO* vbf_info = VARFONT_INFO_P (devfont);
|
||||
unsigned short scale = GET_DEVFONT_SCALE (logfont, devfont);
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (glyph_value < vbf_info->first_glyph || glyph_value > vbf_info->last_glyph)
|
||||
glyph_value = vbf_info->def_glyph;
|
||||
|
||||
@@ -225,6 +227,7 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
int advance;
|
||||
VBFINFO* vbf_info = VARFONT_INFO_P (devfont);
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (glyph_value < vbf_info->first_glyph || glyph_value > vbf_info->last_glyph)
|
||||
glyph_value = vbf_info->def_glyph;
|
||||
|
||||
@@ -234,10 +237,10 @@ static int get_glyph_advance (LOGFONT* logfont, DEVFONT* devfont,
|
||||
}
|
||||
|
||||
static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
Glyph32 glyph_value, int* pitch, unsigned short* scale)
|
||||
{
|
||||
int offset;
|
||||
Glyph32 eff_value = glyph_value;
|
||||
Glyph32 eff_value;
|
||||
Glyph32 first_value;
|
||||
Glyph32 last_value;
|
||||
VBFINFO* vbf_info = VARFONT_INFO_P (devfont);
|
||||
@@ -245,6 +248,8 @@ static const void* get_glyph_monobitmap (LOGFONT* logfont, DEVFONT* devfont,
|
||||
first_value = vbf_info->first_glyph;
|
||||
last_value = vbf_info->last_glyph;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
eff_value = glyph_value;
|
||||
if (glyph_value < first_value || glyph_value > last_value)
|
||||
eff_value = vbf_info->def_glyph;
|
||||
|
||||
@@ -296,12 +301,13 @@ static BOOL is_glyph_existed (LOGFONT* logfont, DEVFONT* devfont, Glyph32 glyph_
|
||||
{
|
||||
Glyph32 first_value;
|
||||
Glyph32 last_value;
|
||||
|
||||
|
||||
VBFINFO* vbf_info = VARFONT_INFO_P (devfont);
|
||||
|
||||
first_value = vbf_info->first_glyph;
|
||||
last_value = vbf_info->last_glyph;
|
||||
|
||||
glyph_value = REAL_GLYPH(glyph_value);
|
||||
if (glyph_value < first_value || glyph_value > last_value)
|
||||
return FALSE;
|
||||
else
|
||||
|
||||
+4
-24
@@ -89,29 +89,9 @@ void dbg_dumpDevFonts (void);
|
||||
|
||||
#define INV_GLYPH_VALUE -1
|
||||
|
||||
static inline BOOL check_zero_width(Glyph32 g, unsigned int t)
|
||||
static inline BOOL check_zero_width(unsigned int t)
|
||||
{
|
||||
unsigned int mchar_type = t & GLYPHTYPE_MCHAR_MASK;
|
||||
|
||||
if (mchar_type) {
|
||||
if (mchar_type == MCHAR_TYPE_ZEROWIDTH
|
||||
|| (mchar_type & MCHAR_TYPE_NOSPACING_MARK))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
t = (t & GLYPHTYPE_BASIC_MASK) >> 16;
|
||||
if (g != 0x00AD
|
||||
&& (t == UCHAR_TYPE_NON_SPACING_MARK
|
||||
|| t == UCHAR_TYPE_ENCLOSING_MARK
|
||||
|| t == UCHAR_TYPE_FORMAT))
|
||||
return TRUE;
|
||||
else if ((g >= 0x1160 && g < 0x1200)
|
||||
|| g == 0x200B)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
return (t & GLYPHTYPE_MCHAR_MASK) == MCHAR_TYPE_ZEROWIDTH;
|
||||
}
|
||||
|
||||
static inline BOOL check_vowel(unsigned int t)
|
||||
@@ -252,11 +232,11 @@ struct _FONTOPS
|
||||
|
||||
/** The method to get mono-bitmap function. */
|
||||
const void* (*get_glyph_monobitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
const Glyph32 glyph_value, int* pitch, unsigned short* scale);
|
||||
Glyph32 glyph_value, 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 Glyph32 galph_value, int* pitch, unsigned short* scale);
|
||||
Glyph32 galph_value, int* pitch, unsigned short* scale);
|
||||
|
||||
/** The method to get the pre-rendered bitmap of one glyph. */
|
||||
int (*get_glyph_prbitmap) (LOGFONT* logfont, DEVFONT* devfont,
|
||||
|
||||
+9
-18
@@ -117,11 +117,9 @@ static Glyph32* _gdi_get_glyphs_string(PDC pdc, const unsigned char* text,
|
||||
static int inline get_glyph_type (LOGFONT* logfont, Glyph32 glyph_value)
|
||||
{
|
||||
if (IS_MBC_GLYPH (glyph_value))
|
||||
return logfont->mbc_devfont->charset_ops->glyph_type
|
||||
(REAL_GLYPH (glyph_value));
|
||||
return logfont->mbc_devfont->charset_ops->glyph_type(glyph_value);
|
||||
else
|
||||
return logfont->sbc_devfont->charset_ops->glyph_type
|
||||
(glyph_value);
|
||||
return logfont->sbc_devfont->charset_ops->glyph_type(glyph_value);
|
||||
}
|
||||
|
||||
static int inline get_glyph_advance_in_dc (PDC pdc, Glyph32 glyph_value)
|
||||
@@ -421,11 +419,9 @@ static int _gdi_output_glyphs_direct(PDC pdc, const unsigned char* text,
|
||||
|
||||
do_glyph:
|
||||
if (IS_MBC_GLYPH (glyph_value))
|
||||
glyph_type = mbc_devfont->charset_ops->glyph_type
|
||||
(REAL_GLYPH (glyph_value));
|
||||
glyph_type = mbc_devfont->charset_ops->glyph_type (glyph_value);
|
||||
else
|
||||
glyph_type = sbc_devfont->charset_ops->glyph_type
|
||||
(glyph_value);
|
||||
glyph_type = sbc_devfont->charset_ops->glyph_type (glyph_value);
|
||||
|
||||
if(if_break){
|
||||
DRAWTEXTEX2_CTXT _txt;
|
||||
@@ -1082,22 +1078,19 @@ int GUIAPI GetGlyphsExtentPoint(
|
||||
size->cy = 0;
|
||||
|
||||
while(i < nr_glyphs){
|
||||
Glyph32 rg;
|
||||
devfont = SELECT_DEVFONT(log_font, glyphs[i]);
|
||||
rg = REAL_GLYPH(glyphs[i]);
|
||||
glyph_type = devfont->charset_ops->glyph_type(rg);
|
||||
glyph_type = devfont->charset_ops->glyph_type(glyphs[i]);
|
||||
|
||||
if (check_zero_width (rg, glyph_type)) {
|
||||
if (check_zero_width (glyph_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else {
|
||||
advance += _gdi_get_glyph_advance (pdc, glyphs[i],
|
||||
(pdc->ta_flags & TA_X_MASK) != TA_RIGHT,
|
||||
0, 0, &adv_x, &adv_y, NULL);
|
||||
|
||||
}
|
||||
|
||||
if(max_extent > 0 && advance > max_extent)
|
||||
if (max_extent > 0 && advance > max_extent)
|
||||
break;
|
||||
|
||||
size->cx += adv_x;
|
||||
@@ -1137,12 +1130,10 @@ int GUIAPI GetGlyphsExtent(
|
||||
size->cx = 0;
|
||||
size->cy = 0;
|
||||
while (i < nr_glyphs) {
|
||||
Glyph32 rg;
|
||||
rg = REAL_GLYPH(glyphs[i]);
|
||||
devfont = SELECT_DEVFONT(log_font, glyphs[i]);
|
||||
glyph_type = devfont->charset_ops->glyph_type(rg);
|
||||
glyph_type = devfont->charset_ops->glyph_type(glyphs[i]);
|
||||
|
||||
if (check_zero_width (rg, glyph_type)) {
|
||||
if (check_zero_width (glyph_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else {
|
||||
|
||||
+1
-2
@@ -149,14 +149,13 @@ int GUIAPI DrawGlyph (HDC hdc, int x, int y, Glyph32 glyph_value,
|
||||
|
||||
PDC pdc = dc_HDC2PDC(hdc);
|
||||
DEVFONT* devfont = SELECT_DEVFONT(pdc->pLogFont, glyph_value);
|
||||
glyph_value = REAL_GLYPH (glyph_value);
|
||||
|
||||
/* Transfer logical to device to screen here. */
|
||||
coor_LP2SP (pdc, &x, &y);
|
||||
pdc->rc_output = pdc->DevRC;
|
||||
|
||||
glyph_type = devfont->charset_ops->glyph_type (glyph_value);
|
||||
if (check_zero_width(glyph_value, glyph_type)) {
|
||||
if (check_zero_width(glyph_type)) {
|
||||
if (adv_x) *adv_x = 0;
|
||||
if (adv_y) *adv_y = 0;
|
||||
advance = 0;
|
||||
|
||||
@@ -112,7 +112,7 @@ static BOOL cb_draw_glyph (void* context, Glyph32 glyph_value, unsigned int glyp
|
||||
int adv_x, adv_y;
|
||||
int bkmode;
|
||||
|
||||
if (check_zero_width(glyph_value, glyph_type)) {
|
||||
if (check_zero_width(glyph_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else if (check_vowel(glyph_type)) {
|
||||
@@ -168,7 +168,7 @@ static BOOL cb_textout (void* context, Glyph32 glyph_value, unsigned int glyph_t
|
||||
int adv_x, adv_y;
|
||||
int bkmode;
|
||||
|
||||
if (check_zero_width (glyph_value, glyph_type)) {
|
||||
if (check_zero_width (glyph_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else if (check_vowel(glyph_type)) {
|
||||
@@ -334,7 +334,7 @@ static BOOL cb_textout_omitted (void* context, Glyph32 glyph_value, unsigned int
|
||||
//BBOX bbox;
|
||||
int bkmode = ctxt->pdc->bkmode;
|
||||
|
||||
if (check_zero_width(glyph_value, glyph_type)) {
|
||||
if (check_zero_width(glyph_type)) {
|
||||
adv_x = adv_y = 0;
|
||||
}
|
||||
else if (check_vowel(glyph_type)) {
|
||||
|
||||
Reference in New Issue
Block a user