Skip to content

Commit

Permalink
Fixed an old bug in makeotf. If a mark-to-base or mark-to-mark lookup…
Browse files Browse the repository at this point in the history
… have statements that do not all reference the same mark classes, makeotf used to write a 'default' anchor attachment point of (0.0) for any mark class that was not referenced by a given statement. Fixed this bug by reporting a fatal error: the feature file must be re-written so that all the statements in a lookup must all reference the same set of mark classes.
  • Loading branch information
readroberts committed May 9, 2016
1 parent a043658 commit 20af6dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FDK/Tools/Programs/makeotf/makeotf_lib/api/hotconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This software is licensed as OpenSource, under the Apache License, Version 2.0.
extern "C" {
#endif

#define HOT_VERSION 0x010061 /* Library version (1.0.91) */
#define HOT_VERSION 0x010062 /* Library version (1.0.92) */
/*Warning: this string is now part of heuristic used by CoolType to identify the
first round of CoolType fonts which had the backtrack sequence of a chaining
contextual substitution ordered incorrectly. Fonts with the old ordering MUST match
Expand Down
13 changes: 12 additions & 1 deletion FDK/Tools/Programs/makeotf/makeotf_lib/source/hotconv/GPOS.c
Original file line number Diff line number Diff line change
Expand Up @@ -4121,15 +4121,26 @@ static void fillMarkToBase(hotCtx g, GPOSCtx h) {
} /* end for each base glyph entry */

/* For any glyph, the user may not have specified an anchor for any particular mark class.
We need to fill these in with default anchors at 0.0 */
We will fill these in with default anchors at 0.0, but will also report a warning. */

for (i = 0; i < numBaseGlyphs; i++) {
int j;
LOffset *baseAnchorArray = fmt->BaseArray_.BaseRecord[i].BaseAnchorArray;
BaseGlyphRec *baseRec = &(h->new.baseList.array[i]);

for (j = 0; j < fmt->ClassCount; j++) {
if (baseAnchorArray[j] == 0xFFFFFFFFL) {
char msg[1024];
baseAnchorArray[j] = getAnchoOffset(g, &kDefaultAnchor, fmt); /* this returns the offset from the start of the anchor list. To be adjusted later*/
featGlyphDump(g, baseRec->gid, '\0', 0);
if (h->new.fileName != NULL) {
sprintf(msg, " [%s %ld]", h->new.fileName, baseRec->lineNum);
}
else {
msg[0] = '\0';
}
hotMsg(g, hotERROR, "MarkToBase or MarkToMark: A previous statement has already assigned the current mark class to another anchor point on the same glyph '%s'. Skipping rule. %s",
g->note.array, msg);
}
}
}
Expand Down

0 comments on commit 20af6dd

Please sign in to comment.