Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-hadley committed Mar 27, 2020
2 parents af7e5d0 + df31d5e commit 1980573
Show file tree
Hide file tree
Showing 28 changed files with 1,053 additions and 1,288 deletions.
1 change: 1 addition & 0 deletions .circleci/check_source_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ flake8 otc2otf.py
flake8 otf2ttf.py
flake8 pdflib/otfpdf.py
flake8 pdflib/pdfmetrics.py
flake8 ttfdecomponentizer.py
flake8 ttfcomponentizer.py
flake8 ttxn.py
flake8 ufotools.py
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/testpythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test Python Package

on: [push]

jobs:
build:
if: contains(toJson(github.event.commits), '[skip ci]') == false && contains(toJson(github.event.commits), '[skip github]') == false

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
exclude:
- os: macos-latest
python-version: 3.6
- os: macos-latest
python-version: 3.7
- os: windows-latest
python-version: 3.6
- os: windows-latest
python-version: 3.7

steps:
- uses: actions/checkout@v1
with:
submodules: true

- name: Use MSBuild (Windows)
uses: microsoft/[email protected]
if: matrix.os == 'windows-latest'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt .
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude **/comparefamily.py,**/beztools.py
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest --cov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ htmlcov
.pytest_cache
*.gcno
*.gcda
cov.xml

