some minor changes

This commit is contained in:
Vincent Wei
2019-03-15 18:24:37 +08:00
parent 9a8d997f63
commit 6838a67e7d
2 changed files with 19 additions and 0 deletions
+13
View File
@@ -80,6 +80,8 @@ GLYPHRUNINFO* GUIAPI CreateGlyphRunInfo(
BidiBracketType local_brk_ts[LOCAL_ARRAY_SIZE];
BidiBracketType *brk_ts = NULL;
BidiLevel level_or, level_and;
ScriptType script_type = SCRIPT_COMMON;
int i, j;
@@ -122,10 +124,15 @@ GLYPHRUNINFO* GUIAPI CreateGlyphRunInfo(
// remove the bidi marks from embedding levels and original string.
j = 0;
level_or = 0, level_and = 1;
for (i = 0; i < nr_ucs; i++) {
if (!BIDI_IS_EXPLICIT_OR_BN (bidi_ts[i])) {
els[j] = els[i];
ucs[j] = ucs[i];
level_or |= els[j];
level_and &= els[j];
j++;
}
}
@@ -137,6 +144,12 @@ GLYPHRUNINFO* GUIAPI CreateGlyphRunInfo(
goto out;
}
// check for all even or odd
/* If none of the levels had the LSB set, all chars were even. */
runinfo->all_even = (level_or & 0x1) == 0;
/* If all of the levels had the LSB set, all chars were odd. */
runinfo->all_odd = (level_and & 0x1) == 1;
runinfo->ucs = ucs;
runinfo->nr_ucs = nr_ucs;
runinfo->els = els;
+6
View File
@@ -78,6 +78,8 @@ typedef enum {
GR_DIRECTION_BTT
} GlyphRunDir;
// NOTE: we arrange the fields carefully to avoid wasting space when
// we allocate an array of this structure.
typedef struct _MAPL2G {
// Glyph index in the run; Less than 0 if it is ignored.
Sint32 glyph_index;
@@ -116,6 +118,10 @@ struct _GLYPHRUNINFO {
int nr_ucs;
int nr_runs;
ParagraphDir base_dir;
/* The following fields will be initialized by CreateGlyphRunInfo. */
Uint8 all_even;
Uint8 all_odd;
};
#ifdef __cplusplus