From 9cca87878cd1569eefa4cb68d55da41d4636519d Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Wed, 27 Mar 2019 19:28:19 +0800 Subject: [PATCH] tune CB_GLYPH_LAID_OUT --- include/gdi.h | 4 ++-- src/newgdi/layout-utils.c | 4 +--- src/newgdi/layoutinfo.c | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/gdi.h b/include/gdi.h index 9bee0c04..95eaf9b3 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -12807,8 +12807,8 @@ MG_EXPORT LAYOUTINFO* GUIAPI CreateLayoutInfo( MG_EXPORT BOOL GUIAPI DestroyLayoutInfo(LAYOUTINFO* layout_info); typedef BOOL (*CB_GLYPH_LAID_OUT) (GHANDLE ctxt, - const TEXTRUNSINFO *truninfo, int uc_index, LOGFONT* lf, - Uchar32 uc, Glyph32 gv, const GLYPHPOS* pos); + const TEXTRUNSINFO *truninfo, int uc_index, + Uchar32 uc, LOGFONT* lf, Glyph32 gv, const GLYPHPOS* pos); /** * \fn LAYOUTLINE* GUIAPI LayoutNextLine(LAYOUTINFO* layout_info, diff --git a/src/newgdi/layout-utils.c b/src/newgdi/layout-utils.c index 660da816..d2e8b84e 100644 --- a/src/newgdi/layout-utils.c +++ b/src/newgdi/layout-utils.c @@ -146,10 +146,8 @@ LayoutRun* __mg_layout_run_new_orphan(const LAYOUTINFO* layout, lrun = malloc(sizeof(LayoutRun)); lrun->lf = lf; lrun->ucs = ucs; - lrun->si = 0; - lrun->len = nr_ucs; lrun->si = trun->si; - lrun->len = trun->len; + lrun->len = nr_ucs; lrun->lc = trun->lc; lrun->st = UCharGetScriptType(ucs[0]); lrun->el = trun->el; diff --git a/src/newgdi/layoutinfo.c b/src/newgdi/layoutinfo.c index 6f3e70bd..b30ab80c 100644 --- a/src/newgdi/layoutinfo.c +++ b/src/newgdi/layoutinfo.c @@ -1660,7 +1660,6 @@ static int traverse_line_glyphs(const LAYOUTINFO* layout, ShapedGlyph* glyph_info; uc = run->lrun->ucs[run->gstr->log_clusters[j]]; - index = run->lrun->si + run->gstr->log_clusters[j]; glyph_info = run->gstr->glyphs + j; @@ -1683,8 +1682,8 @@ static int traverse_line_glyphs(const LAYOUTINFO* layout, } } - cb_laid_out(ctxt, layout->truninfo, index, run->lrun->lf, - uc, glyph_info->gv, &pos); + cb_laid_out(ctxt, layout->truninfo, index, uc, + run->lrun->lf, glyph_info->gv, &pos); line_adv += glyph_info->width; }