# ignore the compiled programs
c/build_all/*
Expand Down
3 changes: 0 additions & 3 deletions .prospector.yaml

This file was deleted.

33 changes: 31 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
Changelog
=========

3.2.1 (released 2020-03-27)
---------------------------
- [sfntedit] cleaned up help string
([#1084](https://github.com/adobe-type-tools/afdko/pull/1084))
- [docs] Updated AFDKO Overview doc
([#1091](https://github.com/adobe-type-tools/afdko/pull/1091))
- [waterfallplot] fixed crash
([#1094](https://github.com/adobe-type-tools/afdko/pull/1094),
[#1092](https://github.com/adobe-type-tools/afdko/issues/1092))
- [ttfdecomponentizer] add ttfdecomponentizer tool
([#1096](https://github.com/adobe-type-tools/afdko/pull/1096))
- [buildcff2vf] update to use new `fontTools.varLib` exceptions
([#1097](https://github.com/adobe-type-tools/afdko/pull/1097),
[#1088](https://github.com/adobe-type-tools/afdko/issues/1088))
- [ufotools] clean up (remove unused code)
([#1098](https://github.com/adobe-type-tools/afdko/pull/1098))
- [docs] clarify allowed use of `script` and `language` keywords in feature files
([#1099](https://github.com/adobe-type-tools/afdko/pull/1099),
[#990](https://github.com/adobe-type-tools/afdko/issues/990))
- [requirements] fix issue with PyUp configuration (re-enable automatic updates)
- [requirements] relax constraints on `ufoProcessor` version
([#1102](https://github.com/adobe-type-tools/afdko/issues/1102))
- [spec] replace invalid example in OpenType Feature File specification
([#1106](https://github.com/adobe-type-tools/afdko/issues/1106),
[#1107](https://github.com/adobe-type-tools/afdko/pull/1107))
- [makeotfexe] fix bug which could cause a crash with some fonts
([#1108](https://github.com/adobe-type-tools/afdko/issues/1108),
[#1109](https://github.com/adobe-type-tools/afdko/pull/1109))

3.2.0 (released 2020-01-24)
---------------------------
- [ttfcomponentizer] minor updates and improvements
Expand All @@ -10,7 +39,7 @@ Changelog
([#1076](https://github.com/adobe-type-tools/afdko/pull/1076))
- [autohint] and [stemhist] now simply redirect input to psautohint/psstemhist
([#1077](https://github.com/adobe-type-tools/afdko/pull/1077))
- [makeotfexe] fix bug in font generation with multiple `langugesystem` entries
- [makeotfexe] fix bug in font generation with multiple `languagesystem` entries
([#1080](https://github.com/adobe-type-tools/afdko/issues/1080),
[#1081](https://github.com/adobe-type-tools/afdko/pull/1081))

Expand Down Expand Up @@ -3001,4 +3030,4 @@ complete list see:

- changed logic for setting OS/2 codepage range to set code page to
Simplified or Traditional Chinese based on mac.script setting;
fallback on heuristics only if mac.script is not set.
fallback on heuristics only if mac.script is not set.
2 changes: 1 addition & 1 deletion c/makeotf/makeotf_lib/api/hotconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This software is licensed as OpenSource, under the Apache License, Version 2.0.
extern "C" {
#endif

#define HOT_VERSION 0x010070 /* Library version (1.0.112) */
#define HOT_VERSION 0x010071 /* Library version (1.0.113) */
/* Major, minor, build = (HOT_VERSION >> 16) & 0xff, (HOT_VERSION >> 8) & 0xff, HOT_VERSION & 0xff) */
/* 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
Expand Down
2 changes: 1 addition & 1 deletion c/makeotf/makeotf_lib/source/typecomp/recode.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ static long sizeFDWidths(recodeCtx h, int fd) {
}

/* Find best combination of nominal and default widths */
minsize = SHRT_MAX;
minsize = INT_MAX;
for (i = 0; i < wfd->total.cnt; i++) {
int j;
int nomsize;
Expand Down
144 changes: 73 additions & 71 deletions c/sfntedit/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ static void cleanup(int code) {

/* Print usage information */
static void printUsage(void) {
fprintf(stdout,
printf(
"Usage:\n"
" %s [options] <srcfile> [<dstfile>]\n"
"OR: %s -X <scriptfile>\n\n"
"OR: %s -X <scriptfile>\n"
"\n"
"Options:\n"
" -x <tag>[=<file>][,<tag>[=<file>]]+ extract table to file\n"
" -d <tag>[,<tag>]+ delete table\n"
Expand All @@ -198,8 +199,10 @@ static void printUsage(void) {
" -u print usage\n"
" -h print help\n"
" -X execute command-lines from <scriptfile> [default: sfntedit.scr]\n"
"\n"
"Build:\n"
" Version: %s\n",
" Version: %s\n"
"\n",
global.progname,
global.progname,
VERSION);
Expand All @@ -213,65 +216,64 @@ static void showUsage(void) {
/* Show usage and help information */
static void showHelp(void) {
printUsage();
fprintf(stdout,
"Notes:\n"
" This program supports table-editing, listing, and checksumming options\n"
"on sfnt-formatted files such as OpenType Format (OTF) or TrueType. The\n"
"mandatory source file is specified as an argument to the program. An\n"
"optional destination file may also be specified which receives the edited\n"
"data otherwise the source data is edited in-place thus modifying the source\n");
fprintf(stdout,
"file. In-place editing is achieved by the use of a temporary file called\n"
"%s that is created in the directory of execution (requiring you\n"
"to have write permission to that directory).\n"
" The target table of an editing option (-x, -d, and -a) is specified\n"
"with a table tag argument that is nominally 4 characters long. If fewer\n"
"than 4 characters are specified the tag is padded with spaces (more than 4\n",
tmpname);
fprintf(stdout,
"characters is a fatal error). Multiple tables may be specified as a single\n"
"argument composed from a comma-separated list of tags.\n"
" The extract option (-x) copies the table data into a file whose default\n"
"name is the concatenation of the source filename (less its .otf or .ttf\n"
"extension), a period character (.), and the table tag. If the tag contains\n"
"non-alphanumeric characters they are replaced by underscore characters (_)\n");
fprintf(stdout,
"and finally trailing underscores are removed. The default filename may be\n"
"overridden by appending an equals character (=) followed by an alternate\n"
"filename to the table tag argument. The delete option (-d) deletes a table.\n"
"Unlike the -x option no files may be specified in the table tag list. The\n"
"add option (-a) adds a table or replaces one if the table already exists.\n"
"The source file containing the table data is specified by appending an\n");
fprintf(stdout,
"equals character (=) followed by a filename to the table tag.\n"
" The 3 editing options may be specified together as acting on the same\n"
"table. In such cases the -x option is applied before the -d option which is\n"
"applied before the -a option. (The -d option applied to the same table as a\n"
"subsequent -a option is permitted but redundant.) The -d and -a options\n"
"change the contents of the sfnt and cause the table checksums and the head\n");
fprintf(stdout,
"table's checksum adjustment field to be recomputed.\n"
" The list option (-l) simply lists the contents of the sfnt table\n"
"directory. This is the default action if no other options are specified.\n"
"The check checksum option (-c) performs a check of all the table checksums\n"
"and the head table's checksum adjustment field and reports any errors. The\n"
"fix checksum option (-f) fixes any checksum errors.\n");
fprintf(stdout,
" The -d, -a, and -f options create a new sfnt file by copying tables\n"
"from the source file to the destination file. The tables are copied in the\n"
"order recommended in the OpenType specification. A side effect of copying\n"
"is that all table information including checksums and sfnt search fields\n"
"is recalculated.\n"
"Examples:\n");
fprintf(stdout,
"o Extract GPOS and GSUB tables to files minion.GPOS and minion.GSUB.\n"
" sfntedit -x GPOS,GSUB minion.otf\n"
"o Add tables extracted previously to different font.\n"
" sfntedit -a GPOS=minion.GPOS,GSUB=minion.GSUB minion.ttf\n"
"o Delete temporary tables from font.\n"
" sfntedit -d TR01,TR02,TR03 pala.ttf\n"
"o Copy font to new file fixing checksums and reordering tables.\n"
" sfntedit -f helv.ttf newhelv.ttf\n");
printf(
"This program supports table-editing, listing, and checksumming options on\n"
"sfnt-formatted files such as OpenType Format (OTF) or TrueType. The mandatory\n"
"source file is specified as an argument to the program. An optional destination\n"
"file may also be specified which receives the edited data otherwise the source\n"
"data is edited in-place thus modifying the source file. In-place editing is\n"
"achieved by the use of a temporary file called sfntedit.tmp that is created\n"
"in the directory of execution (requiring you to have write permission to\n"
"that directory).\n"
"\n"
"The target table of an editing option (-x, -d, and -a) is specified\n"
"with a table tag argument that is nominally 4 characters long.\n"
"If fewer than 4 characters are specified the tag is padded with spaces\n"
"(more than 4 characters is a fatal error). Multiple tables may be specified\n"
"as a single argument composed from a comma-separated list of tags.\n"
"\n"
"The extract option (-x) copies the table data into a file whose default name\n"
"is the concatenation of the source filename (less its .otf or .ttf extension),\n"
"a period character (.), and the table tag. If the tag contains non-alphanumeric\n"
"characters they are replaced by underscore characters (_) and finally trailing\n"
"underscores are removed. The default filename may be overridden by appending\n"
"an equals character (=) followed by an alternate filename to the table tag\n"
"argument. The delete option (-d) deletes a table. Unlike the -x option no files\n"
"may be specified in the table tag list. The add option (-a) adds a table or\n"
"replaces one if the table already exists. The source file containing the table\n"
"data is specified by appending an equals character (=) followed by a filename\n"
"to the table tag.\n"
"\n"
"The 3 editing options may be specified together as acting on the same table.\n"
"In such cases the -x option is applied before the -d option which is applied\n"
"before the -a option. (The -d option applied to the same table as a subsequent\n"
"-a option is permitted but redundant.) The -d and -a options change the contents\n"
"of the sfnt and cause the table checksums and the head table's checksum\n"
"adjustment field to be recomputed.\n"
"\n"
"The list option (-l) simply lists the contents of the sfnt table directory.\n"
"This is the default action if no other options are specified. The check\n"
"checksum option (-c) performs a check of all the table checksums and the head\n"
"table's checksum adjustment field and reports any errors. The fix checksum\n"
"option (-f) fixes any checksum errors.\n"
"\n"
"The -d, -a, and -f options create a new sfnt file by copying tables from the\n"
"source file to the destination file. The tables are copied in the order\n"
"recommended in the OpenType specification. A side effect of copying is that all\n"
"table information including checksums and sfnt search fields is recalculated.\n"
"\n"
"Examples:\n"
"- Extract GPOS and GSUB tables to files minion.GPOS and minion.GSUB.\n"
" sfntedit -x GPOS,GSUB minion.otf\n"
" \n"
"- Add tables extracted previously to different font.\n"
" sfntedit -a GPOS=minion.GPOS,GSUB=minion.GSUB minion.ttf\n"
" \n"
"- Delete temporary tables from font.\n"
" sfntedit -d TR01,TR02,TR03 pala.ttf\n"
" \n"
"- Copy font to new file fixing checksums and reordering tables.\n"
" sfntedit -f helv.ttf newhelv.ttf\n\n");
}

static void makeArgs(char *filename) {
Expand Down Expand Up @@ -633,21 +635,21 @@ static void sfntReadHdr(void) {
static void sfntDumpHdr(void) {
int i;

fprintf(stdout, "--- sfnt header [%s]\n", srcfile.name);
printf("--- sfnt header [%s]\n", srcfile.name);
if (sfnt.version == 0x00010000)
fprintf(stdout, "version =1.0 (00010000)\n");
printf("version =1.0 (00010000)\n");
else
fprintf(stdout, "version =%c%c%c%c (%08x)\n",
printf("version =%c%c%c%c (%08x)\n",
TAG_ARG(sfnt.version), sfnt.version);
fprintf(stdout, "numTables =%hu\n", sfnt.numTables);
fprintf(stdout, "searchRange =%hu\n", sfnt.searchRange);
fprintf(stdout, "entrySelector=%hu\n", sfnt.entrySelector);
fprintf(stdout, "rangeShift =%hu\n", sfnt.rangeShift);
printf("numTables =%hu\n", sfnt.numTables);
printf("searchRange =%hu\n", sfnt.searchRange);
printf("entrySelector=%hu\n", sfnt.entrySelector);
printf("rangeShift =%hu\n", sfnt.rangeShift);

fprintf(stdout, "--- table directory [index]={tag,checksum,offset,length}\n");
printf("--- table directory [index]={tag,checksum,offset,length}\n");
for (i = 0; i < sfnt.numTables; i++) {
Table *tbl = &sfnt.directory[i];
fprintf(stdout, "[%2d]={%c%c%c%c,%08x,%08x,%08x}\n", i,
printf("[%2d]={%c%c%c%c,%08x,%08x,%08x}\n", i,
TAG_ARG(tbl->tag), tbl->checksum, tbl->offset, tbl->length);
}
}
Expand Down
14 changes: 11 additions & 3 deletions docs/AFDKO-Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,19 @@ This program is the Adobe auto-hinter. It can be applied to both OpenType/CFF an

### `makeotf`

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.
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.

### `buildmasterotfs`

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.

### `buildcff2vf`

This script will use a .designspace file and the output OTFs of `buildmasterotfs` to assemble a CFF2 variable font file.

### `makeinstancesufo`

This script will generate UFO fonts from a set of [Superpolator](http://superpolator.com/) master designs.
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/).

### `mergefonts`

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

### `type1`/`detype1`

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.
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.

## 2.2 Proofing

Expand Down
Loading

0 comments on commit 1980573

Please sign in to comment.