Skip to content

Commit

Permalink
[makeotfexe] Allow glyph at GID 0 in glyph classes
Browse files Browse the repository at this point in the history
Fixes #726
  • Loading branch information
khaledhosny authored and miguelsousa committed Feb 6, 2019
1 parent 364975f commit 7896936
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion c/makeotf/makeotf_lib/build/hotpccts/featgram.g
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ glyphClass[int named, char *gcname]>[GNode *gnode]
<<GID gid, endgid;
char p[MAX_TOKEN], q[MAX_TOKEN];>>
glyph[p, TRUE]>[gid]
<<if (gid == 0) {
<<if (gid == GID_UNDEF) {
char *secondPart = p;
char *firstPart = p;
/* it might be a range.*/
Expand Down
18 changes: 10 additions & 8 deletions c/makeotf/makeotf_lib/source/hotconv/feat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1784,16 +1784,18 @@ static GID featMapGName2GID(hotCtx g, char *gname, int allowNotdef) {

gid = mapName2GID(g, gname, &realname);

if (gid != GID_UNDEF) {
/* Return the glyph if found in the font. When allowNotdef is set, we
* always return and callers should check for GID_UNDEF as we can't return
* GID_NOTDEF in this case. */
if (gid != GID_UNDEF || allowNotdef == 1) {
return gid;
}
if (allowNotdef == 0) {
if (realname != NULL && strcmp(gname, realname) != 0) {
featMsg(hotERROR, "Glyph \"%s\" (alias \"%s\") not in font",
realname, gname);
} else {
featMsg(hotERROR, "Glyph \"%s\" not in font.", gname);
}

if (realname != NULL && strcmp(gname, realname) != 0) {
featMsg(hotERROR, "Glyph \"%s\" (alias \"%s\") not in font",
realname, gname);
} else {
featMsg(hotERROR, "Glyph \"%s\" not in font.", gname);
}
return GID_NOTDEF;
}
Expand Down
2 changes: 1 addition & 1 deletion c/makeotf/makeotf_lib/source/hotconv/featgram.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ char *gcname;
if ((setwd1[LA(1)] & 0x2)) {
gid = glyph(p, TRUE);

if (gid == 0) {
if (gid == GID_UNDEF) {
char *secondPart = p;
char *firstPart = p;
/* it might be a range.*/
Expand Down

0 comments on commit 7896936

Please sign in to comment.