Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelsousa committed Mar 15, 2019
2 parents c8e2ae7 + 287b954 commit 0a3585d
Show file tree
Hide file tree
Showing 22 changed files with 170 additions and 215 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ commands:
command: |
source venv/bin/activate
cibuildwheel --output-dir wheelhouse
# - store_artifacts:
# path: wheelhouse/

jobs:
linux-python3:
docker:
- image: circleci/python:3.6
environment:
CIBW_SKIP: cp27-* cp34-* cp35-* cp37-* *i686
CIBW_BUILD: cp37-manylinux1_x86_64
CIBW_TEST_REQUIRES_LINUX: pytest subprocess32
CIBW_TEST_COMMAND_LINUX: cd {project} && pytest -v && pip uninstall --yes afdko
steps:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/setup_venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python -m venv venv
source venv/bin/activate
# install and update dependencies
pip install -U -q pip setuptools wheel flake8 cpplint
pip install git+https://github.com/adobe-type-tools/cibuildwheel
pip install cibuildwheel
# print versions
python --version
pip --version
Expand Down
35 changes: 0 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,6 @@ matrix:
- NAME=OSX
- PIP=pip2

install:
- $PIP install flake8 cpplint

before_script:
- flake8 setup.py
- flake8 tests/*.py
- pushd python/afdko
- flake8 buildcff2vf.py
- flake8 buildmasterotfs.py
- flake8 checkoutlinesufo.py
- flake8 convertfonttocid.py
- flake8 fdkutils.py
- flake8 makeinstancesufo.py
- flake8 makeotf.py
- flake8 otf2ttf.py
- flake8 otfpdf.py
- flake8 pdfmetrics.py
- flake8 ttfcomponentizer.py
- flake8 ttxn.py
- flake8 ufotools.py
- popd
- cpplint --recursive --quiet c/detype1
- cpplint --recursive --quiet c/makeotf/makeotf_lib/source
- cpplint --recursive --quiet c/makeotf/makeotf_lib/api
- cpplint --recursive --quiet c/makeotf/makeotf_lib/resource
- cpplint --recursive --quiet c/makeotf/source
- cpplint --recursive --quiet c/mergefonts
- cpplint --recursive --quiet c/public
- cpplint --recursive --quiet c/rotatefont
- cpplint --recursive --quiet c/sfntdiff
- cpplint --recursive --quiet c/sfntedit
- cpplint --recursive --quiet c/spot
- cpplint --recursive --quiet c/tx
- cpplint --recursive --quiet c/type1

script:
# - $PIP install cibuildwheel
- $PIP install git+https://github.com/adobe-type-tools/cibuildwheel
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changelog
=========

2.8.8 (released 2019-03-15)
---------------------------

- [makeotf] Reverted the preference for `features.fea` file made
in **afdko** version 2.8.6
([#765](https://github.com/adobe-type-tools/afdko/issues/765))
- [sfntedit] Skip missing tables and issue a warning instead of
exiting with fatal error
([#160](https://github.com/adobe-type-tools/afdko/issues/160))
- [sfntdiff] Enabled diff'ing different font formats
([#626](https://github.com/adobe-type-tools/afdko/issues/626))

2.8.7 (released 2019-03-08)
---------------------------

Expand Down
25 changes: 23 additions & 2 deletions c/sfntdiff/source/Dfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
/*
* Machine independant file operations. The ANSI standard buffered i/o library
* can't be used here because the Macintosh version doesn't support resource
* reading.
* reading.
*
* This code assumes that 32 bits is large enough to hold a file offset. This
* seems a safe assumtion since other code would break long before
* fonts/resource files reached this size.
* fonts/resource files reached this size.
*/

#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <stdbool.h>

#include "Dglobal.h"
#include "Dfile.h"
Expand Down Expand Up @@ -250,3 +251,23 @@ Card32 fileSniff(Card8 which) {
fileSeekAbsNotBuffered(which, 0);
return value;
}

