Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5c1b8f

Browse files
committed
Improve unicodeenc setting logic
1 parent 8c34fd6 commit e5c1b8f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fontforge/parsettf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4542,9 +4542,9 @@ return( ret );
45424542
will swap it in. */
45434543
static void addttfencoding(SplineChar *sc, int unc) {
45444544
struct altuni *alt;
4545-
if ( unc==-1 ) {
4545+
if ( unc==-1 || sc->unicodeenc==unc ) {
45464546
return;
4547-
} else if (sc->unicodeenc==-1 || sc->unicodeenc==unc) {
4547+
} else if ( sc->unicodeenc==-1 ) {
45484548
sc->unicodeenc = unc;
45494549
return;
45504550
} else {
@@ -4826,7 +4826,7 @@ return;
48264826
} else {
48274827
if ( uenc!=-1 && dounicode ) used[uenc] = true;
48284828
if ( dounicode )
4829-
addttfencoding(info->chars[(uint16) (j+delta[i])], uenc);
4829+
addttfencoding(info->chars[(uint16_t) (j+delta[i])], uenc);
48304830
if ( map!=NULL && lenc<map->enccount )
48314831
map->map[lenc] = (uint16_t) (j+delta[i]);
48324832
}

0 commit comments

Comments
 (0)