Skip to content

Commit 1980573

Browse files
committed
Merge branch 'release'
2 parents af7e5d0 + df31d5e commit 1980573

File tree

28 files changed

+1053
-1288
lines changed

28 files changed

+1053
-1288
lines changed

.circleci/check_source_code.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ flake8 otc2otf.py
1919
flake8 otf2ttf.py
2020
flake8 pdflib/otfpdf.py
2121
flake8 pdflib/pdfmetrics.py
22+
flake8 ttfdecomponentizer.py
2223
flake8 ttfcomponentizer.py
2324
flake8 ttxn.py
2425
flake8 ufotools.py
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test Python Package
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
if: contains(toJson(github.event.commits), '[skip ci]') == false && contains(toJson(github.event.commits), '[skip github]') == false
8+
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
python-version: [3.6, 3.7, 3.8]
14+
exclude:
15+
- os: macos-latest
16+
python-version: 3.6
17+
- os: macos-latest
18+
python-version: 3.7
19+
- os: windows-latest
20+
python-version: 3.6
21+
- os: windows-latest
22+
python-version: 3.7
23+
24+
steps:
25+
- uses: actions/checkout@v1
26+
with:
27+
submodules: true
28+
29+
- name: Use MSBuild (Windows)
30+
uses: microsoft/[email protected]
31+
if: matrix.os == 'windows-latest'
32+
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v1
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install -r requirements.txt -r requirements-dev.txt .
42+
43+
- name: Lint with flake8
44+
run: |
45+
pip install flake8
46+
# stop the build if there are Python syntax errors or undefined names
47+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude **/comparefamily.py,**/beztools.py
48+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
49+
flake8 . --count --exit-zero --max-line-length=127 --statistics
50+
51+
- name: Test with pytest
52+
run: |
53+
pytest --cov

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ htmlcov
2121
.pytest_cache
2222
*.gcno
2323
*.gcda
24+
cov.xml
2425

