tune interfaces of GetShapedGlyphsXXX

This commit is contained in:
Vincent Wei
2019-03-14 12:34:21 +08:00
parent 4ba0bcd0fe
commit 1e1dd76fb1
6 changed files with 257 additions and 283 deletions
+227 -259
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -594,7 +594,7 @@ static void bidi_resolve_string (const CHARSETOPS* charset_ops,
typedef struct _REORDER_CONTEXT {
Achar32* achars;
void* extra;
CB_REVERSE_EXTRA cb;
CB_REVERSE_ARRAY cb;
} REORDER_CONTEXT;
static void bidi_reverse_achars (Achar32* achars, int len, int pos)
@@ -764,7 +764,7 @@ Achar32* __mg_legacy_bidi_index_reorder (const CHARSETOPS* charset_ops,
Achar32* __mg_legacy_bidi_achars_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel,
void* extra, CB_REVERSE_EXTRA cb_reverse_extra)
void* extra, CB_REVERSE_ARRAY cb_reverse_extra)
{
BYTE max_level = 1;
TYPERUN *type_rl_list = NULL;
+1 -1
View File
@@ -1599,7 +1599,7 @@ BidiLevel UBidiReorderLine(Uint32 flags,
const BidiType *bidi_types, int len, int off,
BidiType paragraph_dir, BidiLevel *embedding_levels,
Uchar32 *visual_str, int *map,
void* extra, CB_REVERSE_EXTRA cb_reverse_extra)
void* extra, CB_REVERSE_ARRAY cb_reverse_extra)
{
BOOL status = FALSE;
BidiLevel max_level = 0;
+1 -1
View File
@@ -92,7 +92,7 @@ typedef struct _BIDICHAR_MIRROR_MAP {
Achar32* __mg_legacy_bidi_achars_reorder (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel,
void* extra, CB_REVERSE_EXTRA cb_reverse_extra);
void* extra, CB_REVERSE_ARRAY cb_reverse_extra);
void __mg_legacy_bidi_get_embeddlevels (const CHARSETOPS* charset_ops,
Achar32* achars, int len, int pel, Uint8* embedding_levels, Uint8 type);
+1 -1
View File
@@ -1446,7 +1446,7 @@ Achar32* GUIAPI BIDILogAChars2VisAChars(LOGFONT* log_font,
BOOL GUIAPI BIDILogAChars2VisACharsEx(LOGFONT* log_font,
Achar32* achs, int nr_achars, int pel,
void* extra, CB_REVERSE_EXTRA cb_reorder_extra)
void* extra, CB_REVERSE_ARRAY cb_reorder_extra)
{
DEVFONT* mbc_devfont = log_font->devfonts[1];
+25 -19
View File
@@ -78,13 +78,12 @@ static void bidi_reverse_shaped_glyphs (void* context, int len, int pos)
#endif
int GUIAPI GetShapedGlyphsBasic(LOGFONT* logfont,
UCharScriptType writing_system,
Uint8 ctr, Uint8 wbr, Uint8 lbp,
const Uchar32* logical_ucs, int nr_ucs,
BidiType* paragraph_dir,
Glyph32* visual_glyphs, GLYPHSHAPINGINFO* glyph_shaping_info,
Uint16* break_oppos, int* map_v2l, int* nr_glyphs)
LanguageCode lang_code, UCharScriptType writing_system,
const Uchar32* ucs, int nr_ucs,
const BidiLevel embedding_levels, BidiType base_dir,
SHAPEDGLYPHS* shaped_glyphs)
{
#if 0
int ret_value = 0;
int i, j, nr_reordered;
BidiLevel max_level = 0;
@@ -260,22 +259,24 @@ out:
free (brk_ts);
return ret_value;
#endif
return 0;
}
int GUIAPI GetShapedGlyphsComplex(LOGFONT* logfont,
UCharScriptType writing_system,
Uint8 ctr, Uint8 wbr, Uint8 lbp,
const Uchar32* logical_ucs, int nr_ucs,
BidiType* paragraph_dir,
Glyph32* visual_glyphs, GLYPHSHAPINGINFO* glyph_shaping_info,
Uint16* break_oppos, int* map_v2l, int* nr_glyphs)
LanguageCode lang_code, UCharScriptType writing_system,
Uint32 render_flags, const Uchar32* ucs, int nr_ucs,
const BidiLevel embedding_levels, BidiType base_dir,
SHAPEDGLYPHS* shaped_glyphs)
{
return 0;
}
int GUIAPI GetGlyphsExtentInfo(LOGFONT* logfont,
const Glyph32* glyphs, const GLYPHSHAPINGINFO* glyph_shaping_info,
int nr_glyphs, Uint32 render_flags,
LanguageCode lang_code, UCharScriptType writing_system,
Uint32 render_flags, const Uchar32* ucs, int nr_ucs,
const BidiLevel embedding_levels, BidiType base_dir,
const SHAPEDGLYPHS* shaped_glyphs,
GLYPHEXTINFO* glyph_ext_info, LOGFONT** logfont_sideways)
{
return 0;
@@ -283,8 +284,10 @@ int GUIAPI GetGlyphsExtentInfo(LOGFONT* logfont,
int GUIAPI GetGlyphsPositionInfo(
LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
const Glyph32* glyphs, const GLYPHSHAPINGINFO* glyph_shaping_info,
const Uint16* break_oppos, int nr_glyphs,
const Uchar32* ucs, int nr_ucs,
const Uint16* break_oppos,
const BidiLevel embedding_levels, BidiType base_dir,
const SHAPEDGLYPHS* shaped_glyphs,
Uint32 render_flags, int x, int y,
int letter_spacing, int word_spacing, int tab_size, int max_extent,
GLYPHEXTINFO* glyph_ext_info, SIZE* line_size, GLYPHPOS* glyph_pos)
@@ -294,7 +297,7 @@ int GUIAPI GetGlyphsPositionInfo(
int GUIAPI DrawShapedGlyphString(HDC hdc,
LOGFONT* logfont_upright, LOGFONT* logfont_sideways,
const Glyph32* glyphs, const GLYPHSHAPINGINFO* glyph_shaping_info,
const SHAPEDGLYPHS* shaped_glyphs,
const GLYPHPOS* glyph_pos, int nr_glyphs)
{
int i;
@@ -302,7 +305,7 @@ int GUIAPI DrawShapedGlyphString(HDC hdc,
Uint32 old_ta;
PLOGFONT old_lf;
if (glyphs == NULL || glyph_pos == NULL || nr_glyphs <= 0)
if (shaped_glyphs == NULL || glyph_pos == NULL || nr_glyphs <= 0)
return 0;
old_ta = SetTextAlign(hdc, TA_LEFT | TA_TOP | TA_UPDATECP);
@@ -310,6 +313,9 @@ int GUIAPI DrawShapedGlyphString(HDC hdc,
for (i = 0; i < nr_glyphs; i++) {
if (glyph_pos[i].suppressed == 0 && glyph_pos[i].whitespace == 0) {
Glyph32 gv = shaped_glyphs->cb_get_glyph_info(
shaped_glyphs->shaping_engine, shaped_glyphs->glyph_infos,
i, NULL);
if (glyph_pos[i].orientation == GLYPH_ORIENTATION_UPRIGHT) {
if (logfont_upright)
SelectFont(hdc, logfont_upright);
@@ -323,7 +329,7 @@ int GUIAPI DrawShapedGlyphString(HDC hdc,
goto error;
}
DrawGlyph(hdc, glyph_pos[i].x, glyph_pos[i].y, glyphs[i],
DrawGlyph(hdc, glyph_pos[i].x, glyph_pos[i].y, gv,
NULL, NULL);
n++;