Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelsousa committed Feb 9, 2019
2 parents ec144b0 + cd56b34 commit fbda466
Show file tree
Hide file tree
Showing 77 changed files with 6,320 additions and 600 deletions.
33 changes: 33 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
Changelog
=========

2.8.5 (released 2019-02-09)
---------------------------

- [tx] Improved subroutinization. Removal of futile subroutines
is now the default. `-no_futile` option has been deprecated
([#704](https://github.com/adobe-type-tools/afdko/pull/704))
- [buildmasterotfs] Fixed failure when master UFOs and designspace
file are in the same directory
- [buildcff2vf] Fixed type error bug
- [fdkutils] Fixed UnicodeDecodeError on py27 Windows
([#719](https://github.com/adobe-type-tools/afdko/issues/719))
- [tx] Fixed failure processing already-subroutinized CFF2 font
([#721](https://github.com/adobe-type-tools/afdko/issues/721))
- [tx] Fixed wrong entries in Standard Apple Glyph Ordering
([#727](https://github.com/adobe-type-tools/afdko/pull/727))
- [makeotfexe] Added support for shorthand syntax for contextual
multiple substitutions `sub a b' c by d e;`
([#725](https://github.com/adobe-type-tools/afdko/issues/725))
- [makeotfexe] Fixed infinite loop
([#728](https://github.com/adobe-type-tools/afdko/pull/728))
- [makeotfexe] Allow glyph at GID 0 in glyph classes
([#726](https://github.com/adobe-type-tools/afdko/issues/726))
- [ufotools] Skip `<dict>` elements inside `<array>`
([#700](https://github.com/adobe-type-tools/afdko/issues/700))
- [tx] Support self-closing `<dict/>` in UFO's lib.plist
([#701](https://github.com/adobe-type-tools/afdko/issues/701))
- [makeotfexe] Fixed detection of offset overflow error
([#731](https://github.com/adobe-type-tools/afdko/issues/731))
- [makeotfexe] Fixed application of `useExtension` to anonymous lookups
([#321](https://github.com/adobe-type-tools/afdko/issues/321))
- [tx] Support UFO3 guidelines
([#705](https://github.com/adobe-type-tools/afdko/issues/705))

2.8.4 (released 2019-01-09)
---------------------------

Expand Down
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
15 changes: 13 additions & 2 deletions c/makeotf/makeotf_lib/source/hotconv/GSUB.c
Original file line number Diff line number Diff line change
Expand Up @@ -2213,7 +2213,17 @@ static Label addAnonRule(hotCtx g, GSUBCtx h, GNode *pMarked, unsigned nMarked,
GNode *targCp;
GNode *replCp;
SubtableInfo *si;
int lkpType = (nMarked == 1) ? GSUBSingle : GSUBLigature;
int lkpType;

if (nMarked == 1) {
if (repl->nextSeq != NULL) {
lkpType = GSUBMultiple;
} else {
lkpType = GSUBSingle;
}
} else {
lkpType = GSUBLigature;
}

/* Make copies in targCp, replCp */
featPatternCopy(g, &targCp, pMarked, nMarked);
Expand All @@ -2238,6 +2248,7 @@ static Label addAnonRule(hotCtx g, GSUBCtx h, GNode *pMarked, unsigned nMarked,
si->markSetIndex = markSetIndex;
si->label = featGetNextAnonLabel(g);
si->parentFeatTag = h->new.feature;
si->useExtension = h->new.useExtension;

si->rules.cnt = 0;
addRule(g, h, si, targCp, replCp);
Expand All @@ -2255,7 +2266,7 @@ static void createAnonLookups(hotCtx g, GSUBCtx h) {
SubtableInfo *si = &h->anonSubtable.array[i];
sprintf(g->error_id_text, "feature '%c%c%c%c'", TAG_ARG(si->parentFeatTag));
GSUBFeatureBegin(g, si->script, si->language, si->feature);
GSUBLookupBegin(g, si->lkpType, si->lkpFlag, si->label, 0, si->markSetIndex);
GSUBLookupBegin(g, si->lkpType, si->lkpFlag, si->label, si->useExtension, si->markSetIndex);

for (j = 0; j < si->rules.cnt; j++) {
SubstRule *rule = &si->rules.array[j];
Expand Down
36 changes: 21 additions & 15 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 Expand Up @@ -3273,7 +3275,7 @@ static int validateGSUBMultiple(hotCtx g, GNode *targ, GNode *repl,
valid = 0;
}

if (!(IS_GLYPH(targ) && isUnmarkedGlyphSeq(repl))) {
if (!((isSubrule || IS_GLYPH(targ)) && isUnmarkedGlyphSeq(repl))) {
featMsg(hotERROR, "Invalid multiple substitution rule");
valid = 0;
}
Expand Down Expand Up @@ -3507,21 +3509,25 @@ static int validateGSUBChain(hotCtx g, GNode *targ, GNode *repl) {
/* m now points to beginning of marked run */

if (repl) {
if (repl->nextSeq != NULL) {
featMsg(hotERROR, "Unsupported contextual GSUB replacement sequence");
return 0;
}

if (nMarked == 1) {
if (IS_GLYPH(m) && IS_CLASS(repl)) {
featMsg(hotERROR, "Contextual alternate rule not yet supported");
return 0;
}

if (!validateGSUBSingle(g, m, repl, 1)) {
if (repl->nextSeq != NULL) {
if (!validateGSUBMultiple(g, m, repl, 1)) {
return 0;
}
} else if (!validateGSUBSingle(g, m, repl, 1)) {
return 0;
}
} else if (nMarked > 1) {
if (repl->nextSeq != NULL) {
featMsg(hotERROR, "Unsupported contextual GSUB replacement sequence");
return 0;
}

/* Ligature run may contain classes, but only with a single repl */
if (!validateGSUBLigature(g, m, repl, 1)) {
return 0;
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
18 changes: 13 additions & 5 deletions c/makeotf/makeotf_lib/source/hotconv/otl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,6 @@ static void calcLookupListIndexes(hotCtx g, otlTbl t) {
LabelInfo *lab = dnaNEXT(t->label);
lab->used = 0; /* new label; hasn't been referenced by anything yet. */

/* sub-tables with feature Params currently don't have any look-ups. */
if (sub->isFeatParam) {
sub->index.lookup = -1;
} else {
Expand Down Expand Up @@ -1575,7 +1574,7 @@ static Offset fillFeatureList(hotCtx g, otlTbl t) {
/* This works becuase prepFeature has sorted the subtables so that anon subtabes are last, preceded by Stand-Alone subtables */
int spanLimit = t->subtable.cnt - (t->nAnonSubtables + t->nStandAloneSubtables);

nFeatures = t->subtable.array[spanLimit - 1].index.feature + 1;
nFeatures = spanLimit ? t->subtable.array[spanLimit - 1].index.feature + 1 : 0;
/* Allocate features */
t->tbl.FeatureList_.FeatureCount = nFeatures;
t->tbl.FeatureList_.FeatureRecord =
Expand Down Expand Up @@ -1794,8 +1793,12 @@ void otlTableFill(hotCtx g, otlTbl t) {
if (t->nFeatParams > 0) {
/* The feature table FeatureParam offsets are currently from the start of the subtable block.*/
/* featureParamBaseOffset is the (size of the feature list + feature record array) + size of the lookup list. */
short featureParamBaseOffset = (t->tbl.LookupList - t->tbl.FeatureList) + t->lookupSize;
fixFeatureParmOffsets(g, t, featureParamBaseOffset);
long featureParamBaseOffset = (t->tbl.LookupList - t->tbl.FeatureList) + t->lookupSize;
if (featureParamBaseOffset > 0xFFFF) {
hotMsg(g, hotFATAL, "feature parameter offset too large (%0lx)",
featureParamBaseOffset);
}
fixFeatureParmOffsets(g, t, (short)featureParamBaseOffset);
}
}

Expand Down Expand Up @@ -1903,7 +1906,12 @@ void otlTableWrite(hotCtx g, otlTbl t) {
OUT2(lookup->LookupFlag);
OUT2(lookup->SubTableCount);
for (j = 0; j < lookup->SubTableCount; j++) {
OUT2((short)(lookup->SubTable[j] + t->lookupSize));
long subTableOffset = lookup->SubTable[j] + t->lookupSize;
if (subTableOffset > 0xFFFF) {
hotMsg(g, hotFATAL, "subtable offset too large (%0lx) in lookup %i type %i",
subTableOffset, i, lookup->LookupType);
}
OUT2((short)subTableOffset);
}
if (lookup->LookupFlag & otlUseMarkFilteringSet) {
OUT2(lookup->UseMarkSetIndex);
Expand Down
5 changes: 2 additions & 3 deletions c/public/lib/api/cffwrite.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "ctlshare.h"

#define CFW_VERSION CTL_MAKE_VERSION(1, 0, 53)
#define CFW_VERSION CTL_MAKE_VERSION(1, 0, 54)

#include "absfont.h"

Expand Down Expand Up @@ -87,8 +87,7 @@ enum {
sources that will be used for OpenType/CFF fonts */
CFW_CUBE_RND = 1 << 11,
CFW_NO_OPTIMIZATION = 1 << 12,
CFW_WRITE_CFF2 = 1 << 13,
CFW_NO_FUTILE_SUBRS = 1 << 14 /* Remove futile subroutines during subroutinization */
CFW_WRITE_CFF2 = 1 << 13
};

/* If the CFW_PRESERVE_GLYPH_ORDER bit is not set, glyphs are accumulated and
Expand Down
7 changes: 4 additions & 3 deletions c/public/lib/resource/applestd.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

/*
* Standard Apple Glyph Ordering (258 entries) aggregate initializer.
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6post.html
*
* Elements values are glyph names. Index by glyph index (GID) get glyph name.
*/

/* 000 */ ".notdef",
/* 001 */ "uni0000",
/* 002 */ "uni000D",
/* 001 */ ".null",
/* 002 */ "nonmarkingreturn",
/* 003 */ "space",
/* 004 */ "exclam",
/* 005 */ "quotedbl",
Expand Down Expand Up @@ -180,7 +181,7 @@
/* 169 */ "guillemotleft",
/* 170 */ "guillemotright",
/* 171 */ "ellipsis",
/* 172 */ "uni00A0",
/* 172 */ "nonbreakingspace",
/* 173 */ "Agrave",
/* 174 */ "Atilde",
/* 175 */ "Otilde",
Expand Down
Loading

0 comments on commit fbda466

Please sign in to comment.