2526
# ignore the compiled programs
2627
c/build_all/*

.prospector.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

NEWS.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
Changelog
22
=========
33

4+
3.2.1 (released 2020-03-27)
5+
---------------------------
6+
- [sfntedit] cleaned up help string
7+
([#1084](https://github.com/adobe-type-tools/afdko/pull/1084))
8+
- [docs] Updated AFDKO Overview doc
9+
([#1091](https://github.com/adobe-type-tools/afdko/pull/1091))
10+
- [waterfallplot] fixed crash
11+
([#1094](https://github.com/adobe-type-tools/afdko/pull/1094),
12+
[#1092](https://github.com/adobe-type-tools/afdko/issues/1092))
13+
- [ttfdecomponentizer] add ttfdecomponentizer tool
14+
([#1096](https://github.com/adobe-type-tools/afdko/pull/1096))
15+
- [buildcff2vf] update to use new `fontTools.varLib` exceptions
16+
([#1097](https://github.com/adobe-type-tools/afdko/pull/1097),
17+
[#1088](https://github.com/adobe-type-tools/afdko/issues/1088))
18+
- [ufotools] clean up (remove unused code)
19+
([#1098](https://github.com/adobe-type-tools/afdko/pull/1098))
20+
- [docs] clarify allowed use of `script` and `language` keywords in feature files
21+
([#1099](https://github.com/adobe-type-tools/afdko/pull/1099),
22+
[#990](https://github.com/adobe-type-tools/afdko/issues/990))
23+
- [requirements] fix issue with PyUp configuration (re-enable automatic updates)
24+
- [requirements] relax constraints on `ufoProcessor` version
25+
([#1102](https://github.com/adobe-type-tools/afdko/issues/1102))
26+
- [spec] replace invalid example in OpenType Feature File specification
27+
([#1106](https://github.com/adobe-type-tools/afdko/issues/1106),
28+
[#1107](https://github.com/adobe-type-tools/afdko/pull/1107))
29+
- [makeotfexe] fix bug which could cause a crash with some fonts
30+
([#1108](https://github.com/adobe-type-tools/afdko/issues/1108),
31+
[#1109](https://github.com/adobe-type-tools/afdko/pull/1109))
32+
433
3.2.0 (released 2020-01-24)
534
---------------------------
635
- [ttfcomponentizer] minor updates and improvements
@@ -10,7 +39,7 @@ Changelog
1039
([#1076](https://github.com/adobe-type-tools/afdko/pull/1076))
1140
- [autohint] and [stemhist] now simply redirect input to psautohint/psstemhist
1241
([#1077](https://github.com/adobe-type-tools/afdko/pull/1077))
13-
- [makeotfexe] fix bug in font generation with multiple `langugesystem` entries
42+
- [makeotfexe] fix bug in font generation with multiple `languagesystem` entries
1443
([#1080](https://github.com/adobe-type-tools/afdko/issues/1080),
1544
[#1081](https://github.com/adobe-type-tools/afdko/pull/1081))
1645

@@ -3001,4 +3030,4 @@ complete list see:
30013030

30023031
- changed logic for setting OS/2 codepage range to set code page to
30033032
Simplified or Traditional Chinese based on mac.script setting;
3004-
fallback on heuristics only if mac.script is not set.
3033+
fallback on heuristics only if mac.script is not set.

c/makeotf/makeotf_lib/api/hotconv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This software is licensed as OpenSource, under the Apache License, Version 2.0.
1212
extern "C" {
1313
#endif
1414

15-
#define HOT_VERSION 0x010070 /* Library version (1.0.112) */
15+
#define HOT_VERSION 0x010071 /* Library version (1.0.113) */
1616
/* Major, minor, build = (HOT_VERSION >> 16) & 0xff, (HOT_VERSION >> 8) & 0xff, HOT_VERSION & 0xff) */
1717
/* Warning: this string is now part of heuristic used by CoolType to identify the
1818
first round of CoolType fonts which had the backtrack sequence of a chaining

c/makeotf/makeotf_lib/source/typecomp/recode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ static long sizeFDWidths(recodeCtx h, int fd) {
984984
}
985985

986986
/* Find best combination of nominal and default widths */
987-
minsize = SHRT_MAX;
987+
minsize = INT_MAX;
988988
for (i = 0; i < wfd->total.cnt; i++) {
989989
int j;
990990
int nomsize;

c/sfntedit/source/main.c

Lines changed: 73 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@ static void cleanup(int code) {
184184

185185
/* Print usage information */
186186
static void printUsage(void) {
187-
fprintf(stdout,
187+
printf(
188188
"Usage:\n"
189189
" %s [options] <srcfile> [<dstfile>]\n"
190-
"OR: %s -X <scriptfile>\n\n"
190+
"OR: %s -X <scriptfile>\n"
191+
"\n"
191192
"Options:\n"
192193
" -x <tag>[=<file>][,<tag>[=<file>]]+ extract table to file\n"
193194
" -d <tag>[,<tag>]+ delete table\n"
@@ -198,8 +199,10 @@ static void printUsage(void) {
198199
" -u print usage\n"
199200
" -h print help\n"
200201
" -X execute command-lines from <scriptfile> [default: sfntedit.scr]\n"
202+
"\n"
201203
"Build:\n"
202-
" Version: %s\n",
204+
" Version: %s\n"
205+
"\n",
203206
global.progname,
204207
global.progname,
205208
VERSION);
@@ -213,65 +216,64 @@ static void showUsage(void) {
213216
/* Show usage and help information */
214217
static void showHelp(void) {
215218
printUsage();
216-
fprintf(stdout,
217-
"Notes:\n"
218-
" This program supports table-editing, listing, and checksumming options\n"
219-
"on sfnt-formatted files such as OpenType Format (OTF) or TrueType. The\n"
220-
"mandatory source file is specified as an argument to the program. An\n"
221-
"optional destination file may also be specified which receives the edited\n"
222-
"data otherwise the source data is edited in-place thus modifying the source\n");
223-
fprintf(stdout,
224-
"file. In-place editing is achieved by the use of a temporary file called\n"
225-
"%s that is created in the directory of execution (requiring you\n"
226-
"to have write permission to that directory).\n"
227-
" The target table of an editing option (-x, -d, and -a) is specified\n"
228-
"with a table tag argument that is nominally 4 characters long. If fewer\n"
229-
"than 4 characters are specified the tag is padded with spaces (more than 4\n",
230-
tmpname);
231-
fprintf(stdout,
232-
"characters is a fatal error). Multiple tables may be specified as a single\n"
233-
"argument composed from a comma-separated list of tags.\n"
234-
" The extract option (-x) copies the table data into a file whose default\n"
235-
"name is the concatenation of the source filename (less its .otf or .ttf\n"
236-
"extension), a period character (.), and the table tag. If the tag contains\n"
237-
"non-alphanumeric characters they are replaced by underscore characters (_)\n");
238-
fprintf(stdout,
239-
"and finally trailing underscores are removed. The default filename may be\n"
240-
"overridden by appending an equals character (=) followed by an alternate\n"
241-
"filename to the table tag argument. The delete option (-d) deletes a table.\n"
242-
"Unlike the -x option no files may be specified in the table tag list. The\n"
243-
"add option (-a) adds a table or replaces one if the table already exists.\n"
244-
"The source file containing the table data is specified by appending an\n");
245-
fprintf(stdout,
246-
"equals character (=) followed by a filename to the table tag.\n"
247-
" The 3 editing options may be specified together as acting on the same\n"
248-
"table. In such cases the -x option is applied before the -d option which is\n"
249-
"applied before the -a option. (The -d option applied to the same table as a\n"
250-
"subsequent -a option is permitted but redundant.) The -d and -a options\n"
251-
"change the contents of the sfnt and cause the table checksums and the head\n");
252-
fprintf(stdout,
253-
"table's checksum adjustment field to be recomputed.\n"
254-
" The list option (-l) simply lists the contents of the sfnt table\n"
255-
"directory. This is the default action if no other options are specified.\n"
256-
"The check checksum option (-c) performs a check of all the table checksums\n"
257-
"and the head table's checksum adjustment field and reports any errors. The\n"
258-
"fix checksum option (-f) fixes any checksum errors.\n");
259-
fprintf(stdout,
260-
" The -d, -a, and -f options create a new sfnt file by copying tables\n"
261-
"from the source file to the destination file. The tables are copied in the\n"
262-
"order recommended in the OpenType specification. A side effect of copying\n"
263-
"is that all table information including checksums and sfnt search fields\n"
264-
"is recalculated.\n"
265-
"Examples:\n");
266-
fprintf(stdout,
267-
"o Extract GPOS and GSUB tables to files minion.GPOS and minion.GSUB.\n"
268-
" sfntedit -x GPOS,GSUB minion.otf\n"
269-
"o Add tables extracted previously to different font.\n"
270-
" sfntedit -a GPOS=minion.GPOS,GSUB=minion.GSUB minion.ttf\n"
271-
"o Delete temporary tables from font.\n"
272-
" sfntedit -d TR01,TR02,TR03 pala.ttf\n"
273-
"o Copy font to new file fixing checksums and reordering tables.\n"
274-
" sfntedit -f helv.ttf newhelv.ttf\n");
219+
printf(
220+
"This program supports table-editing, listing, and checksumming options on\n"
221+
"sfnt-formatted files such as OpenType Format (OTF) or TrueType. The mandatory\n"
222+
"source file is specified as an argument to the program. An optional destination\n"
223+
"file may also be specified which receives the edited data otherwise the source\n"
224+
"data is edited in-place thus modifying the source file. In-place editing is\n"
225+
"achieved by the use of a temporary file called sfntedit.tmp that is created\n"
226+
"in the directory of execution (requiring you to have write permission to\n"
227+
"that directory).\n"
228+
"\n"
229+
"The target table of an editing option (-x, -d, and -a) is specified\n"
230+
"with a table tag argument that is nominally 4 characters long.\n"
231+
"If fewer than 4 characters are specified the tag is padded with spaces\n"
232+
"(more than 4 characters is a fatal error). Multiple tables may be specified\n"
233+
"as a single argument composed from a comma-separated list of tags.\n"
234+
"\n"
235+
"The extract option (-x) copies the table data into a file whose default name\n"
236+
"is the concatenation of the source filename (less its .otf or .ttf extension),\n"
237+
"a period character (.), and the table tag. If the tag contains non-alphanumeric\n"
238+
"characters they are replaced by underscore characters (_) and finally trailing\n"
239+
"underscores are removed. The default filename may be overridden by appending\n"
240+
"an equals character (=) followed by an alternate filename to the table tag\n"
241+
"argument. The delete option (-d) deletes a table. Unlike the -x option no files\n"
242+
"may be specified in the table tag list. The add option (-a) adds a table or\n"
243+
"replaces one if the table already exists. The source file containing the table\n"
244+
"data is specified by appending an equals character (=) followed by a filename\n"
245+
"to the table tag.\n"
246+
"\n"
247+
"The 3 editing options may be specified together as acting on the same table.\n"
248+
"In such cases the -x option is applied before the -d option which is applied\n"
249+
"before the -a option. (The -d option applied to the same table as a subsequent\n"
250+
"-a option is permitted but redundant.) The -d and -a options change the contents\n"
251+
"of the sfnt and cause the table checksums and the head table's checksum\n"
252+
"adjustment field to be recomputed.\n"
253+
"\n"
254+
"The list option (-l) simply lists the contents of the sfnt table directory.\n"
255+
"This is the default action if no other options are specified. The check\n"
256+
"checksum option (-c) performs a check of all the table checksums and the head\n"
257+
"table's checksum adjustment field and reports any errors. The fix checksum\n"
258+
"option (-f) fixes any checksum errors.\n"
259+
"\n"
260+
"The -d, -a, and -f options create a new sfnt file by copying tables from the\n"
261+
"source file to the destination file. The tables are copied in the order\n"
262+
"recommended in the OpenType specification. A side effect of copying is that all\n"
263+
"table information including checksums and sfnt search fields is recalculated.\n"
264+
"\n"
265+
"Examples:\n"
266+
"- Extract GPOS and GSUB tables to files minion.GPOS and minion.GSUB.\n"
267+
" sfntedit -x GPOS,GSUB minion.otf\n"
268+
" \n"
269+
"- Add tables extracted previously to different font.\n"
270+
" sfntedit -a GPOS=minion.GPOS,GSUB=minion.GSUB minion.ttf\n"
271+
" \n"
272+
"- Delete temporary tables from font.\n"
273+
" sfntedit -d TR01,TR02,TR03 pala.ttf\n"
274+
" \n"
275+
"- Copy font to new file fixing checksums and reordering tables.\n"
276+
" sfntedit -f helv.ttf newhelv.ttf\n\n");
275277
}
276278

277279
static void makeArgs(char *filename) {
@@ -633,21 +635,21 @@ static void sfntReadHdr(void) {
633635
static void sfntDumpHdr(void) {
634636
int i;
635637

636-
fprintf(stdout, "--- sfnt header [%s]\n", srcfile.name);
638+
printf("--- sfnt header [%s]\n", srcfile.name);
637639
if (sfnt.version == 0x00010000)
638-
fprintf(stdout, "version =1.0 (00010000)\n");
640+
printf("version =1.0 (00010000)\n");
639641
else
640-
fprintf(stdout, "version =%c%c%c%c (%08x)\n",
642+
printf("version =%c%c%c%c (%08x)\n",
641643
TAG_ARG(sfnt.version), sfnt.version);
642-
fprintf(stdout, "numTables =%hu\n", sfnt.numTables);
643-
fprintf(stdout, "searchRange =%hu\n", sfnt.searchRange);
644-
fprintf(stdout, "entrySelector=%hu\n", sfnt.entrySelector);
645-
fprintf(stdout, "rangeShift =%hu\n", sfnt.rangeShift);
644+
printf("numTables =%hu\n", sfnt.numTables);
645+
printf("searchRange =%hu\n", sfnt.searchRange);
646+
printf("entrySelector=%hu\n", sfnt.entrySelector);
647+
printf("rangeShift =%hu\n", sfnt.rangeShift);
646648

647-
fprintf(stdout, "--- table directory [index]={tag,checksum,offset,length}\n");
649+
printf("--- table directory [index]={tag,checksum,offset,length}\n");
648650
for (i = 0; i < sfnt.numTables; i++) {
649651
Table *tbl = &sfnt.directory[i];
650-
fprintf(stdout, "[%2d]={%c%c%c%c,%08x,%08x,%08x}\n", i,
652+
printf("[%2d]={%c%c%c%c,%08x,%08x,%08x}\n", i,
651653
TAG_ARG(tbl->tag), tbl->checksum, tbl->offset, tbl->length);
652654
}
653655
}

docs/AFDKO-Overview.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,19 @@ This program is the Adobe auto-hinter. It can be applied to both OpenType/CFF an
2323

2424
### `makeotf`
2525

26-
This program will build an OpenType/CFF font from a feature file that defines the OpenType layout rules, and overrides for default values, and a font file: a Type 1 font, TrueType font, 'detype1' text version of a Type 1 font, or UFO font and It also requires some other meta-data files. It will also build an OpenType/TTF font from a TrueType source font file.
26+
This program will build an OpenType/CFF font from a feature file that defines the OpenType layout rules, and overrides for default values, and a font file (Type 1 font, TrueType font, 'detype1' text version of a Type 1 font, or UFO font). It also requires some other meta-data files. It will also build an OpenType/TTF font from a TrueType source font file.
27+
28+
### `buildmasterotfs`
29+
30+
This script uses `makeotf` to build OTF files from a .designspace file with compatible UFO masters. These OTF files represent the first step toward building a CFF2 variable font.
31+
32+
### `buildcff2vf`
33+
34+
This script will use a .designspace file and the output OTFs of `buildmasterotfs` to assemble a CFF2 variable font file.
2735

2836
### `makeinstancesufo`
2937

30-
This script will generate UFO fonts from a set of [Superpolator](http://superpolator.com/) master designs.
38+
This script will generate UFO instances from a .designspace file, and a set of compatible UFO masters. More info on designspace files and interpolation systems can be found at [Superpolator.com](http://superpolator.com/).
3139

3240
### `mergefonts`
3341

@@ -71,7 +79,7 @@ This tool can be used to convert most font formats to CFF or Type 1 fonts. TrueT
7179

7280
### `type1`/`detype1`
7381

74-
These two programs will respectively compile and decompile a Type 1 font from a plain-text representation that is easy to edit. This is good for fixing individual fields. It is also good for copying a specific path element to many glyphs.
82+
These two programs will respectively compile and decompile a Type 1 font to and from a plain-text representation that is easy to edit. This is good for fixing individual fields. It is also good for copying a specific path element to many glyphs.
7583

7684
## 2.2 Proofing
7785

0 commit comments

Comments
 (0)