bool isSupportedFontFormat(Card32 value, Byte8 *fname) {
switch (value) {
case bits_:
case typ1_:
case true_:
case OTTO_:
case VERSION(1, 0):
return true;
break;
case 256:
case ttcf_:
warning("unsupported file [%s] (ignored)\n", fname);
return false;
break;
default:
warning("unsupported/bad file [%s] (ignored)\n", fname);
return false;
}
}
2 changes: 2 additions & 0 deletions c/sfntdiff/source/Dfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* File input support.
*/

#include <stdbool.h>
#ifndef FILE_H
#define FILE_H

Expand All @@ -20,6 +21,7 @@ extern void fileReadBytes(Card8 which, Int32 count, Card8 *buf);
extern void fileReadObject(Card8 which, IntX size, ...);
extern Byte8 *fileName(Card8 which);
extern Card32 fileSniff(Card8 which);
extern bool isSupportedFontFormat(Card32 value, Byte8 *fname);

/* Convienience macros */
#define TELL(which) fileTell((which))
Expand Down
14 changes: 7 additions & 7 deletions c/sfntdiff/source/Dhead.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static IntX loaded2 = 0;
static char *dateFormat = "%a %b %d %H:%M:%S %Y";

void headRead(Card8 which, LongN start, Card32 length) {
headTbl *head;
headTbl *head = NULL;

if (which == 1) {
if (loaded1)
Expand Down Expand Up @@ -151,7 +151,7 @@ Byte8 tday[32];

Byte8 *headGetCreatedDate(Card8 which, Card32 client) {
struct tm tmp;
headTbl *head;
headTbl *head = NULL;

tday[0] = '\0';

Expand All @@ -167,7 +167,7 @@ Byte8 *headGetCreatedDate(Card8 which, Card32 client) {

Byte8 *headGetModifiedDate(Card8 which, Card32 client) {
struct tm tmp;
headTbl *head;
headTbl *head = NULL;

tday[0] = '\0';

Expand Down Expand Up @@ -295,7 +295,7 @@ void headFree(Card8 which) {

/* Return head.indexToLocFormat */
IntX headGetLocFormat(Card8 which, Card16 *locFormat, Card32 client) {
headTbl *head;
headTbl *head = NULL;

CHECKREADASSIGN

Expand All @@ -308,7 +308,7 @@ IntX headGetLocFormat(Card8 which, Card16 *locFormat, Card32 client) {

/* Return head.uintsPerEm */
IntX headGetUnitsPerEm(Card8 which, Card16 *unitsPerEm, Card32 client) {
headTbl *head;
headTbl *head = NULL;
CHECKREADASSIGN
*unitsPerEm = head->unitsPerEm;
return 0;
Expand All @@ -318,7 +318,7 @@ IntX headGetUnitsPerEm(Card8 which, Card16 *unitsPerEm, Card32 client) {

/* Return head.flags & head_SET_LSB */
IntX headGetSetLsb(Card8 which, Card16 *setLsb, Card32 client) {
headTbl *head;
headTbl *head = NULL;
CHECKREADASSIGN
*setLsb = (head->flags & head_SET_LSB) != 0;
return 0;
Expand All @@ -329,7 +329,7 @@ IntX headGetSetLsb(Card8 which, Card16 *setLsb, Card32 client) {
/* Return head.xMin, head.yMin, head.xMax, head.yMax */
IntX headGetBBox(Card8 which, Int16 *xMin, Int16 *yMin, Int16 *xMax, Int16 *yMax,
Card32 client) {
headTbl *head;
headTbl *head = NULL;

CHECKREADASSIGN

Expand Down
99 changes: 21 additions & 78 deletions c/sfntdiff/source/Dmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#include "Dsys.h"
#include <ctype.h>
#include <string.h>
#include <stdbool.h>

Byte8 *version = "2.21217"; /* Program version */
Byte8 *version = "3.0.0"; /* Program version */

static char *sourcepath = "";
#include "setjmp.h"
Expand Down Expand Up @@ -98,13 +99,11 @@ IntN main(IntN argc, Byte8 *argv[]) {
{"-d", opt_Int, &level, "0", 0, 4},
};

volatile IntX i = 0;
IntN argi;
Card32 value, value2;
bool supported, supported2;
Byte8 *filename1;
Byte8 *filename2;
IntN name1isDir, name2isDir;
Byte8 foundXswitch = 0;
Byte8 **SimpleNameList;
IntN NumSimpleNames = 0;

Expand Down Expand Up @@ -151,34 +150,16 @@ IntN main(IntN argc, Byte8 *argv[]) {
}

/* See if we can recognize the file type */
value = fileSniff(1);
value2 = fileSniff(2);
if (value != value2) {
supported = isSupportedFontFormat(fileSniff(1), filename1);
supported2 = isSupportedFontFormat(fileSniff(2), filename2);

if (!supported || !supported2) {
fileClose(1);
fileClose(2);
fatal("file1 [%s] is not the same type as file2 [%s]\n", filename1, filename2);
quit(1);
}

switch (value) {
case bits_:
case typ1_:
case true_:
case OTTO_:
case VERSION(1, 0):
sfntRead(0, -1, 0, -1); /* Read plain sfnt file */
break;
case ttcf_:
warning("unsupported file [%s] (ignored)\n", filename1);
fileClose(1);
fileClose(2);
quit(1);
break;
default:
warning("unsupported/bad file [%s] (ignored)\n", filename1);
fileClose(1);
fileClose(2);
quit(1);
}
sfntRead(0, -1, 0, -1); /* Read plain sfnt file */
sfntDump();
sfntFree();
fileClose(1);
Expand Down Expand Up @@ -211,35 +192,16 @@ IntN main(IntN argc, Byte8 *argv[]) {
}

/* See if we can recognize the file type */
value = fileSniff(1);
value2 = fileSniff(2);
if (value != value2) {
supported = isSupportedFontFormat(fileSniff(1), fil1);
supported2 = isSupportedFontFormat(fileSniff(2), fil2);

if (!supported || !supported2) {
fileClose(1);
fileClose(2);
fatal("file1 [%s] is not the same type as file2 [%s]\n", fil1, fil2);
continue;
}

switch (value) {
case bits_:
case typ1_:
case true_:
case OTTO_:
case VERSION(1, 0):
sfntRead(0, -1, 0, -1); /* Read plain sfnt file */
break;
case 256:
case ttcf_:
warning("unsupported file [%s] (ignored)\n", fil1);
fileClose(1);
fileClose(2);
quit(1);
break;
default:
warning("unsupported/bad file [%s] (ignored)\n", fil1);
fileClose(1);
fileClose(2);
continue;
}
sfntRead(0, -1, 0, -1); /* Read plain sfnt file */
sfntDump();
sfntFree();
fileClose(1);
Expand Down Expand Up @@ -269,35 +231,16 @@ IntN main(IntN argc, Byte8 *argv[]) {
}

/* See if we can recognize the file type */
value = fileSniff(1);
value2 = fileSniff(2);
if (value != value2) {
supported = isSupportedFontFormat(fileSniff(1), filename1);
supported2 = isSupportedFontFormat(fileSniff(2), fil2);

if (!supported || !supported2) {
fileClose(1);
fileClose(2);
fatal("file1 [%s] is not the same type as file2 [%s]\n", filename1, fil2);
quit(1);
}

switch (value) {
case bits_:
case typ1_:
case true_:
case OTTO_:
case VERSION(1, 0):
sfntRead(0, -1, 0, -1); /* Read plain sfnt file */
break;
case 256:
case ttcf_:
warning("unsupported file [%s] (ignored)\n", filename1);
fileClose(1);
fileClose(2);
quit(1);
break;
default:
warning("unsupported/bad file [%s] (ignored)\n", filename1);
fileClose(1);
fileClose(2);
quit(1);
}
sfntRead(0, -1, 0, -1); /* Read plain sfnt file */
sfntDump();
sfntFree();
fileClose(1);
Expand Down
Loading

0 comments on commit 0a3585d

Please sign in to comment.