From 9c9b046f455ed99323d4d54a7cb635f3075d61d5 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sat, 8 Sep 2018 00:56:40 +0200 Subject: [PATCH 01/26] Use autohintexe from psautohint when available (#596) --- python/afdko/autohint.py | 13 +++++++++---- python/afdko/stemhist.py | 5 +++-- requirements.txt | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/python/afdko/autohint.py b/python/afdko/autohint.py index 821668e0d..09d2725d2 100644 --- a/python/afdko/autohint.py +++ b/python/afdko/autohint.py @@ -453,6 +453,11 @@ import traceback import shutil +try: + from psautohint import AUTOHINTEXE +except ImportError: + AUTOHINTEXE = "autohintexe" + # warnings.simplefilter("ignore", RuntimeWarning) # supress waring about use of os.tempnam(). kACIDKey = "AutoHintKey" @@ -545,7 +550,7 @@ def CheckEnvironment(): logMsg("Please re-install the FDK. The path to the program 'tx' is not in the environment variable PATH.") raise FDKEnvironmentError - command = "autohintexe -u 2>&1" + command = AUTOHINTEXE + " -u 2>&1" report = fdkutils.runShellCmd(command) if "version" not in report: logMsg("Please re-install the FDK. The path to the program 'autohintexe' is not in the environment variable PATH.") @@ -651,13 +656,13 @@ def getOptions(): if arg == "-h": print(__help__) - command = "autohintexe -v" + command = AUTOHINTEXE + " -v" report = fdkutils.runShellCmd(command) logMsg( report) raise ACOptionParseError elif arg == "-u": print(__usage__) - command = "autohintexe -v" + command = AUTOHINTEXE + " -v" report = fdkutils.runShellCmd(command) logMsg( report) raise ACOptionParseError @@ -1232,7 +1237,7 @@ def hintFile(options): else: if os.path.exists(tempBezNew): os.remove(tempBezNew) - command = "autohintexe %s%s%s%s -s %s -f \"%s\" \"%s\"" % (verboseArg, suppressEditArg, supressHintSubArg, decimalArg, NEWBEZ_SUFFIX, tempFI, tempBez) + command = AUTOHINTEXE + " %s%s%s%s -s %s -f \"%s\" \"%s\"" % (verboseArg, suppressEditArg, supressHintSubArg, decimalArg, NEWBEZ_SUFFIX, tempFI, tempBez) if options.debug: print(command) report = fdkutils.runShellCmd(command) diff --git a/python/afdko/stemhist.py b/python/afdko/stemhist.py index 0ac0057fa..13f643e23 100644 --- a/python/afdko/stemhist.py +++ b/python/afdko/stemhist.py @@ -116,7 +116,8 @@ from fontTools.misc.py23 import open, tounicode from afdko.autohint import ( parseGlyphListArg, getGlyphID, getGlyphNames, filterGlyphList, openFile, - ACOptionParseError, ACFontError, logMsg, ACreport, expandNames) + ACOptionParseError, ACFontError, logMsg, ACreport, expandNames, + AUTOHINTEXE) from afdko.beztools import * import afdko.fdkutils as fdkutils import afdko.ufotools as ufotools @@ -571,7 +572,7 @@ def collectStemsFont(path, options): else: allStems = "" - command = "autohintexe -q %s %s -f \"%s\" \"%s\" 2>&1" % (doAlign, allStems, tempFI, tempBez) + command = AUTOHINTEXE + " -q %s %s -f \"%s\" \"%s\" 2>&1" % (doAlign, allStems, tempFI, tempBez) if options.debug: print(command) log = fdkutils.runShellCmd(command) diff --git a/requirements.txt b/requirements.txt index b35706cd6..c23e4fe55 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,6 @@ fontMath~=0.4.7 fontPens~=0.1.0 fontTools~=3.29.0 mutatorMath~=2.1.1 -psautohint==1.7.0 +psautohint==1.8.1 ufoLib~=2.3.1 ufonormalizer~=0.3.5 From 80110717eac10a25a5cdb69f5b8a730968b9ef90 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 10 Sep 2018 12:21:07 -0700 Subject: [PATCH 02/26] Update fonttools version. Cap pytest-cov version --- requirements-dev.txt | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7715df8b9..892115516 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ cpplint>=1.3.0 cython>=0.28.3 flake8>=3.5.0 pip>=10.0.1 -pytest-cov==2.5.1 +pytest-cov<=2.5.1 setuptools>=39.2.0 setuptools_scm>=2.1.0 subprocess32>=3.5.0 diff --git a/requirements.txt b/requirements.txt index c23e4fe55..f3ff51cda 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ booleanOperations~=0.8.0 defcon~=0.5.2 fontMath~=0.4.7 fontPens~=0.1.0 -fontTools~=3.29.0 +fontTools~=3.29.1 mutatorMath~=2.1.1 psautohint==1.8.1 ufoLib~=2.3.1 From e0a318c8829daf3cac1151cf891fffb383d24c8b Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Tue, 11 Sep 2018 11:50:43 -0700 Subject: [PATCH 03/26] Fix py3 DeprecationWarnings --- python/afdko/checkoutlinesufo.py | 2 +- python/afdko/makeotf.py | 6 +++--- python/afdko/pdfgen.py | 4 ++-- python/afdko/pdfutils.py | 6 +++--- tests/buildmasterotfs_test.py | 2 +- tests/makeotf_test.py | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/python/afdko/checkoutlinesufo.py b/python/afdko/checkoutlinesufo.py index 4ed07f923..bced4a9a9 100644 --- a/python/afdko/checkoutlinesufo.py +++ b/python/afdko/checkoutlinesufo.py @@ -272,7 +272,7 @@ def __add_whitespace(indent_index, indent_space, arg): def _split_lines(self, arg, width): arg_rows = arg.splitlines() for line_index, text_line in enumerate(arg_rows): - search = re.search('\s*[0-9\-]{0,}\.?\s*', text_line) + search = re.search(r'\s*[0-9\-]{0,}\.?\s*', text_line) if text_line.strip() is "": arg_rows[line_index] = " " elif search: diff --git a/python/afdko/makeotf.py b/python/afdko/makeotf.py index a6b0b0ebe..db6c1ce56 100755 --- a/python/afdko/makeotf.py +++ b/python/afdko/makeotf.py @@ -2083,7 +2083,7 @@ def getSourceGOADBData(inputFilePath): # First, get the Unicode mapping from the TTF cmap table. command = "spot -t cmap=7 \"%s\" 2>&1" % inputFilePath report = fdkutils.runShellCmd(command) - spotGlyphList = re.findall("[\n\t]\[(....+)\]=<([^>]+)>", report) + spotGlyphList = re.findall(r"[\n\t]\[(....+)\]=<([^>]+)>", report) # Because this dumps all the Unicode map tables, there are a number # of duplicates; weed them out, and strip out gid part of spot name @@ -2107,7 +2107,7 @@ def getSourceGOADBData(inputFilePath): # as tx doesn't check 32 bit UV's, and doesn't report double-encodings. command = "tx -mtx \"%s\" 2>&1" % inputFilePath report = fdkutils.runShellCmd(command) - txGlyphList = re.findall("[\n\r]glyph\[(\d+)\]\s+{([^,]+)", report) + txGlyphList = re.findall(r"[\n\r]glyph\[(\d+)\]\s+{([^,]+)", report) gnameDict = {} for gid_str, gname in txGlyphList: @@ -2180,7 +2180,7 @@ def copyTTFGlyphTables(inputFilePath, tempOutputPath, outputPath): tempTablePath = fdkutils.get_temp_file_path() command = "tx -mtx \"%s\" 2>&1" % tempOutputPath report = fdkutils.runShellCmd(command) - glyphList = re.findall("[\n\r]glyph\[\d+\]\s+{([^,]+)", report) + glyphList = re.findall(r"[\n\r]glyph\[\d+\]\s+{([^,]+)", report) if os.path.exists(outputPath): os.remove(outputPath) diff --git a/python/afdko/pdfgen.py b/python/afdko/pdfgen.py index d28eb2c6c..032c36dd0 100755 --- a/python/afdko/pdfgen.py +++ b/python/afdko/pdfgen.py @@ -170,8 +170,8 @@ def _escape(self, s): """PDF escapes are like Python ones, but brackets need slashes before them too. Use Python's repr function and chop off the quotes first""" # s = repr(s)[1:-1] - s = s.replace('(', '\(') - s = s.replace(')', '\)') + s = s.replace('(', r'\(') + s = s.replace(')', r'\)') return s # info functions - non-standard diff --git a/python/afdko/pdfutils.py b/python/afdko/pdfutils.py index 971837da3..812ee9414 100755 --- a/python/afdko/pdfutils.py +++ b/python/afdko/pdfutils.py @@ -56,7 +56,7 @@ def cacheImageFile(filename): def preProcessImages(spec): - """accepts either a filespec ('C:\mydir\*.jpg') or a list + """accepts either a filespec ('/mydir/*.jpg') or a list of image filenames, crunches them all to save time. Run this to save huge amounts of time when repeatedly building image documents.""" @@ -99,8 +99,8 @@ def _escape(s): need slashes before them too. Use Python's repr function and chop off the quotes first""" s = repr(s)[1:-1] - s = s.replace('(', '\(') - s = s.replace(')', '\)') + s = s.replace('(', r'\(') + s = s.replace(')', r'\)') return s diff --git a/tests/buildmasterotfs_test.py b/tests/buildmasterotfs_test.py index fb1cf774f..6de71c2ec 100755 --- a/tests/buildmasterotfs_test.py +++ b/tests/buildmasterotfs_test.py @@ -60,4 +60,4 @@ def test_cjk_var(): ' Date: Tue, 11 Sep 2018 11:53:59 -0700 Subject: [PATCH 04/26] [makeotf] Fix makeRelativePath Return the original path when it can't be made relative because the paths are in different drives/mounts Fixes #602 --- python/afdko/makeotf.py | 19 ++++++++++++------- tests/makeotf_test.py | 25 ++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/python/afdko/makeotf.py b/python/afdko/makeotf.py index db6c1ce56..3d4b226dd 100755 --- a/python/afdko/makeotf.py +++ b/python/afdko/makeotf.py @@ -25,7 +25,7 @@ """ __version__ = """\ -makeotf.py v2.5.0 Aug 28 2018 +makeotf.py v2.5.1 Sep 11 2018 """ __methods__ = """ @@ -2283,18 +2283,23 @@ def makeRelativePath(curDir, targetPath): if targetPath is None: return - targetPath = os.path.abspath(targetPath) - curDir = os.path.abspath(curDir) - targetPath = os.path.relpath(targetPath, curDir) - return targetPath + abs_targetPath = os.path.abspath(targetPath) + abs_curDir = os.path.abspath(curDir) + try: + return os.path.relpath(abs_targetPath, abs_curDir) + except ValueError: + # the paths are on different drives/mounts + return targetPath def makeRelativePaths(makeOTFParams): + """ + Change file paths to be relative to fontDir, + if possible, else to absolute paths. + """ inputFilePath = getattr(makeOTFParams, kFileOptPrefix + kInputFont) fontDir = os.path.dirname(os.path.abspath(inputFilePath)) - # Change file paths to be relative to fontDir, - # if possible, else to absolute paths. inputFilePath = makeRelativePath(fontDir, inputFilePath) setattr(makeOTFParams, kFileOptPrefix + kInputFont, inputFilePath) diff --git a/tests/makeotf_test.py b/tests/makeotf_test.py index de961af73..74d486b34 100755 --- a/tests/makeotf_test.py +++ b/tests/makeotf_test.py @@ -14,7 +14,8 @@ from afdko.makeotf import ( checkIfVertInFeature, getOptions, MakeOTFParams, getSourceGOADBData, - readOptionFile, writeOptionsFile, kMOTFOptions, kOptionNotSeen) + readOptionFile, writeOptionsFile, kMOTFOptions, kOptionNotSeen, + makeRelativePath) from .runner import main as runner from .differ import main as differ @@ -345,6 +346,28 @@ def test_readOptionFile_filenotfound(): assert readOptionFile(proj_path, params, 0) == (True, 0) +@pytest.mark.parametrize('cur_dir, target_path, result', [ + ('/folder/folder2', '/folder/folder2/font.pfa', 'font.pfa'), + ('/folder/folder2', '/folder/font.pfa', '../font.pfa'), + ('/folder', '/folder/font.pfa', 'font.pfa'), + ('/folder', '/font.pfa', '../font.pfa'), + ('/folder', None, None), +]) +def test_makeRelativePath(cur_dir, target_path, result): + if result: + result = os.path.normpath(result) + assert makeRelativePath(cur_dir, target_path) == result + + +@pytest.mark.skipif(sys.platform != 'win32', reason="windows-only") +@pytest.mark.parametrize('cur_dir, target_path, result', [ + ('C:\\folder', 'C:\\folder\\font.pfa', 'font.pfa'), + ('F:\\folder', 'C:\\folder\\font.pfa', 'C:\\folder\\font.pfa'), +]) +def test_makeRelativePath_win_only(cur_dir, target_path, result): + assert makeRelativePath(cur_dir, target_path) == result + + @pytest.mark.parametrize('args, input_filename, ttx_filename', [ (['r'], T1PFA_NAME, 't1pfa-cmap.ttx'), (['r', 'cs', '_1'], T1PFA_NAME, 't1pfa-cmap_cs1.ttx'), From c405ac33972a7aa55fcab26805feaf1708513f25 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Tue, 11 Sep 2018 13:10:06 -0700 Subject: [PATCH 05/26] Remove autohintexe We currently get this tool via psautohint v1.8.1 --- .../build/linux/gcc/debug/Makefile | 213 -- .../build/linux/gcc/release/Makefile | 212 -- .../autohintlib.xcodeproj/project.pbxproj | 509 ---- .../win/visualstudio/autohintlib.vcxproj | 131 - .../autohintlib/config/linux/gcc/gcc.mak | 41 - .../config/xcconfig/debug.xcconfig | 3 - .../config/xcconfig/release.xcconfig | 4 - c/autohint/autohintlib/source/ac/ac.c | 315 --- c/autohint/autohintlib/source/ac/ac.h | 480 ---- c/autohint/autohintlib/source/ac/ac_C_lib.c | 326 --- c/autohint/autohintlib/source/ac/acfixed.c | 25 - c/autohint/autohintlib/source/ac/atan.c | 115 - c/autohint/autohintlib/source/ac/auto.c | 1165 -------- c/autohint/autohintlib/source/ac/bbox.c | 445 ---- c/autohint/autohintlib/source/ac/bfstub.c | 41 - c/autohint/autohintlib/source/ac/charprop.c | 274 -- c/autohint/autohintlib/source/ac/check.c | 811 ------ c/autohint/autohintlib/source/ac/control.c | 906 ------- c/autohint/autohintlib/source/ac/cswrite.c | 643 ----- c/autohint/autohintlib/source/ac/enum.c | 34 - c/autohint/autohintlib/source/ac/eval.c | 594 ----- c/autohint/autohintlib/source/ac/fix.c | 363 --- c/autohint/autohintlib/source/ac/flat.c | 375 --- c/autohint/autohintlib/source/ac/fontinfo.c | 248 -- c/autohint/autohintlib/source/ac/gen.c | 1007 ------- c/autohint/autohintlib/source/ac/head.c | 281 -- c/autohint/autohintlib/source/ac/memcheck.c | 922 ------- c/autohint/autohintlib/source/ac/merge.c | 469 ---- c/autohint/autohintlib/source/ac/misc.c | 276 -- c/autohint/autohintlib/source/ac/path.c | 419 --- c/autohint/autohintlib/source/ac/pick.c | 420 --- c/autohint/autohintlib/source/ac/read.c | 866 ------ c/autohint/autohintlib/source/ac/report.c | 843 ------ c/autohint/autohintlib/source/ac/shuffle.c | 206 -- c/autohint/autohintlib/source/ac/stub.c | 54 - c/autohint/autohintlib/source/ac/timecheck.c | 1326 ---------- c/autohint/autohintlib/source/ac/write.c | 671 ----- .../autohintlib/source/actest/AC_C_libtest.c | 82 - .../autohintlib/source/bf/afmcharsetdefs.h | 24 - c/autohint/autohintlib/source/bf/basic.h | 92 - c/autohint/autohintlib/source/bf/bftoac.h | 29 - c/autohint/autohintlib/source/bf/buildfont.h | 423 --- c/autohint/autohintlib/source/bf/charlist.c | 618 ----- c/autohint/autohintlib/source/bf/charlist.h | 39 - .../autohintlib/source/bf/charlistpriv.c | 33 - .../autohintlib/source/bf/charlistpriv.h | 19 - c/autohint/autohintlib/source/bf/charpath.c | 2341 ----------------- c/autohint/autohintlib/source/bf/charpath.h | 56 - .../autohintlib/source/bf/charpathpriv.c | 121 - c/autohint/autohintlib/source/bf/chartable.h | 55 - c/autohint/autohintlib/source/bf/cryptdefs.h | 43 - c/autohint/autohintlib/source/bf/cryptprocs.c | 447 ---- .../autohintlib/source/bf/derivedchars.h | 23 - c/autohint/autohintlib/source/bf/fileops.c | 553 ---- c/autohint/autohintlib/source/bf/filookup.c | 1365 ---------- c/autohint/autohintlib/source/bf/filookup.h | 151 -- c/autohint/autohintlib/source/bf/fipriv.h | 33 - c/autohint/autohintlib/source/bf/fipublic.h | 84 - c/autohint/autohintlib/source/bf/hintfile.h | 5 - c/autohint/autohintlib/source/bf/illtobez.c | 924 ------- c/autohint/autohintlib/source/bf/machinedep.c | 616 ----- c/autohint/autohintlib/source/bf/machinedep.h | 148 -- c/autohint/autohintlib/source/bf/masterfont.h | 54 - .../autohintlib/source/bf/masterfontpriv.h | 14 - c/autohint/autohintlib/source/bf/opcodes.h | 183 -- c/autohint/autohintlib/source/bf/optable.c | 160 -- c/autohint/autohintlib/source/bf/optable.h | 22 - c/autohint/autohintlib/source/bf/rawPStobez.c | 310 --- .../autohintlib/source/bf/transitionalchars.h | 63 - .../autohintlib/source/public/ac/ac_C_lib.h | 127 - .../autohintlib/source/public/ac/memcheck.h | 88 - .../source/public/extras/numtypes.h | 169 -- .../source/public/extras/pubtypes.h | 203 -- .../autohintlib/source/public/mac/types.h | 99 - .../autohintlib/source/public/winextras/dir.h | 69 - .../source/public/winextras/file.h | 97 - .../source/public/winextras/stdtypes.h | 36 - .../source/public/winextras/sysmacros.h | 19 - .../source/public/winextras/unistd.h | 121 - c/autohint/build/linux/gcc/BuildAll.sh | 30 - c/autohint/build/linux/gcc/debug/Makefile | 42 - c/autohint/build/linux/gcc/release/Makefile | 42 - c/autohint/build/osx/xcode4/BuildAll.sh | 22 - .../autohintexe.xcodeproj/project.pbxproj | 370 --- .../build/win/visualstudio/BuildAll.cmd | 37 - .../build/win/visualstudio/autohint.sln | 33 - .../win/visualstudio/autohintexe.vcxproj | 109 - c/autohint/config/linux/gcc/gcc.mak | 55 - c/autohint/config/xcconfig/common.xcconfig | 16 - c/autohint/config/xcconfig/debug.xcconfig | 11 - c/autohint/config/xcconfig/release.xcconfig | 5 - c/autohint/doc/AC.doc | 205 -- c/autohint/doc/bezfileformat.txt | 36 - c/autohint/source/main.c | 516 ---- c/buildall.cmd | 4 - setup.py | 2 +- 96 files changed, 1 insertion(+), 27725 deletions(-) delete mode 100644 c/autohint/autohintlib/build/linux/gcc/debug/Makefile delete mode 100644 c/autohint/autohintlib/build/linux/gcc/release/Makefile delete mode 100644 c/autohint/autohintlib/build/osx/xcode4/autohintlib.xcodeproj/project.pbxproj delete mode 100755 c/autohint/autohintlib/build/win/visualstudio/autohintlib.vcxproj delete mode 100755 c/autohint/autohintlib/config/linux/gcc/gcc.mak delete mode 100644 c/autohint/autohintlib/config/xcconfig/debug.xcconfig delete mode 100644 c/autohint/autohintlib/config/xcconfig/release.xcconfig delete mode 100644 c/autohint/autohintlib/source/ac/ac.c delete mode 100644 c/autohint/autohintlib/source/ac/ac.h delete mode 100644 c/autohint/autohintlib/source/ac/ac_C_lib.c delete mode 100644 c/autohint/autohintlib/source/ac/acfixed.c delete mode 100644 c/autohint/autohintlib/source/ac/atan.c delete mode 100644 c/autohint/autohintlib/source/ac/auto.c delete mode 100644 c/autohint/autohintlib/source/ac/bbox.c delete mode 100644 c/autohint/autohintlib/source/ac/bfstub.c delete mode 100644 c/autohint/autohintlib/source/ac/charprop.c delete mode 100644 c/autohint/autohintlib/source/ac/check.c delete mode 100644 c/autohint/autohintlib/source/ac/control.c delete mode 100644 c/autohint/autohintlib/source/ac/cswrite.c delete mode 100644 c/autohint/autohintlib/source/ac/enum.c delete mode 100644 c/autohint/autohintlib/source/ac/eval.c delete mode 100644 c/autohint/autohintlib/source/ac/fix.c delete mode 100644 c/autohint/autohintlib/source/ac/flat.c delete mode 100644 c/autohint/autohintlib/source/ac/fontinfo.c delete mode 100644 c/autohint/autohintlib/source/ac/gen.c delete mode 100644 c/autohint/autohintlib/source/ac/head.c delete mode 100644 c/autohint/autohintlib/source/ac/memcheck.c delete mode 100644 c/autohint/autohintlib/source/ac/merge.c delete mode 100644 c/autohint/autohintlib/source/ac/misc.c delete mode 100644 c/autohint/autohintlib/source/ac/path.c delete mode 100644 c/autohint/autohintlib/source/ac/pick.c delete mode 100644 c/autohint/autohintlib/source/ac/read.c delete mode 100644 c/autohint/autohintlib/source/ac/report.c delete mode 100644 c/autohint/autohintlib/source/ac/shuffle.c delete mode 100644 c/autohint/autohintlib/source/ac/stub.c delete mode 100644 c/autohint/autohintlib/source/ac/timecheck.c delete mode 100644 c/autohint/autohintlib/source/ac/write.c delete mode 100644 c/autohint/autohintlib/source/actest/AC_C_libtest.c delete mode 100644 c/autohint/autohintlib/source/bf/afmcharsetdefs.h delete mode 100644 c/autohint/autohintlib/source/bf/basic.h delete mode 100644 c/autohint/autohintlib/source/bf/bftoac.h delete mode 100644 c/autohint/autohintlib/source/bf/buildfont.h delete mode 100644 c/autohint/autohintlib/source/bf/charlist.c delete mode 100644 c/autohint/autohintlib/source/bf/charlist.h delete mode 100644 c/autohint/autohintlib/source/bf/charlistpriv.c delete mode 100644 c/autohint/autohintlib/source/bf/charlistpriv.h delete mode 100644 c/autohint/autohintlib/source/bf/charpath.c delete mode 100644 c/autohint/autohintlib/source/bf/charpath.h delete mode 100644 c/autohint/autohintlib/source/bf/charpathpriv.c delete mode 100644 c/autohint/autohintlib/source/bf/chartable.h delete mode 100644 c/autohint/autohintlib/source/bf/cryptdefs.h delete mode 100644 c/autohint/autohintlib/source/bf/cryptprocs.c delete mode 100644 c/autohint/autohintlib/source/bf/derivedchars.h delete mode 100644 c/autohint/autohintlib/source/bf/fileops.c delete mode 100644 c/autohint/autohintlib/source/bf/filookup.c delete mode 100644 c/autohint/autohintlib/source/bf/filookup.h delete mode 100644 c/autohint/autohintlib/source/bf/fipriv.h delete mode 100644 c/autohint/autohintlib/source/bf/fipublic.h delete mode 100644 c/autohint/autohintlib/source/bf/hintfile.h delete mode 100644 c/autohint/autohintlib/source/bf/illtobez.c delete mode 100644 c/autohint/autohintlib/source/bf/machinedep.c delete mode 100644 c/autohint/autohintlib/source/bf/machinedep.h delete mode 100644 c/autohint/autohintlib/source/bf/masterfont.h delete mode 100644 c/autohint/autohintlib/source/bf/masterfontpriv.h delete mode 100644 c/autohint/autohintlib/source/bf/opcodes.h delete mode 100644 c/autohint/autohintlib/source/bf/optable.c delete mode 100644 c/autohint/autohintlib/source/bf/optable.h delete mode 100644 c/autohint/autohintlib/source/bf/rawPStobez.c delete mode 100644 c/autohint/autohintlib/source/bf/transitionalchars.h delete mode 100644 c/autohint/autohintlib/source/public/ac/ac_C_lib.h delete mode 100644 c/autohint/autohintlib/source/public/ac/memcheck.h delete mode 100644 c/autohint/autohintlib/source/public/extras/numtypes.h delete mode 100644 c/autohint/autohintlib/source/public/extras/pubtypes.h delete mode 100644 c/autohint/autohintlib/source/public/mac/types.h delete mode 100644 c/autohint/autohintlib/source/public/winextras/dir.h delete mode 100644 c/autohint/autohintlib/source/public/winextras/file.h delete mode 100644 c/autohint/autohintlib/source/public/winextras/stdtypes.h delete mode 100644 c/autohint/autohintlib/source/public/winextras/sysmacros.h delete mode 100644 c/autohint/autohintlib/source/public/winextras/unistd.h delete mode 100755 c/autohint/build/linux/gcc/BuildAll.sh delete mode 100644 c/autohint/build/linux/gcc/debug/Makefile delete mode 100644 c/autohint/build/linux/gcc/release/Makefile delete mode 100755 c/autohint/build/osx/xcode4/BuildAll.sh delete mode 100644 c/autohint/build/osx/xcode4/autohintexe.xcodeproj/project.pbxproj delete mode 100755 c/autohint/build/win/visualstudio/BuildAll.cmd delete mode 100755 c/autohint/build/win/visualstudio/autohint.sln delete mode 100755 c/autohint/build/win/visualstudio/autohintexe.vcxproj delete mode 100755 c/autohint/config/linux/gcc/gcc.mak delete mode 100644 c/autohint/config/xcconfig/common.xcconfig delete mode 100644 c/autohint/config/xcconfig/debug.xcconfig delete mode 100644 c/autohint/config/xcconfig/release.xcconfig delete mode 100644 c/autohint/doc/AC.doc delete mode 100644 c/autohint/doc/bezfileformat.txt delete mode 100644 c/autohint/source/main.c diff --git a/c/autohint/autohintlib/build/linux/gcc/debug/Makefile b/c/autohint/autohintlib/build/linux/gcc/debug/Makefile deleted file mode 100644 index a61a9ee2e..000000000 --- a/c/autohint/autohintlib/build/linux/gcc/debug/Makefile +++ /dev/null @@ -1,213 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = debug - -# Library -ROOT_DIR = ../../../.. -SRC_DIR = $(ROOT_DIR)/source -OBJECT_DIR = . -LIB_TARGET = $(LIB_DIR)/autohintlib.a - -CFLAGS = $(STD_OPTS) -I$(ROOT_DIR)/source/public/ac \ - -I$(ROOT_DIR)/source/public/extras \ - -I$(ROOT_DIR)/source/ac \ - -I$(ROOT_DIR)/source/bf \ - -DAC_C_LIB=1 \ - -DACLIB_EXPORTS \ - -DIS_LIB \ - -g - -LIB_SRCS = \ - $(SRC_DIR)/ac/ac.c \ - $(SRC_DIR)/ac/ac_C_lib.c \ - $(SRC_DIR)/ac/acfixed.c \ - $(SRC_DIR)/ac/auto.c \ - $(SRC_DIR)/ac/bbox.c \ - $(SRC_DIR)/ac/bfstub.c \ - $(SRC_DIR)/ac/charprop.c \ - $(SRC_DIR)/ac/check.c \ - $(SRC_DIR)/ac/control.c \ - $(SRC_DIR)/ac/cswrite.c \ - $(SRC_DIR)/ac/enum.c \ - $(SRC_DIR)/ac/eval.c \ - $(SRC_DIR)/ac/fix.c \ - $(SRC_DIR)/ac/flat.c \ - $(SRC_DIR)/ac/fontinfo.c \ - $(SRC_DIR)/ac/gen.c \ - $(SRC_DIR)/ac/head.c \ - $(SRC_DIR)/ac/merge.c \ - $(SRC_DIR)/ac/misc.c \ - $(SRC_DIR)/ac/path.c \ - $(SRC_DIR)/ac/pick.c \ - $(SRC_DIR)/ac/read.c \ - $(SRC_DIR)/ac/report.c \ - $(SRC_DIR)/ac/shuffle.c \ - $(SRC_DIR)/ac/stub.c \ - $(SRC_DIR)/ac/write.c \ - $(SRC_DIR)/bf/charlistpriv.c \ - $(SRC_DIR)/bf/charpath.c \ - $(SRC_DIR)/bf/charpathpriv.c \ - $(SRC_DIR)/bf/cryptprocs.c \ - $(SRC_DIR)/bf/fileops.c \ - $(SRC_DIR)/bf/filookup.c \ - $(SRC_DIR)/bf/illtobez.c \ - $(SRC_DIR)/bf/machinedep.c \ - $(SRC_DIR)/bf/rawPStobez.c -LIB_OBJS = \ - ac.o \ - ac_C_lib.o \ - acfixed.o \ - auto.o \ - bbox.o \ - bfstub.o \ - charprop.o \ - check.o \ - control.o \ - cswrite.o \ - enum.o \ - eval.o \ - fix.o \ - flat.o \ - fontinfo.o \ - gen.o \ - head.o \ - merge.o \ - misc.o \ - path.o \ - pick.o \ - read.o \ - report.o \ - shuffle.o \ - stub.o \ - write.o \ - charlistpriv.o \ - charpath.o \ - charpathpriv.o \ - cryptprocs.o \ - fileops.o \ - filookup.o \ - illtobez.o \ - machinedep.o \ - rawPStobez.o - -# Standard definitions -include $(ROOT_DIR)/config/linux/gcc/gcc.mak - - -# Lib Object rules -absfont.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/absfont.c -o $@ - -ac.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/ac.c -o $@ - -ac_C_lib.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/ac_C_lib.c -o $@ - -acfixed.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/acfixed.c -o $@ - -auto.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/auto.c -o $@ - -bbox.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/bbox.c -o $@ - -bfstub.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/bfstub.c -o $@ - -charprop.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/charprop.c -o $@ - -check.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/check.c -o $@ - -control.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/control.c -o $@ - -cswrite.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/cswrite.c -o $@ - -enum.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/enum.c -o $@ - -eval.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/eval.c -o $@ - -fix.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/fix.c -o $@ - -flat.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/flat.c -o $@ - -fontinfo.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/fontinfo.c -o $@ - -gen.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/gen.c -o $@ - -head.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/head.c -o $@ - -merge.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/merge.c -o $@ - -misc.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/misc.c -o $@ - -path.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/path.c -o $@ - -pick.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/pick.c -o $@ - -read.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/read.c -o $@ - -report.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/report.c -o $@ - -shuffle.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/shuffle.c -o $@ - -stub.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/stub.c -o $@ - -write.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/write.c -o $@ - -charlistpriv.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/charlistpriv.c -o $@ - -charpath.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/charpath.c -o $@ - -charpathpriv.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/charpathpriv.c -o $@ - -cryptprocs.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/cryptprocs.c -o $@ - -fileops.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/fileops.c -o $@ - -filookup.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/filookup.c -o $@ - -illtobez.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/illtobez.c -o $@ - -machinedep.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/machinedep.c -o $@ - -rawPStobez.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/rawPStobez.c -o $@ - - - diff --git a/c/autohint/autohintlib/build/linux/gcc/release/Makefile b/c/autohint/autohintlib/build/linux/gcc/release/Makefile deleted file mode 100644 index b021dc221..000000000 --- a/c/autohint/autohintlib/build/linux/gcc/release/Makefile +++ /dev/null @@ -1,212 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = release - -# Library -ROOT_DIR = ../../../.. -SRC_DIR = $(ROOT_DIR)/source -OBJECT_DIR = . -LIB_TARGET = $(LIB_DIR)/autohintlib.a - -CFLAGS = $(STD_OPTS) -I$(ROOT_DIR)/source/public/ac \ - -I$(ROOT_DIR)/source/public/extras \ - -I$(ROOT_DIR)/source/ac \ - -I$(ROOT_DIR)/source/bf \ - -DAC_C_LIB=1 \ - -DACLIB_EXPORTS \ - -DIS_LIB - -LIB_SRCS = \ - $(SRC_DIR)/ac/ac.c \ - $(SRC_DIR)/ac/ac_C_lib.c \ - $(SRC_DIR)/ac/acfixed.c \ - $(SRC_DIR)/ac/auto.c \ - $(SRC_DIR)/ac/bbox.c \ - $(SRC_DIR)/ac/bfstub.c \ - $(SRC_DIR)/ac/charprop.c \ - $(SRC_DIR)/ac/check.c \ - $(SRC_DIR)/ac/control.c \ - $(SRC_DIR)/ac/cswrite.c \ - $(SRC_DIR)/ac/enum.c \ - $(SRC_DIR)/ac/eval.c \ - $(SRC_DIR)/ac/fix.c \ - $(SRC_DIR)/ac/flat.c \ - $(SRC_DIR)/ac/fontinfo.c \ - $(SRC_DIR)/ac/gen.c \ - $(SRC_DIR)/ac/head.c \ - $(SRC_DIR)/ac/merge.c \ - $(SRC_DIR)/ac/misc.c \ - $(SRC_DIR)/ac/path.c \ - $(SRC_DIR)/ac/pick.c \ - $(SRC_DIR)/ac/read.c \ - $(SRC_DIR)/ac/report.c \ - $(SRC_DIR)/ac/shuffle.c \ - $(SRC_DIR)/ac/stub.c \ - $(SRC_DIR)/ac/write.c \ - $(SRC_DIR)/bf/charlistpriv.c \ - $(SRC_DIR)/bf/charpath.c \ - $(SRC_DIR)/bf/charpathpriv.c \ - $(SRC_DIR)/bf/cryptprocs.c \ - $(SRC_DIR)/bf/fileops.c \ - $(SRC_DIR)/bf/filookup.c \ - $(SRC_DIR)/bf/illtobez.c \ - $(SRC_DIR)/bf/machinedep.c \ - $(SRC_DIR)/bf/rawPStobez.c -LIB_OBJS = \ - ac.o \ - ac_C_lib.o \ - acfixed.o \ - auto.o \ - bbox.o \ - bfstub.o \ - charprop.o \ - check.o \ - control.o \ - cswrite.o \ - enum.o \ - eval.o \ - fix.o \ - flat.o \ - fontinfo.o \ - gen.o \ - head.o \ - merge.o \ - misc.o \ - path.o \ - pick.o \ - read.o \ - report.o \ - shuffle.o \ - stub.o \ - write.o \ - charlistpriv.o \ - charpath.o \ - charpathpriv.o \ - cryptprocs.o \ - fileops.o \ - filookup.o \ - illtobez.o \ - machinedep.o \ - rawPStobez.o - -# Standard definitions -include $(ROOT_DIR)/config/linux/gcc/gcc.mak - - -# Lib Object rules -absfont.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/absfont.c -o $@ - -ac.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/ac.c -o $@ - -ac_C_lib.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/ac_C_lib.c -o $@ - -acfixed.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/acfixed.c -o $@ - -auto.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/auto.c -o $@ - -bbox.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/bbox.c -o $@ - -bfstub.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/bfstub.c -o $@ - -charprop.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/charprop.c -o $@ - -check.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/check.c -o $@ - -control.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/control.c -o $@ - -cswrite.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/cswrite.c -o $@ - -enum.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/enum.c -o $@ - -eval.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/eval.c -o $@ - -fix.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/fix.c -o $@ - -flat.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/flat.c -o $@ - -fontinfo.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/fontinfo.c -o $@ - -gen.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/gen.c -o $@ - -head.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/head.c -o $@ - -merge.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/merge.c -o $@ - -misc.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/misc.c -o $@ - -path.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/path.c -o $@ - -pick.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/pick.c -o $@ - -read.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/read.c -o $@ - -report.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/report.c -o $@ - -shuffle.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/shuffle.c -o $@ - -stub.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/stub.c -o $@ - -write.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/ac/write.c -o $@ - -charlistpriv.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/charlistpriv.c -o $@ - -charpath.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/charpath.c -o $@ - -charpathpriv.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/charpathpriv.c -o $@ - -cryptprocs.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/cryptprocs.c -o $@ - -fileops.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/fileops.c -o $@ - -filookup.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/filookup.c -o $@ - -illtobez.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/illtobez.c -o $@ - -machinedep.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/machinedep.c -o $@ - -rawPStobez.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/bf/rawPStobez.c -o $@ - - - diff --git a/c/autohint/autohintlib/build/osx/xcode4/autohintlib.xcodeproj/project.pbxproj b/c/autohint/autohintlib/build/osx/xcode4/autohintlib.xcodeproj/project.pbxproj deleted file mode 100644 index 0b063a6cf..000000000 --- a/c/autohint/autohintlib/build/osx/xcode4/autohintlib.xcodeproj/project.pbxproj +++ /dev/null @@ -1,509 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - BD5BF3610D9AC7FB0015F645 /* ac.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3410D9AC7FB0015F645 /* ac.c */; }; - BD5BF3620D9AC7FB0015F645 /* ac.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3420D9AC7FB0015F645 /* ac.h */; }; - BD5BF3630D9AC7FB0015F645 /* ac_C_lib.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3430D9AC7FB0015F645 /* ac_C_lib.c */; }; - BD5BF3640D9AC7FB0015F645 /* acfixed.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3440D9AC7FB0015F645 /* acfixed.c */; }; - BD5BF3670D9AC7FB0015F645 /* auto.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3470D9AC7FB0015F645 /* auto.c */; }; - BD5BF3680D9AC7FB0015F645 /* bbox.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3480D9AC7FB0015F645 /* bbox.c */; }; - BD5BF3690D9AC7FB0015F645 /* bfstub.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3490D9AC7FB0015F645 /* bfstub.c */; }; - BD5BF36A0D9AC7FB0015F645 /* charprop.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF34A0D9AC7FB0015F645 /* charprop.c */; }; - BD5BF36B0D9AC7FB0015F645 /* check.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF34B0D9AC7FB0015F645 /* check.c */; }; - BD5BF36C0D9AC7FB0015F645 /* control.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF34C0D9AC7FB0015F645 /* control.c */; }; - BD5BF36D0D9AC7FB0015F645 /* cswrite.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF34D0D9AC7FB0015F645 /* cswrite.c */; }; - BD5BF36E0D9AC7FB0015F645 /* enum.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF34E0D9AC7FB0015F645 /* enum.c */; }; - BD5BF36F0D9AC7FB0015F645 /* eval.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF34F0D9AC7FB0015F645 /* eval.c */; }; - BD5BF3700D9AC7FB0015F645 /* fix.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3500D9AC7FB0015F645 /* fix.c */; }; - BD5BF3710D9AC7FB0015F645 /* flat.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3510D9AC7FB0015F645 /* flat.c */; }; - BD5BF3720D9AC7FB0015F645 /* fontinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3520D9AC7FB0015F645 /* fontinfo.c */; }; - BD5BF3730D9AC7FB0015F645 /* gen.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3530D9AC7FB0015F645 /* gen.c */; }; - BD5BF3740D9AC7FB0015F645 /* head.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3540D9AC7FB0015F645 /* head.c */; }; - BD5BF3760D9AC7FB0015F645 /* memcheck.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3560D9AC7FB0015F645 /* memcheck.c */; }; - BD5BF3770D9AC7FB0015F645 /* merge.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3570D9AC7FB0015F645 /* merge.c */; }; - BD5BF3780D9AC7FB0015F645 /* misc.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3580D9AC7FB0015F645 /* misc.c */; }; - BD5BF3790D9AC7FB0015F645 /* path.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3590D9AC7FB0015F645 /* path.c */; }; - BD5BF37A0D9AC7FB0015F645 /* pick.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF35A0D9AC7FB0015F645 /* pick.c */; }; - BD5BF37B0D9AC7FB0015F645 /* read.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF35B0D9AC7FB0015F645 /* read.c */; }; - BD5BF37C0D9AC7FB0015F645 /* report.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF35C0D9AC7FB0015F645 /* report.c */; }; - BD5BF37D0D9AC7FB0015F645 /* shuffle.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF35D0D9AC7FB0015F645 /* shuffle.c */; }; - BD5BF37E0D9AC7FB0015F645 /* stub.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF35E0D9AC7FB0015F645 /* stub.c */; }; - BD5BF3800D9AC7FB0015F645 /* write.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3600D9AC7FB0015F645 /* write.c */; }; - BD5BF3A20D9AC8350015F645 /* afmcharsetdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3830D9AC8350015F645 /* afmcharsetdefs.h */; }; - BD5BF3A30D9AC8350015F645 /* basic.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3840D9AC8350015F645 /* basic.h */; }; - BD5BF3A40D9AC8350015F645 /* bftoac.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3850D9AC8350015F645 /* bftoac.h */; }; - BD5BF3A50D9AC8350015F645 /* buildfont.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3860D9AC8350015F645 /* buildfont.h */; }; - BD5BF3A60D9AC8350015F645 /* charlist.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3870D9AC8350015F645 /* charlist.c */; }; - BD5BF3A70D9AC8350015F645 /* charlist.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3880D9AC8350015F645 /* charlist.h */; }; - BD5BF3A80D9AC8350015F645 /* charlistpriv.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3890D9AC8350015F645 /* charlistpriv.c */; }; - BD5BF3A90D9AC8350015F645 /* charlistpriv.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF38A0D9AC8350015F645 /* charlistpriv.h */; }; - BD5BF3AA0D9AC8350015F645 /* charpath.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF38B0D9AC8350015F645 /* charpath.c */; }; - BD5BF3AB0D9AC8350015F645 /* charpath.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF38C0D9AC8350015F645 /* charpath.h */; }; - BD5BF3AC0D9AC8350015F645 /* charpathpriv.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF38D0D9AC8350015F645 /* charpathpriv.c */; }; - BD5BF3AD0D9AC8350015F645 /* chartable.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF38E0D9AC8350015F645 /* chartable.h */; }; - BD5BF3AE0D9AC8350015F645 /* cryptdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF38F0D9AC8350015F645 /* cryptdefs.h */; }; - BD5BF3AF0D9AC8350015F645 /* cryptprocs.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3900D9AC8350015F645 /* cryptprocs.c */; }; - BD5BF3B00D9AC8350015F645 /* derivedchars.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3910D9AC8350015F645 /* derivedchars.h */; }; - BD5BF3B10D9AC8350015F645 /* fileops.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3920D9AC8350015F645 /* fileops.c */; }; - BD5BF3B20D9AC8350015F645 /* filookup.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3930D9AC8350015F645 /* filookup.c */; }; - BD5BF3B30D9AC8350015F645 /* filookup.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3940D9AC8350015F645 /* filookup.h */; }; - BD5BF3B40D9AC8350015F645 /* fipriv.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3950D9AC8350015F645 /* fipriv.h */; }; - BD5BF3B50D9AC8350015F645 /* fipublic.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3960D9AC8350015F645 /* fipublic.h */; }; - BD5BF3B60D9AC8350015F645 /* hintfile.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3970D9AC8350015F645 /* hintfile.h */; }; - BD5BF3B70D9AC8350015F645 /* illtobez.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3980D9AC8350015F645 /* illtobez.c */; }; - BD5BF3B80D9AC8350015F645 /* machinedep.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3990D9AC8350015F645 /* machinedep.c */; }; - BD5BF3B90D9AC8350015F645 /* machinedep.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF39A0D9AC8350015F645 /* machinedep.h */; }; - BD5BF3BA0D9AC8350015F645 /* masterfont.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF39B0D9AC8350015F645 /* masterfont.h */; }; - BD5BF3BB0D9AC8350015F645 /* masterfontpriv.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF39C0D9AC8350015F645 /* masterfontpriv.h */; }; - BD5BF3BC0D9AC8350015F645 /* opcodes.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF39D0D9AC8350015F645 /* opcodes.h */; }; - BD5BF3BD0D9AC8350015F645 /* optable.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF39E0D9AC8350015F645 /* optable.c */; }; - BD5BF3BE0D9AC8350015F645 /* optable.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF39F0D9AC8350015F645 /* optable.h */; }; - BD5BF3BF0D9AC8350015F645 /* rawPStobez.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF3A00D9AC8350015F645 /* rawPStobez.c */; }; - BD5BF3C00D9AC8350015F645 /* transitionalchars.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3A10D9AC8350015F645 /* transitionalchars.h */; }; - BD5BF3D20D9ACD300015F645 /* ac_C_lib.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3CD0D9ACD300015F645 /* ac_C_lib.h */; }; - BD5BF3D30D9ACD300015F645 /* memcheck.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3CE0D9ACD300015F645 /* memcheck.h */; }; - BD5BF3D40D9ACD300015F645 /* numtypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3D00D9ACD300015F645 /* numtypes.h */; }; - BD5BF3D50D9ACD300015F645 /* pubtypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BD5BF3D10D9ACD300015F645 /* pubtypes.h */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - BD5BF3410D9AC7FB0015F645 /* ac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ac.c; sourceTree = ""; }; - BD5BF3420D9AC7FB0015F645 /* ac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ac.h; path = ../../../source/ac/ac.h; sourceTree = ""; }; - BD5BF3430D9AC7FB0015F645 /* ac_C_lib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ac_C_lib.c; sourceTree = ""; }; - BD5BF3440D9AC7FB0015F645 /* acfixed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acfixed.c; sourceTree = ""; }; - BD5BF3470D9AC7FB0015F645 /* auto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = auto.c; sourceTree = ""; }; - BD5BF3480D9AC7FB0015F645 /* bbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bbox.c; sourceTree = ""; }; - BD5BF3490D9AC7FB0015F645 /* bfstub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bfstub.c; sourceTree = ""; }; - BD5BF34A0D9AC7FB0015F645 /* charprop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = charprop.c; sourceTree = ""; }; - BD5BF34B0D9AC7FB0015F645 /* check.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = check.c; sourceTree = ""; }; - BD5BF34C0D9AC7FB0015F645 /* control.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = control.c; sourceTree = ""; }; - BD5BF34D0D9AC7FB0015F645 /* cswrite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cswrite.c; sourceTree = ""; }; - BD5BF34E0D9AC7FB0015F645 /* enum.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = enum.c; sourceTree = ""; }; - BD5BF34F0D9AC7FB0015F645 /* eval.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = eval.c; sourceTree = ""; }; - BD5BF3500D9AC7FB0015F645 /* fix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fix.c; sourceTree = ""; }; - BD5BF3510D9AC7FB0015F645 /* flat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = flat.c; sourceTree = ""; }; - BD5BF3520D9AC7FB0015F645 /* fontinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fontinfo.c; sourceTree = ""; }; - BD5BF3530D9AC7FB0015F645 /* gen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gen.c; sourceTree = ""; }; - BD5BF3540D9AC7FB0015F645 /* head.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = head.c; sourceTree = ""; }; - BD5BF3560D9AC7FB0015F645 /* memcheck.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memcheck.c; sourceTree = ""; }; - BD5BF3570D9AC7FB0015F645 /* merge.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = merge.c; sourceTree = ""; }; - BD5BF3580D9AC7FB0015F645 /* misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = ""; }; - BD5BF3590D9AC7FB0015F645 /* path.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = path.c; sourceTree = ""; }; - BD5BF35A0D9AC7FB0015F645 /* pick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pick.c; sourceTree = ""; }; - BD5BF35B0D9AC7FB0015F645 /* read.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = read.c; sourceTree = ""; }; - BD5BF35C0D9AC7FB0015F645 /* report.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = report.c; sourceTree = ""; }; - BD5BF35D0D9AC7FB0015F645 /* shuffle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = shuffle.c; sourceTree = ""; }; - BD5BF35E0D9AC7FB0015F645 /* stub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stub.c; sourceTree = ""; }; - BD5BF3600D9AC7FB0015F645 /* write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = write.c; sourceTree = ""; }; - BD5BF3830D9AC8350015F645 /* afmcharsetdefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = afmcharsetdefs.h; path = ../../../source/bf/afmcharsetdefs.h; sourceTree = ""; }; - BD5BF3840D9AC8350015F645 /* basic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = basic.h; path = ../../../source/bf/basic.h; sourceTree = ""; }; - BD5BF3850D9AC8350015F645 /* bftoac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bftoac.h; path = ../../../source/bf/bftoac.h; sourceTree = ""; }; - BD5BF3860D9AC8350015F645 /* buildfont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = buildfont.h; path = ../../../source/bf/buildfont.h; sourceTree = ""; }; - BD5BF3870D9AC8350015F645 /* charlist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = charlist.c; sourceTree = ""; }; - BD5BF3880D9AC8350015F645 /* charlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = charlist.h; path = ../../../source/bf/charlist.h; sourceTree = ""; }; - BD5BF3890D9AC8350015F645 /* charlistpriv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = charlistpriv.c; sourceTree = ""; }; - BD5BF38A0D9AC8350015F645 /* charlistpriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = charlistpriv.h; path = ../../../source/bf/charlistpriv.h; sourceTree = ""; }; - BD5BF38B0D9AC8350015F645 /* charpath.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = charpath.c; sourceTree = ""; }; - BD5BF38C0D9AC8350015F645 /* charpath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = charpath.h; path = ../../../source/bf/charpath.h; sourceTree = ""; }; - BD5BF38D0D9AC8350015F645 /* charpathpriv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = charpathpriv.c; sourceTree = ""; }; - BD5BF38E0D9AC8350015F645 /* chartable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = chartable.h; path = ../../../source/bf/chartable.h; sourceTree = ""; }; - BD5BF38F0D9AC8350015F645 /* cryptdefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cryptdefs.h; path = ../../../source/bf/cryptdefs.h; sourceTree = ""; }; - BD5BF3900D9AC8350015F645 /* cryptprocs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cryptprocs.c; sourceTree = ""; }; - BD5BF3910D9AC8350015F645 /* derivedchars.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = derivedchars.h; path = ../../../source/bf/derivedchars.h; sourceTree = ""; }; - BD5BF3920D9AC8350015F645 /* fileops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fileops.c; sourceTree = ""; }; - BD5BF3930D9AC8350015F645 /* filookup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = filookup.c; sourceTree = ""; }; - BD5BF3940D9AC8350015F645 /* filookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = filookup.h; path = ../../../source/bf/filookup.h; sourceTree = ""; }; - BD5BF3950D9AC8350015F645 /* fipriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fipriv.h; path = ../../../source/bf/fipriv.h; sourceTree = ""; }; - BD5BF3960D9AC8350015F645 /* fipublic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fipublic.h; path = ../../../source/bf/fipublic.h; sourceTree = ""; }; - BD5BF3970D9AC8350015F645 /* hintfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hintfile.h; sourceTree = ""; }; - BD5BF3980D9AC8350015F645 /* illtobez.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = illtobez.c; sourceTree = ""; }; - BD5BF3990D9AC8350015F645 /* machinedep.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = machinedep.c; sourceTree = ""; }; - BD5BF39A0D9AC8350015F645 /* machinedep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = machinedep.h; path = ../../../source/bf/machinedep.h; sourceTree = ""; }; - BD5BF39B0D9AC8350015F645 /* masterfont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = masterfont.h; path = ../../../source/bf/masterfont.h; sourceTree = ""; }; - BD5BF39C0D9AC8350015F645 /* masterfontpriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = masterfontpriv.h; path = ../../../source/bf/masterfontpriv.h; sourceTree = ""; }; - BD5BF39D0D9AC8350015F645 /* opcodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = opcodes.h; path = ../../../source/bf/opcodes.h; sourceTree = ""; }; - BD5BF39E0D9AC8350015F645 /* optable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = optable.c; sourceTree = ""; }; - BD5BF39F0D9AC8350015F645 /* optable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = optable.h; path = ../../../source/bf/optable.h; sourceTree = ""; }; - BD5BF3A00D9AC8350015F645 /* rawPStobez.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rawPStobez.c; sourceTree = ""; }; - BD5BF3A10D9AC8350015F645 /* transitionalchars.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = transitionalchars.h; path = ../../../source/bf/transitionalchars.h; sourceTree = ""; }; - BD5BF3C20D9AC9890015F645 /* debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = debug.xcconfig; path = ../../../config/xcconfig/debug.xcconfig; sourceTree = SOURCE_ROOT; }; - BD5BF3C30D9AC9900015F645 /* release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = release.xcconfig; path = ../../../config/xcconfig/release.xcconfig; sourceTree = SOURCE_ROOT; }; - BD5BF3CD0D9ACD300015F645 /* ac_C_lib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ac_C_lib.h; sourceTree = ""; }; - BD5BF3CE0D9ACD300015F645 /* memcheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memcheck.h; sourceTree = ""; }; - BD5BF3D00D9ACD300015F645 /* numtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = numtypes.h; sourceTree = ""; }; - BD5BF3D10D9ACD300015F645 /* pubtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pubtypes.h; sourceTree = ""; }; - D2AAC046055464E500DB518D /* libautohintlib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libautohintlib.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D289987405E68DCB004EDB86 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* autohintlib */ = { - isa = PBXGroup; - children = ( - BD5BF3C10D9AC9550015F645 /* xcconfig */, - BD5BF3810D9AC8130015F645 /* Headers */, - 08FB7795FE84155DC02AAC07 /* Source */, - C6A0FF2B0290797F04C91782 /* Documentation */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = autohintlib; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - BD5BF3820D9AC8350015F645 /* bf */, - BD5BF3400D9AC7FB0015F645 /* ac */, - ); - name = Source; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - D2AAC046055464E500DB518D /* libautohintlib.a */, - ); - name = Products; - sourceTree = ""; - }; - BD5BF3400D9AC7FB0015F645 /* ac */ = { - isa = PBXGroup; - children = ( - BD5BF3410D9AC7FB0015F645 /* ac.c */, - BD5BF3430D9AC7FB0015F645 /* ac_C_lib.c */, - BD5BF3440D9AC7FB0015F645 /* acfixed.c */, - BD5BF3470D9AC7FB0015F645 /* auto.c */, - BD5BF3480D9AC7FB0015F645 /* bbox.c */, - BD5BF3490D9AC7FB0015F645 /* bfstub.c */, - BD5BF34A0D9AC7FB0015F645 /* charprop.c */, - BD5BF34B0D9AC7FB0015F645 /* check.c */, - BD5BF34C0D9AC7FB0015F645 /* control.c */, - BD5BF34D0D9AC7FB0015F645 /* cswrite.c */, - BD5BF34E0D9AC7FB0015F645 /* enum.c */, - BD5BF34F0D9AC7FB0015F645 /* eval.c */, - BD5BF3500D9AC7FB0015F645 /* fix.c */, - BD5BF3510D9AC7FB0015F645 /* flat.c */, - BD5BF3520D9AC7FB0015F645 /* fontinfo.c */, - BD5BF3530D9AC7FB0015F645 /* gen.c */, - BD5BF3540D9AC7FB0015F645 /* head.c */, - BD5BF3560D9AC7FB0015F645 /* memcheck.c */, - BD5BF3570D9AC7FB0015F645 /* merge.c */, - BD5BF3580D9AC7FB0015F645 /* misc.c */, - BD5BF3590D9AC7FB0015F645 /* path.c */, - BD5BF35A0D9AC7FB0015F645 /* pick.c */, - BD5BF35B0D9AC7FB0015F645 /* read.c */, - BD5BF35C0D9AC7FB0015F645 /* report.c */, - BD5BF35D0D9AC7FB0015F645 /* shuffle.c */, - BD5BF35E0D9AC7FB0015F645 /* stub.c */, - BD5BF3600D9AC7FB0015F645 /* write.c */, - ); - name = ac; - path = ../../../source/ac; - sourceTree = SOURCE_ROOT; - }; - BD5BF3810D9AC8130015F645 /* Headers */ = { - isa = PBXGroup; - children = ( - BD5BF3CC0D9ACD300015F645 /* ac */, - BD5BF3CF0D9ACD300015F645 /* extras */, - BD5BF3420D9AC7FB0015F645 /* ac.h */, - BD5BF3830D9AC8350015F645 /* afmcharsetdefs.h */, - BD5BF3840D9AC8350015F645 /* basic.h */, - BD5BF3850D9AC8350015F645 /* bftoac.h */, - BD5BF3860D9AC8350015F645 /* buildfont.h */, - BD5BF3880D9AC8350015F645 /* charlist.h */, - BD5BF38A0D9AC8350015F645 /* charlistpriv.h */, - BD5BF38C0D9AC8350015F645 /* charpath.h */, - BD5BF38E0D9AC8350015F645 /* chartable.h */, - BD5BF38F0D9AC8350015F645 /* cryptdefs.h */, - BD5BF3910D9AC8350015F645 /* derivedchars.h */, - BD5BF3940D9AC8350015F645 /* filookup.h */, - BD5BF3950D9AC8350015F645 /* fipriv.h */, - BD5BF3960D9AC8350015F645 /* fipublic.h */, - BD5BF39A0D9AC8350015F645 /* machinedep.h */, - BD5BF39C0D9AC8350015F645 /* masterfontpriv.h */, - BD5BF39B0D9AC8350015F645 /* masterfont.h */, - BD5BF39D0D9AC8350015F645 /* opcodes.h */, - BD5BF39F0D9AC8350015F645 /* optable.h */, - BD5BF3A10D9AC8350015F645 /* transitionalchars.h */, - ); - name = Headers; - sourceTree = ""; - }; - BD5BF3820D9AC8350015F645 /* bf */ = { - isa = PBXGroup; - children = ( - BD5BF3870D9AC8350015F645 /* charlist.c */, - BD5BF3890D9AC8350015F645 /* charlistpriv.c */, - BD5BF38B0D9AC8350015F645 /* charpath.c */, - BD5BF38D0D9AC8350015F645 /* charpathpriv.c */, - BD5BF3900D9AC8350015F645 /* cryptprocs.c */, - BD5BF3920D9AC8350015F645 /* fileops.c */, - BD5BF3930D9AC8350015F645 /* filookup.c */, - BD5BF3970D9AC8350015F645 /* hintfile.h */, - BD5BF3980D9AC8350015F645 /* illtobez.c */, - BD5BF3990D9AC8350015F645 /* machinedep.c */, - BD5BF39E0D9AC8350015F645 /* optable.c */, - BD5BF3A00D9AC8350015F645 /* rawPStobez.c */, - ); - name = bf; - path = ../../../source/bf; - sourceTree = SOURCE_ROOT; - }; - BD5BF3C10D9AC9550015F645 /* xcconfig */ = { - isa = PBXGroup; - children = ( - BD5BF3C20D9AC9890015F645 /* debug.xcconfig */, - BD5BF3C30D9AC9900015F645 /* release.xcconfig */, - ); - name = xcconfig; - sourceTree = ""; - }; - BD5BF3CC0D9ACD300015F645 /* ac */ = { - isa = PBXGroup; - children = ( - BD5BF3CD0D9ACD300015F645 /* ac_C_lib.h */, - BD5BF3CE0D9ACD300015F645 /* memcheck.h */, - ); - name = ac; - path = ../../../source/public/ac; - sourceTree = SOURCE_ROOT; - }; - BD5BF3CF0D9ACD300015F645 /* extras */ = { - isa = PBXGroup; - children = ( - BD5BF3D00D9ACD300015F645 /* numtypes.h */, - BD5BF3D10D9ACD300015F645 /* pubtypes.h */, - ); - name = extras; - path = ../../../source/public/extras; - sourceTree = SOURCE_ROOT; - }; - C6A0FF2B0290797F04C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - ); - name = Documentation; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - D2AAC043055464E500DB518D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - BD5BF3620D9AC7FB0015F645 /* ac.h in Headers */, - BD5BF3A20D9AC8350015F645 /* afmcharsetdefs.h in Headers */, - BD5BF3A30D9AC8350015F645 /* basic.h in Headers */, - BD5BF3A40D9AC8350015F645 /* bftoac.h in Headers */, - BD5BF3A50D9AC8350015F645 /* buildfont.h in Headers */, - BD5BF3A70D9AC8350015F645 /* charlist.h in Headers */, - BD5BF3A90D9AC8350015F645 /* charlistpriv.h in Headers */, - BD5BF3AB0D9AC8350015F645 /* charpath.h in Headers */, - BD5BF3AD0D9AC8350015F645 /* chartable.h in Headers */, - BD5BF3AE0D9AC8350015F645 /* cryptdefs.h in Headers */, - BD5BF3B00D9AC8350015F645 /* derivedchars.h in Headers */, - BD5BF3B30D9AC8350015F645 /* filookup.h in Headers */, - BD5BF3B40D9AC8350015F645 /* fipriv.h in Headers */, - BD5BF3B50D9AC8350015F645 /* fipublic.h in Headers */, - BD5BF3B60D9AC8350015F645 /* hintfile.h in Headers */, - BD5BF3B90D9AC8350015F645 /* machinedep.h in Headers */, - BD5BF3BA0D9AC8350015F645 /* masterfont.h in Headers */, - BD5BF3BB0D9AC8350015F645 /* masterfontpriv.h in Headers */, - BD5BF3BC0D9AC8350015F645 /* opcodes.h in Headers */, - BD5BF3BE0D9AC8350015F645 /* optable.h in Headers */, - BD5BF3C00D9AC8350015F645 /* transitionalchars.h in Headers */, - BD5BF3D20D9ACD300015F645 /* ac_C_lib.h in Headers */, - BD5BF3D30D9ACD300015F645 /* memcheck.h in Headers */, - BD5BF3D40D9ACD300015F645 /* numtypes.h in Headers */, - BD5BF3D50D9ACD300015F645 /* pubtypes.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - D2AAC045055464E500DB518D /* autohintlib */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "autohintlib" */; - buildPhases = ( - D2AAC043055464E500DB518D /* Headers */, - D2AAC044055464E500DB518D /* Sources */, - D289987405E68DCB004EDB86 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = autohintlib; - productName = autohintlib; - productReference = D2AAC046055464E500DB518D /* libautohintlib.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "autohintlib" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 08FB7794FE84155DC02AAC07 /* autohintlib */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - D2AAC045055464E500DB518D /* autohintlib */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - D2AAC044055464E500DB518D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BD5BF3610D9AC7FB0015F645 /* ac.c in Sources */, - BD5BF3630D9AC7FB0015F645 /* ac_C_lib.c in Sources */, - BD5BF3640D9AC7FB0015F645 /* acfixed.c in Sources */, - BD5BF3670D9AC7FB0015F645 /* auto.c in Sources */, - BD5BF3680D9AC7FB0015F645 /* bbox.c in Sources */, - BD5BF3690D9AC7FB0015F645 /* bfstub.c in Sources */, - BD5BF36A0D9AC7FB0015F645 /* charprop.c in Sources */, - BD5BF36B0D9AC7FB0015F645 /* check.c in Sources */, - BD5BF36C0D9AC7FB0015F645 /* control.c in Sources */, - BD5BF36D0D9AC7FB0015F645 /* cswrite.c in Sources */, - BD5BF36E0D9AC7FB0015F645 /* enum.c in Sources */, - BD5BF36F0D9AC7FB0015F645 /* eval.c in Sources */, - BD5BF3700D9AC7FB0015F645 /* fix.c in Sources */, - BD5BF3710D9AC7FB0015F645 /* flat.c in Sources */, - BD5BF3720D9AC7FB0015F645 /* fontinfo.c in Sources */, - BD5BF3730D9AC7FB0015F645 /* gen.c in Sources */, - BD5BF3740D9AC7FB0015F645 /* head.c in Sources */, - BD5BF3760D9AC7FB0015F645 /* memcheck.c in Sources */, - BD5BF3770D9AC7FB0015F645 /* merge.c in Sources */, - BD5BF3780D9AC7FB0015F645 /* misc.c in Sources */, - BD5BF3790D9AC7FB0015F645 /* path.c in Sources */, - BD5BF37A0D9AC7FB0015F645 /* pick.c in Sources */, - BD5BF37B0D9AC7FB0015F645 /* read.c in Sources */, - BD5BF37C0D9AC7FB0015F645 /* report.c in Sources */, - BD5BF37D0D9AC7FB0015F645 /* shuffle.c in Sources */, - BD5BF37E0D9AC7FB0015F645 /* stub.c in Sources */, - BD5BF3800D9AC7FB0015F645 /* write.c in Sources */, - BD5BF3A60D9AC8350015F645 /* charlist.c in Sources */, - BD5BF3A80D9AC8350015F645 /* charlistpriv.c in Sources */, - BD5BF3AA0D9AC8350015F645 /* charpath.c in Sources */, - BD5BF3AC0D9AC8350015F645 /* charpathpriv.c in Sources */, - BD5BF3AF0D9AC8350015F645 /* cryptprocs.c in Sources */, - BD5BF3B10D9AC8350015F645 /* fileops.c in Sources */, - BD5BF3B20D9AC8350015F645 /* filookup.c in Sources */, - BD5BF3B70D9AC8350015F645 /* illtobez.c in Sources */, - BD5BF3B80D9AC8350015F645 /* machinedep.c in Sources */, - BD5BF3BD0D9AC8350015F645 /* optable.c in Sources */, - BD5BF3BF0D9AC8350015F645 /* rawPStobez.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1DEB91EC08733DB70010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF3C20D9AC9890015F645 /* debug.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "ACLIB_EXPORTS=1", - "IS_LIB=1", - "$(inherited)", - ); - }; - name = Debug; - }; - 1DEB91ED08733DB70010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF3C30D9AC9900015F645 /* release.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "ACLIB_EXPORTS=1", - "IS_LIB=1", - "$(inherited)", - ); - }; - name = Release; - }; - 1DEB91F008733DB70010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF3C20D9AC9890015F645 /* debug.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "ACLIB_EXPORTS=1", - "IS_LIB=1", - "OSX=1", - ); - PRODUCT_NAME = autohintlib; - }; - name = Debug; - }; - 1DEB91F108733DB70010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF3C30D9AC9900015F645 /* release.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "ACLIB_EXPORTS=1", - "IS_LIB=1", - "OSX=1", - ); - PRODUCT_NAME = autohintlib; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "autohintlib" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB91EC08733DB70010E9CD /* Debug */, - 1DEB91ED08733DB70010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "autohintlib" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB91F008733DB70010E9CD /* Debug */, - 1DEB91F108733DB70010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/c/autohint/autohintlib/build/win/visualstudio/autohintlib.vcxproj b/c/autohint/autohintlib/build/win/visualstudio/autohintlib.vcxproj deleted file mode 100755 index e0e5a559d..000000000 --- a/c/autohint/autohintlib/build/win/visualstudio/autohintlib.vcxproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {FDCEB06E-D2E3-4916-9208-3C70703BFB27} - autohintlib - 10.0.17134.0 - - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - StaticLibrary - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\lib\win\debug\ - $(Configuration)\ - ..\..\..\lib\win\release\ - $(Configuration)\ - autohintlib - autohintlib - - - - Disabled - ..\..\..\source\ac;..\..\..\source\public\ac;..\..\..\source\public\extras;..\..\..\source\public\winextras;..\..\..\source\bf\;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;ACLIB_EXPORTS;IS_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - EditAndContinue - - - AutoColorString;AC_getVersion;AC_SetMemManager;%(ExportNamedFunctions) - - - - - MaxSpeed - ..\..\..\source\ac;..\..\..\source\public\ac;..\..\..\source\public\extras;..\..\..\source\public\winextras;..\..\..\source\bf\;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;ACLIB_EXPORTS;IS_LIB;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - AutoColorString;AC_getVersion;AC_SetMemManager;%(ExportNamedFunctions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/c/autohint/autohintlib/config/linux/gcc/gcc.mak b/c/autohint/autohintlib/config/linux/gcc/gcc.mak deleted file mode 100755 index 028c58139..000000000 --- a/c/autohint/autohintlib/config/linux/gcc/gcc.mak +++ /dev/null @@ -1,41 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Make definitions for Linux platform (i86) - -# Configuration -PLATFORM = linux -HARDWARE = i86 -COMPILER = gcc -XFLAGS = -m32 - -# Directories (relative to build directory) -LIB_DIR = $(ROOT_DIR)/lib/$(PLATFORM)/$(CONFIG) - -STD_OPTS = $(XFLAGS) \ -$(SYS_INCLUDES) - -ifneq ($(strip $(OSX)),) # In order to test under Mac OSX, define OSX in the user environment. - STD_OPTS += -DOSX=1 -endif - -default: $(LIB_TARGET) - -$(LIB_TARGET): $(LIB_OBJS) - mkdir -p $(LIB_DIR) - $(AR) -rvs $@ $? - -clean: - if [ "$(LIB_OBJS)" ]; then \ - rm -f $(LIB_OBJS); \ - fi - - if [ "$(LIB_TARGET)" ]; then \ - rm -f $(LIB_TARGET); \ - fi - - diff --git a/c/autohint/autohintlib/config/xcconfig/debug.xcconfig b/c/autohint/autohintlib/config/xcconfig/debug.xcconfig deleted file mode 100644 index a9d2b73e4..000000000 --- a/c/autohint/autohintlib/config/xcconfig/debug.xcconfig +++ /dev/null @@ -1,3 +0,0 @@ -#include "../../../config/xcconfig/debug.xcconfig" -HEADER_SEARCH_PATHS = $(SDKROOT)/usr/include ../../../../api/** ../../../../resource/** -CONFIGURATION_BUILD_DIR = ../../../../lib/osx/debug diff --git a/c/autohint/autohintlib/config/xcconfig/release.xcconfig b/c/autohint/autohintlib/config/xcconfig/release.xcconfig deleted file mode 100644 index 6d4662a91..000000000 --- a/c/autohint/autohintlib/config/xcconfig/release.xcconfig +++ /dev/null @@ -1,4 +0,0 @@ -#include "../../../config/xcconfig/release.xcconfig" -HEADER_SEARCH_PATHS = $(SDKROOT)/usr/include ../../../../api/** ../../../../resource/** -CONFIGURATION_BUILD_DIR = ../../../../lib/osx/release - diff --git a/c/autohint/autohintlib/source/ac/ac.c b/c/autohint/autohintlib/source/ac/ac.c deleted file mode 100644 index 2d2950435..000000000 --- a/c/autohint/autohintlib/source/ac/ac.c +++ /dev/null @@ -1,315 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* ac.c */ - -#include "ac.h" -#include "bftoac.h" -#include "machinedep.h" -#include "fipublic.h" - -#if !WIN32 -extern int unlink(const char *); -#endif - -#define MAXSTEMDIST 150 /* initial maximum stem width allowed for hints */ - -#if ALLOWCSOUTPUT && THISISACMAIN -extern boolean charstringoutput; -#endif - -public -PPathElt pathStart, pathEnd; -public -boolean YgoesUp; -public -boolean useV, useH, autoVFix, autoHFix, autoLinearCurveFix, editChar; -public -boolean AutoExtraDEBUG, debugColorPath, DEBUG, logging; -public -boolean showVs, showHs, listClrInfo; -public -boolean reportErrors, hasFlex, flexOK, flexStrict, showClrInfo, bandError; -public -Fixed hBigDist, vBigDist, initBigDist, minDist, minMidPt, ghostWidth, - ghostLength, bendLength, bandMargin, maxFlare, - maxBendMerge, maxMerge, minColorElementLength, flexCand, - pruneMargin; -public -Fixed pruneA, pruneB, pruneC, pruneD, pruneValue, bonus; -public -real theta, hBigDistR, vBigDistR, maxVal, minVal; -public -integer lenTopBands, lenBotBands, numSerifs, DMIN, DELTA, CPpercent; -public -integer bendTan, sCurveTan; -public -PClrVal Vcoloring, Hcoloring, Vprimary, Hprimary, valList; -public -char *fileName; -public -char outPrefix[MAXPATHLEN]; -public -char inPrefix[MAXPATHLEN]; -public -PClrSeg segLists[4]; -public -Fixed VStems[MAXSTEMS], HStems[MAXSTEMS]; -public -integer NumVStems, NumHStems; -public -Fixed topBands[MAXBLUES], botBands[MAXBLUES], serifs[MAXSERIFS]; -public -PClrPoint pointList, *ptLstArray; -public -integer ptLstIndex, numPtLsts, maxPtLsts; -public -boolean makehintslog = TRUE; -public -boolean writecoloredbez = TRUE; -public -Fixed bluefuzz; -public -boolean doAligns, doStems; -public -boolean idInFile; -public -boolean roundToInt; -private -int maxStemDist = MAXSTEMDIST; - -public -AC_REPORTFUNCPTR libReportCB = NULL; -public -AC_REPORTFUNCPTR libErrorReportCB = NULL; -unsigned int allstems; /* if false, then stems defined by curves are excluded from the reporting */ -public -AC_REPORTSTEMPTR addHStemCB = NULL; -public -AC_REPORTSTEMPTR addVStemCB = NULL; -public -AC_REPORTZONEPTR addCharExtremesCB = NULL; -public -AC_REPORTZONEPTR addStemExtremesCB = NULL; -public -AC_RETRYPTR reportRetryCB = NULL; -#define CHARSETVAR "CHARSETDIR" -#define BAKFILE "hints.log.BAK" - -private -void *defaultAC_memmanage(void *ctxptr, void *old, unsigned long size) { -#ifndef WIN32 -#pragma unused(ctxptr) -#endif - if (size > 0) { - if (NULL == old) { -#if DOMEMCHECK - return memck_malloc((size_t)size); -#else - return malloc((size_t)size); -#endif - } else { -#if DOMEMCHECK - return memck_realloc(old, (size_t)size); -#else - return realloc(old, (size_t)size); -#endif - } - } else { - if (NULL == old) - return NULL; - else { -#if DOMEMCHECK - memck_free(old); -#else - free(old); -#endif - return NULL; - } - } -} - -/* SEE MACROS in ac.h: - ACNEWMEM(size) - ACREALLOCMEM(oldptr, newsize) - ACFREEMEM(ptr) -*/ - -public -AC_MEMMANAGEFUNCPTR AC_memmanageFuncPtr = defaultAC_memmanage; -public -void *AC_memmanageCtxPtr = NULL; - -public -void setAC_memoryManager(void *ctxptr, AC_MEMMANAGEFUNCPTR func) { - AC_memmanageFuncPtr = func; - AC_memmanageCtxPtr = ctxptr; -} - -#define VMSIZE (1000000L) -private -unsigned char *vmfree, *vmlast, vm[VMSIZE]; - -/* sub allocator */ -public -unsigned char *Alloc(integer sz) { - unsigned char *s; - sz = (sz + 3) & ~3; /* make size a multiple of 4 */ - s = vmfree; - vmfree += sz; - if (vmfree > vmlast) /* Error! need to make VMSIZE bigger */ - { - FlushLogFiles(); - sprintf(globmsg, "Exceeded VM size for hints in file: %s.\n", - fileName); - LogMsg(globmsg, LOGERROR, FATALERROR, TRUE); - } - return s; -} - -public -procedure InitData(integer reason) { - register char *s; - real tmp, origEmSquare; - - switch (reason) { - case STARTUP: - DEBUG = FALSE; - DMIN = 50; - DELTA = 0; - YgoesUp = (dtfmy(FixOne) > 0) ? TRUE : FALSE; - initBigDist = PSDist(maxStemDist); - /* must be <= 168 for ITC Garamond Book Italic p, q, thorn */ - minDist = PSDist(7); - ghostWidth = PSDist(20); - ghostLength = PSDist(4); - bendLength = PSDist(2); - bendTan = 577; /* 30 sin 30 cos div abs == .57735 */ - theta = (float).38; /* must be <= .38 for Ryumin-Light-32 c49*/ - pruneA = FixInt(50); - pruneC = 100; - pruneD = FixOne; - tmp = (float)10.24; /* set to 1024 times the threshold value */ - pruneValue = pruneB = acpflttofix(&tmp); - /* pruneB must be <= .01 for Yakout/Light/heM */ - /* pruneValue must be <= .01 for Yakout/Light/heM */ - CPpercent = 40; - /* must be < 46 for Americana-Bold d bowl vs stem coloring */ - bandMargin = PSDist(30); - maxFlare = PSDist(10); - pruneMargin = PSDist(10); - maxBendMerge = PSDist(6); - maxMerge = PSDist(2); /* must be < 3 for Cushing-BookItalic z */ - minColorElementLength = PSDist(12); - flexCand = PSDist(4); - sCurveTan = 25; - maxVal = 8000000.0; - minVal = 1.0 / (real)(FixOne); - autoHFix = autoVFix = FALSE; - editChar = TRUE; - roundToInt = true; - /* Default is to change a curve with collinear points into a line. */ - autoLinearCurveFix = TRUE; - flexOK = FALSE; - flexStrict = TRUE; - AutoExtraDEBUG = DEBUG; - logging = DEBUG; - debugColorPath = FALSE; - showClrInfo = DEBUG; - showHs = showVs = DEBUG; - listClrInfo = DEBUG; - if (scalinghints) { - SetFntInfoFileName(SCALEDHINTSINFO); - s = GetFntInfo("OrigEmSqUnits", MANDATORY); - sscanf(s, "%g", &origEmSquare); -#if DOMEMCHECK - memck_free(s); -#else - ACFREEMEM(s); -#endif - bluefuzz = (Fixed)(origEmSquare / 2000.0); /* .5 pixel */ - } else { - ResetFntInfoFileName(); - bluefuzz = DEFAULTBLUEFUZZ; - } - /* fall through */ - case RESTART: - memset((void *)vm, 0x0, VMSIZE); - vmfree = vm; - vmlast = vm + VMSIZE; - - /* ?? Does this cause a leak ?? */ - pointList = NULL; - maxPtLsts = 5; - ptLstArray = (PClrPoint *)Alloc(maxPtLsts * sizeof(PClrPoint)); - ptLstIndex = 0; - ptLstArray[0] = NULL; - numPtLsts = 1; - - /* if (fileName != NULL && fileName[0] == 'g') - showClrInfo = showHs = showVs = listClrInfo = TRUE; */ - } -} - -private -procedure setOutputPrefix(prefix) char *prefix; -{ - get_filename(outPrefix, prefix, ""); -} - -public -procedure SetMaxStemDist(int dist) { - maxStemDist = dist; -} - -/* Returns whether coloring was successful. */ -public -boolean AutoColor( - boolean release, - boolean fixStems, - boolean debug, - boolean extracolor, - boolean changeChar, - short total_files, - char *fileNamePtr[], - boolean quiet, - boolean doAll, - boolean roundCoords, - boolean doLog) { - boolean result, renameLog = FALSE; - char *tempstring; - - makehintslog = doLog; - (void)InitAll(STARTUP); - -#if ALLOWCSOUTPUT && THISISACMAIN - if (charstringoutput) { - setOutputPrefix("CharString"); - DirExists("CharString", FALSE, TRUE, FALSE); - } -#endif - if (!ReadFontInfo()) return FALSE; - editChar = changeChar; - roundToInt = roundCoords; - if ((editChar) && fixStems) - autoVFix = autoHFix = fixStems; - autoLinearCurveFix = editChar; - if (debug) - DEBUG = showClrInfo = showHs = showVs = listClrInfo = TRUE; - if ((tempstring = getenv(CHARSETVAR)) != NULL) - set_charsetdir(tempstring); - else - set_charsetdir("\0"); - if (doLog) - OpenLogFiles(); - /* It is possible to do both DoArgs and DoAll when called from - BuildFont. The derived character names are hinted by calling - DoArgs since they should always be rehinted, even in release mode. */ - if (total_files > 0) /* user specified file names */ - { - if (fileNamePtr[0][0] == '\0') - result = DoArgsIgnoreTime(total_files, fileNamePtr, extracolor, &renameLog, release); - } - - return (result); -} diff --git a/c/autohint/autohintlib/source/ac/ac.h b/c/autohint/autohintlib/source/ac/ac.h deleted file mode 100644 index 75bd53a28..000000000 --- a/c/autohint/autohintlib/source/ac/ac.h +++ /dev/null @@ -1,480 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -/* See the discussion in the function definition for: - control.c:Blues() - private procedure Blues() - */ -#include "ac_C_lib.h" -#include "buildfont.h" - -#if DOMEMCHECK -#include "memcheck.h" -#endif - -/* widely used definitions */ - -#define procedure void -#define private static -#define public -#ifndef NULL -#define NULL 0L -#endif - -#if THISISACMAIN -#define ALLOWCSOUTPUT 1 -#else -#define ALLOWCSOUTPUT 0 -#endif - -#if defined(THINK_C) -#define L_cuserid 20 /*ASP: was defined stdio.h*/ -#endif - -/* number of default entries in counter color character list. */ -#define COUNTERDEFAULTENTRIES 4 -#define COUNTERLISTSIZE 64 - -/* values for ClrSeg.sType */ -#define sLINE (0L) -#define sBEND (1L) -#define sCURVE (2L) -#define sGHOST (3L) - -/* values for PathElt.type */ -#define MOVETO (0L) -#define LINETO (1L) -#define CURVETO (2L) -#define CLOSEPATH (3L) - -/* values for pathelt control points */ -#define cpStart (0L) -#define cpCurve1 (1L) -#define cpCurve2 (2L) -#define cpEnd (3L) - -/* widths of ghost bands */ -#define botGhst (-21L) -#define topGhst (-20L) - -/* structures */ - -typedef struct { - short int limit; - Fixed feps; - procedure (*report)(); - Cd ll, ur; - Fixed llx, lly; -} FltnRec, *PFltnRec; - -typedef struct _clrseg { - struct _clrseg *sNxt; - /* points to next ClrSeg in list */ - /* separate lists for top, bottom, left, and right segments */ - Fixed sLoc, sMax, sMin; - /* sLoc is X loc for vertical seg, Y loc for horizontal seg */ - /* sMax and sMin give Y extent for vertical seg, X extent for horizontal */ - /* i.e., sTop=sMax, sBot=sMin, sLft=sMin, sRght=sMax. */ - Fixed sBonus; - /* nonzero for segments in sol-eol subpaths */ - /* (probably a leftover that is no longer needed) */ - struct _clrval *sLnk; - /* points to the best ClrVal that uses this ClrSeg */ - /* set by FindBestValForSegs in pick.c */ - struct _pthelt *sElt; - /* points to the path element that generated this ClrSeg */ - /* set by AddSegment in gen.c */ - short int sType; - /* tells what type of segment this is: sLINE sBEND sCURVE or sGHOST */ -} ClrSeg, *PClrSeg; - -typedef struct _seglnk { - PClrSeg seg; -} SegLnk, *PSegLnk; - -typedef struct _seglnklst { - struct _seglnklst *next; - PSegLnk lnk; -} SegLnkLst; - -typedef SegLnkLst *PSegLnkLst; - -#if 0 -typedef struct _clrrep { - Fixed vVal, vSpc, vLoc1, vLoc2; - struct _clrval *vBst; -} ClrRep, *PClrRep; - -typedef struct _clrval { - struct _clrval *vNxt; - Fixed vVal, vSpc, initVal; - Fixed vLoc1, vLoc2; - /* vBot=vLoc1, vTop=vLoc2, vLft=vLoc1, vRght=vLoc2 */ - short int vGhst : 8; - short int pruned : 8; - PClrSeg vSeg1, vSeg2; - struct _clrval *vBst; - PClrRep vRep; -} ClrVal, *PClrVal; -#else -typedef struct _clrval { - struct _clrval *vNxt; - /* points to next ClrVal in list */ - Fixed vVal, vSpc, initVal; - /* vVal is value given in eval.c */ - /* vSpc is nonzero for "special" ClrVals */ - /* such as those with a segment in a blue zone */ - /* initVal is the initially assigned value */ - /* used by FndBstVal in pick.c */ - Fixed vLoc1, vLoc2; - /* vLoc1 is location corresponding to vSeg1 */ - /* vLoc2 is location corresponding to vSeg2 */ - /* for horizontal ClrVal, vBot=vLoc1 and vTop=vLoc2 */ - /* for vertical ClrVal, vLft=vLoc1 and vRght=vLoc2 */ - unsigned int vGhst : 1; /* true iff one of the ClrSegs is a sGHOST seg */ - unsigned int pruned : 1; - /* flag used by FindBestHVals and FindBestVVals */ - /* and by PruneVVals and PruneHVals */ - unsigned int merge : 1; - /* flag used by ReplaceVals in merge.c */ - unsigned int unused : 13; - PClrSeg vSeg1, vSeg2; - /* vSeg1 points to the left ClrSeg in a vertical, bottom in a horizontal */ - /* vSeg2 points to the right ClrSeg in a vertical, top in a horizontal */ - struct _clrval *vBst; - /* points to another ClrVal if this one has been merged or replaced */ -} ClrVal, *PClrVal; -#endif - -typedef struct _pthelt { - struct _pthelt *prev, *next, *conflict; - short int type; - PSegLnkLst Hs, Vs; - boolean Hcopy : 1, Vcopy : 1, isFlex : 1, yFlex : 1, newCP : 1, sol : 1, eol : 1; - int unused : 9; - short int count, newcolors; - Fixed x, y, x1, y1, x2, y2, x3, y3; -} PathElt, *PPathElt; - -typedef struct _clrpnt { - struct _clrpnt *next; - Fixed x0, y0, x1, y1; - /* for vstem, only interested in x0 and x1 */ - /* for hstem, only interested in y0 and y1 */ - PPathElt p0, p1; - /* p0 is source of x0,y0; p1 is source of x1,y1 */ - char c; - /* tells what kind of coloring: 'b' 'y' 'm' or 'v' */ - boolean done; -} ClrPoint, *PClrPoint; - -typedef struct { - char *key, *value; -} FFEntry; - -/* global data */ - -#ifdef IS_LIB -extern FFEntry *featurefiledata; -extern int featurefilesize; - -#elif defined(AC_C_LIB) -extern FFEntry *featurefiledata; -extern int featurefilesize; -#endif - -extern PPathElt pathStart, pathEnd; -extern boolean YgoesUp; -extern boolean useV, useH, autoVFix, autoHFix, autoLinearCurveFix; -extern boolean AutoExtraDEBUG, debugColorPath, DEBUG, logging; -extern boolean editChar; /* whether character can be modified when adding hints */ -extern boolean scalehints; -extern boolean showHs, showVs, bandError, listClrInfo; -extern boolean reportErrors, hasFlex, flexOK, flexStrict, showClrInfo; -extern Fixed hBigDist, vBigDist, initBigDist, minDist, minMidPt, ghostWidth, - ghostLength, bendLength, bandMargin, maxFlare, - maxBendMerge, maxMerge, minColorElementLength, flexCand, - pruneMargin; -extern Fixed pruneA, pruneB, pruneC, pruneD, pruneValue, bonus; -extern real theta, hBigDistR, vBigDistR, maxVal, minVal; -extern integer DMIN, DELTA, CPpercent, bendTan, sCurveTan; -extern PClrVal Vcoloring, Hcoloring, Vprimary, Hprimary, valList; -extern char *fileName; -extern char outPrefix[MAXPATHLEN], *outSuffix; -extern char inPrefix[MAXPATHLEN], *inSuffix; -extern PClrSeg segLists[4]; /* left, right, top, bot */ -extern PClrPoint pointList, *ptLstArray; -extern integer ptLstIndex, numPtLsts, maxPtLsts; -extern procedure AddStemExtremes(Fixed bot, Fixed top); - -#define leftList (segLists[0]) -#define rightList (segLists[1]) -#define topList (segLists[2]) -#define botList (segLists[3]) - -#define MAXFLEX (PSDist(20)) -#define MAXBLUES (20) -#define MAXSERIFS (5) -extern Fixed topBands[MAXBLUES], botBands[MAXBLUES], serifs[MAXSERIFS]; -extern integer lenTopBands, lenBotBands, numSerifs; -#define MAXSTEMS (20) -extern Fixed VStems[MAXSTEMS], HStems[MAXSTEMS]; -extern integer NumVStems, NumHStems; -extern char *HColorList[], *VColorList[]; -extern integer NumHColors, NumVColors; -extern boolean makehintslog; -extern boolean writecoloredbez; -extern Fixed bluefuzz; -extern boolean doAligns, doStems; -extern boolean idInFile; -extern boolean roundToInt; -extern char bezGlyphName[64]; /* defined in read.c; set from the glyph name at the start of the bex file. */ - -/* macros */ - -#define ac_abs(a) (((abstmp = (a)) < 0) ? -abstmp : abstmp) - -#define FixedPosInf MAXinteger -#define FixedNegInf MINinteger -#define FixShift (8) -#define FixInt(i) (((long int)(i)) << FixShift) -#define FixReal(i) ((long int)((i)*256.0)) -extern long int FRnd(long int x); -#define FHalfRnd(x) ((long int)(((x) + (1 << 7)) & ~0xFFL)) -#define FracPart(x) ((long int)(x)&0xFFL) -#define FTrunc(x) (((long int)(x)) >> FixShift) -#define FIXED2FLOAT(x) (x / 256.0) -#if SUN -#ifndef MAX -#define MAX(a, b) ((a) >= (b) ? (a) : (b)) -#endif -#ifndef MIN -#define MIN(a, b) ((a) <= (b) ? (a) : (b)) -#endif -#endif - -#define FixOne (0x100L) -#define FixTwo (0x200L) -#define FixHalf (0x80L) -#define FixQuarter (0x40L) -#define FixHalfMul(f) (2 * ((f) >> 2)) /* DEBUG 8 BIT. Revert this to ((f) >>1) once I am confident that there are not bugs from the update to 8 bits for the Fixed fraction. */ -#define FixTwoMul(f) ((f) << 1) -#define tfmx(x) ((x)) -#define tfmy(y) (-(y)) -#define itfmx(x) ((x)) -#define itfmy(y) (-(y)) -#define dtfmx(x) ((x)) -#define dtfmy(y) (-(y)) -#define idtfmx(x) ((x)) -#define idtfmy(y) (-(y)) -#define PSDist(d) ((FixInt(d))) -#define IsVertical(x1, y1, x2, y2) (VertQuo(x1, y1, x2, y2) > 0) -#define IsHorizontal(x1, y1, x2, y2) (HorzQuo(x1, y1, x2, y2) > 0) -#define SFACTOR (20L) -/* SFACTOR must be < 25 for Gothic-Medium-22 c08 */ -#define spcBonus (1000L) -#define ProdLt0(f0, f1) (((f0) < 0L && (f1) > 0L) || ((f0) > 0L && (f1) < 0L)) -#define ProdGe0(f0, f1) (!ProdLt0(f0, f1)) - -#define DEBUG_ROUND(val) \ - { val = (val >= 0) ? (2 * (val / 2)) : (2 * ((val - 1) / 2)); } -#define DEBUG_ROUND4(val) \ - { val = (val >= 0) ? (4 * (val / 4)) : (4 * ((val - 1) / 4)); } - -/* DEBUG_ROUND is used to force calculations to come out the same as the previous version, where coordinates used 7 bits for the Fixed fraction, rather than the current 8 bits. Once I am confident that there are no bugs in the update, I will remove all occurences of this macro, and accept the differences due to more exact division */ -/* procedures */ - -/* The fix to float and float to fixed procs are different for ac because it - uses 24 bit of integer and 8 bits of fraction. */ -extern procedure acfixtopflt(Fixed x, float *pf); -extern Fixed acpflttofix(float *pv); - -extern unsigned char *Alloc(integer sz); /* Sub-allocator */ - -extern AC_MEMMANAGEFUNCPTR AC_memmanageFuncPtr; -extern void *AC_memmanageCtxPtr; -extern void setAC_memoryManager(void *ctxptr, AC_MEMMANAGEFUNCPTR func); - -#define ACNEWMEM(size) AC_memmanageFuncPtr(AC_memmanageCtxPtr, NULL, (unsigned long)(size)) -#define ACREALLOCMEM(oldptr, newsize) AC_memmanageFuncPtr(AC_memmanageCtxPtr, (oldptr), (newsize)) -#define ACFREEMEM(ptr) AC_memmanageFuncPtr(AC_memmanageCtxPtr, (ptr), 0) - -extern int AddCounterColorChars(); -extern boolean FindNameInList(); -extern procedure ACGetVersion(); -extern procedure PruneElementColorSegs(); -extern int TestColorLst(/*lst, colorList, flg, Hflg, doLst*/); -extern PClrVal CopyClrs(/*lst*/); -extern procedure AutoExtraColors(/*movetoNewClrs, soleol, solWhere*/); -extern PPathElt FindSubpathBBox(/*e*/); -extern procedure ClrVBnds(); -extern procedure ReClrVBnds(); -extern procedure ClrHBnds(); -extern procedure ReClrHBnds(); -extern procedure AddBBoxHV(/*Hflg*/); -extern procedure ClrBBox(); -extern procedure SetMaxStemDist(/* int dist */); -extern procedure CheckPathBBox(); -extern integer SpecialCharType(); -extern boolean VColorChar(); -extern boolean HColorChar(); -extern boolean NoBlueChar(); -extern integer SolEolCharCode(/*s*/); -extern boolean SpecialSolEol(); -extern boolean MoveToNewClrs(); -extern procedure CheckSmooth(); -extern procedure CheckBBoxEdge(/*e, vrt, lc, pf, pl*/); -extern boolean CheckBBoxes(/*e1, e2*/); -extern boolean CheckSmoothness(/*x0, y0, x1, y1, x2, y2, pd*/); -extern procedure CheckForDups(); -extern boolean showClrInfo; -extern procedure AddColorPoint(Fixed x0, Fixed y0, Fixed x1, Fixed y1, char ch, PPathElt p0, PPathElt p1); -extern procedure AddHPair(PClrVal v, char ch); -extern procedure AddVPair(PClrVal v, char ch); -extern procedure XtraClrs(/*e*/); -extern boolean CreateTimesFile(); -extern boolean DoFile(char *fname, boolean extracolor); -extern procedure DoList(/*filenames*/); -extern procedure EvalV(); -extern procedure EvalH(); -extern procedure GenVPts(); -extern procedure CheckVal(/*val, vert*/); -extern procedure CheckTfmVal(/*b, t, vert*/); -extern procedure CheckVals(/*vlst, vert*/); -extern boolean DoFixes(); -extern boolean FindLineSeg(); -extern procedure FltnCurve(/*c0, c1, c2, c3, pfr*/); -extern boolean ReadFontInfo(); -extern boolean InBlueBand(/*loc,n,p*/); -extern procedure GenHPts(); -extern procedure PreGenPts(); -extern PPathElt GetDest(/*cldest*/); -extern PPathElt GetClosedBy(/*clsdby*/); -extern procedure GetEndPoint(/*e, x1p, y1p*/); -extern procedure GetEndPoints(/*p,px0,py0,px1,py1*/); -extern Fixed VertQuo(/*xk,yk,xl,yl*/); -extern Fixed HorzQuo(/*xk,yk,xl,yl*/); -extern boolean IsTiny(/*e*/); -extern boolean IsShort(/*e*/); -extern PPathElt NxtForBend(/*p,px2,py2,px3,py3*/); -extern PPathElt PrvForBend(/*p,px2,py2*/); -extern boolean IsLower(/*p*/); -extern boolean IsUpper(/*p*/); -extern boolean CloseSegs(/*s1,s2,vert*/); -extern boolean DoAllIgnoreTime(); -extern boolean DoArgsIgnoreTime(); -extern boolean DoArgs(int cnt, char *names[], boolean extraColor, boolean *renameLog, boolean release); -extern boolean DoAll(boolean extraColor, boolean release, boolean *renameLog, boolean quiet); - -extern procedure DoPrune(); -extern procedure PruneVVals(); -extern procedure PruneHVals(); -extern procedure MergeVals(/*vert*/); -extern procedure MergeFromMainColors(char ch); -extern procedure RoundPathCoords(); -extern procedure MoveSubpathToEnd(/*e*/); -extern procedure AddSolEol(); -extern int IncludeFile(); -extern procedure InitAuto(); -extern procedure InitData(integer reason); -extern procedure InitFix(); -extern procedure InitGen(); -extern boolean RotateSubpaths(/*flg*/); -extern procedure InitPick(); -extern procedure AutoAddFlex(); -extern integer PointListCheck(/*new,lst*/); -extern boolean SameColors(/*cn1, cn2*/); -extern boolean PreCheckForColoring(); -extern integer CountSubPaths(); -extern procedure PickVVals(/*valList*/); -extern procedure PickHVals(/*valList*/); -extern procedure FindBestHVals(); -extern procedure FindBestVVals(); -extern procedure LogYMinMax(); -extern procedure PrintMessage(/*s*/); -extern procedure ReportError(/*s*/); -extern procedure ReportSmoothError(/*x, y*/); -extern procedure ReportBadClosePathForAutoColoring(/*e*/); -extern procedure ReportAddFlex(); -extern procedure ReportClipSharpAngle(/*x, y*/); -extern procedure ReportSharpAngle(/*x, y*/); -extern procedure ReportLinearCurve(/*e, x0, y0, x1, y1*/); -extern procedure ReportNonHError(/*x0, y0, x1, y1*/); -extern procedure ReportNonVError(/*x0, y0, x1, y1*/); -extern procedure ExpectedMoveTo(/*e*/); -extern procedure ReportMissingClosePath(); -extern procedure ReportTryFlexNearMiss(/*x0, y0, x2, y2*/); -extern procedure ReportTryFlexError(/*CPflg, x, y*/); -extern procedure AskForSplit(/*e*/); -extern procedure ReportSplit(/*e*/); -extern procedure ReportConflictCheck(/*e, conflict, cp*/); -extern procedure ReportConflictCnt(/*e, cnt*/); -extern procedure ReportMoveSubpath(/*e*/); -extern procedure ReportRemFlare(/*e*/); -extern procedure ReportRemConflict(/*e*/); -extern procedure ReportRotateSubpath(/*e*/); -extern procedure ReportRemShortColors(/*ex, ey*/); -extern boolean ResolveConflictBySplit(/*e,Hflg,lnk1,lnk2*/); -extern procedure ReportPossibleLoop(/*e*/); -extern procedure ShowHVal(/*val*/); -extern procedure ShowHVals(/*lst*/); -extern procedure ReportAddHVal(/*val*/); -extern procedure ShowVVal(/*val*/); -extern procedure ShowVVals(/*lst*/); -extern procedure ReportAddVVal(/*val*/); -extern procedure ReportFndBstVal(/*seg,val,hFlg*/); -extern procedure ReportCarry(/*l0, l1, loc, clrs, vert*/); -extern procedure ReportBestCP(/*e, cp*/); -extern procedure LogColorInfo(/*pl*/); -extern procedure ReportAddVSeg(/*from, to, loc, i*/); -extern procedure ReportAddHSeg(/*from, to, loc, i*/); -#if 0 -extern procedure ReportBandError(/*str, loc, blu*/); -#else -extern procedure ReportBandNearMiss(/*str, loc, blu*/); -#endif -extern procedure ReportStemNearMiss(/*vert, w, minW, b, t*/); -extern procedure ReportColorConflict(/*x0, y0, x1, y1, ch*/); -extern procedure ReportDuplicates(/*x, y*/); -extern procedure ReportBBoxBogus(/*llx, lly, urx, ury*/); -extern procedure ReportMergeHVal(/*b0,t0,b1,t1,v0,s0,v1,s1*/); -extern procedure ReportMergeVVal(/*l0,r0,l1,r1,v0,s0,v1,s1*/); -extern procedure ReportPruneHVal(/*val*/); -extern procedure ReportPruneVVal(/*val*/); -extern Fixed ScaleAbs(); -extern Fixed UnScaleAbs(); -extern procedure InitShuffleSubpaths(); -extern procedure MarkLinks(/*vL,hFlg*/); -extern procedure DoShuffleSubpaths(); -extern procedure CopyMainH(); -extern procedure CopyMainV(); -extern procedure RMovePoint(); -extern procedure AddVSegment(); -extern procedure AddHSegment(); -extern procedure Delete(); -extern boolean StrEqual(); -extern boolean ReadCharFile(); -extern double FixToDbl(/*f*/); -extern boolean CompareValues(); -extern procedure SaveFile(); -extern procedure CheckForMultiMoveTo(); -extern double fabs(); -#define STARTUP (0) -#define RESTART (1) - -public -procedure ListClrInfo(/**/); -public -procedure Test(); - -extern procedure InitAll(/*reason*/); - -public -procedure AddVStem(); -public -procedure AddHStem(); - -public -procedure AddCharExtremes(); -public -procedure AddStemExtremes(); diff --git a/c/autohint/autohintlib/source/ac/ac_C_lib.c b/c/autohint/autohintlib/source/ac/ac_C_lib.c deleted file mode 100644 index 450ff64cc..000000000 --- a/c/autohint/autohintlib/source/ac/ac_C_lib.c +++ /dev/null @@ -1,326 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/* AC_C_lib.c */ - -#include "setjmp.h" - -#include "ac_C_lib.h" -#include "ac.h" -#include "bftoac.h" -#include "machinedep.h" - -const char *libversion = "1.5.12"; -const char *progname = "AC_C_lib"; -char editingResource = 0; - -FFEntry *featurefiledata; -int featurefilesize; - -char *FL_glyphname = 0; - -const char *bezstring = 0; -char *bezoutput = 0; -int bezoutputalloc = 0; -int bezoutputactual = 0; - -extern int compatiblemode; /*forces the definition of colors even before a color sub*/ - -jmp_buf aclibmark; /* to handle exit() calls in the library version*/ - -#define skipblanks() \ - while (*current == '\t' || *current == '\n' || *current == ' ' || *current == '\r') current++ -#define skipnonblanks() \ - while (*current != '\t' && *current != '\n' && *current != ' ' && *current != '\r' && *current != '\0') current++ -#define skipmatrix() \ - while (*current != '\0' && *current != ']') current++ - -static void skippsstring(const char **current) { - int parencount = 0; - - do { - if (**current == '(') - parencount++; - else if (**current == ')') - parencount--; - else if (**current == '\0') - return; - - (*current)++; - } while (parencount > 0); -} - -static void FreeFontInfoArray(void) { - int i; - - for (i = 0; i < featurefilesize; i++) { - if (featurefiledata[i].value[0]) { -#if DOMEMCHECK - memck_free(featurefiledata[i].value); -#else - ACFREEMEM(featurefiledata[i].value); -#endif - } - } -#if DOMEMCHECK - memck_free(featurefiledata); -#else - ACFREEMEM(featurefiledata); -#endif -} -static int ParseFontInfo(const char *fontinfo) { - const char *kwstart, *kwend, *tkstart, *current; - int i; - - featurefilesize = 34; -#if DOMEMCHECK - featurefiledata = (FFEntry *)memck_malloc(featurefilesize * sizeof(FFEntry)); -#else - featurefiledata = (FFEntry *)ACNEWMEM(featurefilesize * sizeof(FFEntry)); -#endif - featurefiledata[0].key = "OrigEmSqUnits"; - featurefiledata[1].key = "FontName"; - featurefiledata[2].key = "FlexOK"; - /* Blue Values */ - featurefiledata[3].key = "BaselineOvershoot"; - featurefiledata[4].key = "BaselineYCoord"; - featurefiledata[5].key = "CapHeight"; - featurefiledata[6].key = "CapOvershoot"; - featurefiledata[7].key = "LcHeight"; - featurefiledata[8].key = "LcOvershoot"; - featurefiledata[9].key = "AscenderHeight"; - featurefiledata[10].key = "AscenderOvershoot"; - featurefiledata[11].key = "FigHeight"; - featurefiledata[12].key = "FigOvershoot"; - featurefiledata[13].key = "Height5"; - featurefiledata[14].key = "Height5Overshoot"; - featurefiledata[15].key = "Height6"; - featurefiledata[16].key = "Height6Overshoot"; - /* Other Values */ - featurefiledata[17].key = "Baseline5Overshoot"; - featurefiledata[18].key = "Baseline5"; - featurefiledata[19].key = "Baseline6Overshoot"; - featurefiledata[20].key = "Baseline6"; - featurefiledata[21].key = "SuperiorOvershoot"; - featurefiledata[22].key = "SuperiorBaseline"; - featurefiledata[23].key = "OrdinalOvershoot"; - featurefiledata[24].key = "OrdinalBaseline"; - featurefiledata[25].key = "DescenderOvershoot"; - featurefiledata[26].key = "DescenderHeight"; - - featurefiledata[27].key = "DominantV"; - featurefiledata[28].key = "StemSnapV"; - featurefiledata[29].key = "DominantH"; - featurefiledata[30].key = "StemSnapH"; - featurefiledata[31].key = "VCounterChars"; - featurefiledata[32].key = "HCounterChars"; - /* later addenda */ - featurefiledata[33].key = "BlueFuzz"; - - for (i = 0; i < featurefilesize; i++) { - featurefiledata[i].value = ""; - } - - if (!fontinfo) - return AC_Success; - - current = fontinfo; - while (*current) { - size_t kwLen; - skipblanks(); - kwstart = current; - skipnonblanks(); - kwend = current; - skipblanks(); - tkstart = current; - if (*tkstart == '(') { - skippsstring(¤t); - if (*tkstart) current++; - } else if (*tkstart == '[') { - skipmatrix(); - if (*tkstart) current++; - } else - skipnonblanks(); - - kwLen = (int)(kwend - kwstart); - for (i = 0; i < featurefilesize; i++) { - size_t matchLen = MAX(kwLen, strlen(featurefiledata[i].key)); - if (!strncmp(featurefiledata[i].key, kwstart, matchLen)) { -#if DOMEMCHECK - featurefiledata[i].value = (char *)memck_malloc(current - tkstart + 1); -#else - featurefiledata[i].value = (char *)ACNEWMEM(current - tkstart + 1); -#endif - if (!featurefiledata[i].value) - return AC_MemoryError; - strncpy(featurefiledata[i].value, tkstart, current - tkstart); - featurefiledata[i].value[current - tkstart] = '\0'; - break; - } - } - if (i == featurefilesize) { - char *temp; -#if DOMEMCHECK - temp = (char *)memck_malloc(tkstart - kwstart + 1); -#else - temp = (char *)ACNEWMEM(tkstart - kwstart + 1); -#endif - if (!temp) - return AC_MemoryError; - strncpy(temp, kwstart, tkstart - kwstart); - temp[tkstart - kwstart] = '\0'; - /*fprintf(stderr, "Ignoring fileinfo %s...\n", temp);*/ -#if DOMEMCHECK - memck_free(temp); -#else - ACFREEMEM(temp); -#endif - } - skipblanks(); - } - - return AC_Success; -} -#if __MWERKS__ -#pragma export on -#endif -ACLIB_API void AC_SetMemManager(void *ctxptr, AC_MEMMANAGEFUNCPTR func) { - setAC_memoryManager(ctxptr, func); -} - -ACLIB_API void AC_SetReportCB(AC_REPORTFUNCPTR reportCB, int verbose) { - if (verbose) - libReportCB = reportCB; - else - libReportCB = NULL; - - libErrorReportCB = reportCB; -} - -ACLIB_API void AC_SetReportStemsCB(AC_REPORTSTEMPTR hstemCB, AC_REPORTSTEMPTR vstemCB, unsigned int allStems) { - allstems = allStems; - addHStemCB = hstemCB; - addVStemCB = vstemCB; - doStems = 1; - - addCharExtremesCB = NULL; - addStemExtremesCB = NULL; - doAligns = 0; -} - -ACLIB_API void AC_SetReportZonesCB(AC_REPORTZONEPTR charCB, AC_REPORTZONEPTR stemCB) { - addCharExtremesCB = charCB; - addStemExtremesCB = stemCB; - doAligns = 1; - - addHStemCB = NULL; - addVStemCB = NULL; - doStems = 0; -} - -int cleanup(short code) { - closefiles(); - - if (code == FATALERROR || code == NONFATALERROR) - longjmp(aclibmark, -1); - else - longjmp(aclibmark, 1); - - return 0; /* we dont actually ever get here */ -} - -ACLIB_API int AutoColorString(const char *srcbezdata, const char *fontinfo, char *dstbezdata, int *length, int allowEdit, int allowHintSub, int roundCoords, int debug) { - int value, result; - char *names[] = {""}; - - if (!srcbezdata) - return AC_InvalidParameterError; - - if (ParseFontInfo(fontinfo)) - return AC_FontinfoParseFail; - - set_errorproc(cleanup); - value = setjmp(aclibmark); - - if (value == -1) { - /* a fatal error occurred soemwhere. */ - FreeFontInfoArray(); - return AC_FatalError; - - } else if (value == 1) { - /* AutoColor was called succesfully */ - FreeFontInfoArray(); - if (bezoutputactual < *length) { - strncpy(dstbezdata, bezoutput, bezoutputactual + 1); - *length = bezoutputactual + 1; -#if DOMEMCHECK - memck_free(bezoutput); -#else - ACFREEMEM(bezoutput); -#endif - bezoutputalloc = 0; - return AC_Success; - } else { - *length = bezoutputactual + 1; -#if DOMEMCHECK - memck_free(bezoutput); -#else - ACFREEMEM(bezoutput); -#endif - bezoutputalloc = 0; - return AC_DestBuffOfloError; - } - } - - bezstring = srcbezdata; - - bezoutputalloc = *length; - bezoutputactual = 0; -#if DOMEMCHECK - bezoutput = (char *)memck_malloc(bezoutputalloc); -#else - bezoutput = (char *)ACNEWMEM(bezoutputalloc); -#endif - if (!bezoutput) { - FreeFontInfoArray(); - return AC_MemoryError; - } - *bezoutput = 0; - - result = AutoColor( - FALSE, /* whether any new coloring should cause error */ - FALSE, /*fixStems*/ - (boolean)debug, /*debug*/ - allowHintSub, /* extracolor*/ - allowEdit, /*editChars*/ - 1, - names, - FALSE, /*quiet*/ - FALSE, /* doAll*/ - roundCoords, /* doAll*/ - FALSE); /* do log */ - /* result == TRUE is good */ - /* The following call to cleanup() always returns control to just after the setjmp() function call above, - but with value set to 1 if success, or -1 if not */ - cleanup((result == TRUE) ? OK : NONFATALERROR); - - return AC_UnknownError; /*Shouldn't get here*/ -} - -ACLIB_API void AC_initCallGlobals(void) { - libReportCB = NULL; - libErrorReportCB = NULL; - addCharExtremesCB = NULL; - addStemExtremesCB = NULL; - doAligns = 0; - addHStemCB = NULL; - addVStemCB = NULL; - doStems = 0; -} - -ACLIB_API const char *AC_getVersion(void) { - return libversion; -} - -#if __MWERKS__ -#pragma export off -#endif diff --git a/c/autohint/autohintlib/source/ac/acfixed.c b/c/autohint/autohintlib/source/ac/acfixed.c deleted file mode 100644 index 29f025666..000000000 --- a/c/autohint/autohintlib/source/ac/acfixed.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* fixed.c */ - -#include "ac.h" - -#define fixedScale ((real)(FixOne)) - -public -procedure acfixtopflt(x, pf) - Fixed x; -float *pf; -{ - *pf = (float)x / fixedScale; -} - -public -Fixed acpflttofix(pf) float *pf; -{ - float f = *pf; - if (f >= FixedPosInf / fixedScale) return FixedPosInf; - if (f <= FixedNegInf / fixedScale) return FixedNegInf; - return (Fixed)(f * fixedScale); -} diff --git a/c/autohint/autohintlib/source/ac/atan.c b/c/autohint/autohintlib/source/ac/atan.c deleted file mode 100644 index 665451a65..000000000 --- a/c/autohint/autohintlib/source/ac/atan.c +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* - atan.c - -Original version: -Edit History: -Ed Taft: Sat Apr 30 14:54:30 1988 -Ivor Durham: Thu Aug 25 14:20:03 1988 -Bill Paxton: Mon Jan 30 14:23:13 1989 -End Edit History. -*/ - -/* - floating-point arctangent - - os_atan returns the value of the arctangent of its - argument in the range [-pi/2,pi/2]. - - os_atan2 returns the arctangent of arg1/arg2 - in the range [-pi,pi]. - - there are no error returns. - - coefficients are #5077 from Hart & Cheney. (19.56D) -*/ - -static double sq2p1 = 2.414213562373095048802e0; -static double sq2m1 = .414213562373095048802e0; -static double pio2 = 1.570796326794896619231e0; -static double pio4 = .785398163397448309615e0; -static double p4 = .161536412982230228262e2; -static double p3 = .26842548195503973794141e3; -static double p2 = .11530293515404850115428136e4; -static double p1 = .178040631643319697105464587e4; -static double p0 = .89678597403663861959987488e3; -static double q4 = .5895697050844462222791e2; -static double q3 = .536265374031215315104235e3; -static double q2 = .16667838148816337184521798e4; -static double q1 = .207933497444540981287275926e4; -static double q0 = .89678597403663861962481162e3; - -/* - xatan evaluates a series valid in the - range [-0.414...,+0.414...]. -*/ -static double - xatan(arg) double arg; -{ - double argsq; - double value; - - argsq = arg * arg; - value = ((((p4 * argsq + p3) * argsq + p2) * argsq + p1) * argsq + p0); - value = value / (((((argsq + q4) * argsq + q3) * argsq + q2) * argsq + q1) * argsq + q0); - return (value * arg); -} - -/* - satan reduces its argument (known to be positive) - to the range [0,0.414...] and calls xatan. -*/ - -static double - satan(arg) double arg; -{ - if (arg < sq2m1) - return (xatan(arg)); - else if (arg > sq2p1) - return (pio2 - xatan(1.0 / arg)); - else - return (pio4 + xatan((arg - 1.0) / (arg + 1.0))); -} - -#if false /* not needed */ -/* - os_atan makes its argument positive and - calls the inner routine satan. -*/ - -double - os_atan(arg) double arg; -{ - if (arg > 0) - return (satan(arg)); - else - return (-satan(-arg)); -} -#endif /*false*/ - -/* - os_atan2 discovers what quadrant the angle - is in and calls os_atan. -*/ - -#if defined(__MWERKS__) && (!IS_MACHO) -double -atan2(double arg1, double arg2) { - if ((arg1 + arg2) == arg1) - if (arg1 >= 0.) - return (pio2); - else - return (-pio2); - else if (arg2 < 0.) - if (arg1 >= 0.) - return (pio2 + pio2 - satan(-arg1 / arg2)); - else - return (-pio2 - pio2 + satan(arg1 / arg2)); - else if (arg1 > 0) - return (satan(arg1 / arg2)); - else - return (-satan(-arg1 / arg2)); -} -#endif /*false*/ diff --git a/c/autohint/autohintlib/source/ac/auto.c b/c/autohint/autohintlib/source/ac/auto.c deleted file mode 100644 index 9ba3c3f2a..000000000 --- a/c/autohint/autohintlib/source/ac/auto.c +++ /dev/null @@ -1,1165 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* auto.c */ - -#include "ac.h" -#include "machinedep.h" - -private -boolean clrBBox, clrHBounds, clrVBounds, haveHBnds, haveVBnds, - mergeMain; - -public -procedure InitAuto(reason) integer reason; -{ - switch (reason) { - case STARTUP: - case RESTART: - clrBBox = clrHBounds = clrVBounds = haveHBnds = haveVBnds = FALSE; - } -} - -private -PPathElt GetSubPathNxt(e) PPathElt e; -{ - if (e->type == CLOSEPATH) return GetDest(e); - return e->next; -} - -private -PPathElt GetSubPathPrv(e) PPathElt e; -{ - if (e->type == MOVETO) e = GetClosedBy(e); - return e->prev; -} - -private -PClrVal FindClosestVal(sLst, loc) PClrVal sLst; -Fixed loc; -{ - Fixed dist = FixInt(10000), bot, top, d; - PClrVal best = NULL; - while (sLst != NULL) { - bot = sLst->vLoc1; - top = sLst->vLoc2; - if (bot > top) { - Fixed tmp = bot; - bot = top; - top = tmp; - } - if (loc >= bot && loc <= top) { - best = sLst; - break; - } - if (loc < bot) - d = bot - loc; - else - d = loc - top; - if (d < dist) { - dist = d; - best = sLst; - } - sLst = sLst->vNxt; - } - return best; -} - -private -procedure CpyHClr(e) PPathElt e; -{ - Fixed x1, y1; - PClrVal best; - GetEndPoint(e, &x1, &y1); - best = FindClosestVal(Hprimary, y1); - if (best != NULL) - AddHPair(best, 'b'); -} - -private -procedure CpyVClr(e) PPathElt e; -{ - Fixed x1, y1; - PClrVal best; - GetEndPoint(e, &x1, &y1); - best = FindClosestVal(Vprimary, x1); - if (best != NULL) - AddVPair(best, 'y'); -} - -private -procedure PruneColorSegs(e, hFlg) PPathElt e; -boolean hFlg; -{ - PSegLnkLst lst, nxt, prv; - PSegLnk lnk; - PClrSeg seg; - PClrVal val; - lst = hFlg ? e->Hs : e->Vs; - prv = NULL; - while (lst != NULL) { - val = NULL; - lnk = lst->lnk; - if (lnk != NULL) { - seg = lnk->seg; - if (seg != NULL) val = seg->sLnk; - } - nxt = lst->next; - if (val == NULL) { /* prune this one */ - if (prv == NULL) { - if (hFlg) - e->Hs = nxt; - else - e->Vs = nxt; - } else - prv->next = nxt; - lst = nxt; - } else { - prv = lst; - lst = nxt; - } - } -} - -public -procedure PruneElementColorSegs() { - register PPathElt e; - e = pathStart; - while (e != NULL) { - PruneColorSegs(e, TRUE); - PruneColorSegs(e, FALSE); - e = e->next; - } -} - -#define ElmntClrSegLst(e, hFlg) (hFlg) ? (e)->Hs : (e)->Vs - -private -procedure RemLnk(e, hFlg, rm) - PPathElt e; -boolean hFlg; -PSegLnkLst rm; -{ - PSegLnkLst lst, prv, nxt; - lst = hFlg ? e->Hs : e->Vs; - prv = NULL; - while (lst != NULL) { - nxt = lst->next; - if (lst == rm) { - if (prv == NULL) { - if (hFlg) - e->Hs = nxt; - else - e->Vs = nxt; - } else - prv->next = nxt; - return; - } - prv = lst; - lst = nxt; - } - FlushLogFiles(); - sprintf(globmsg, "Badly formatted segment list in file: %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); -} - -private -boolean AlreadyOnList(v, lst) register PClrVal v, lst; -{ - while (lst != NULL) { - if (v == lst) return TRUE; - lst = lst->vNxt; - } - return FALSE; -} - -private -procedure AutoVSeg(sLst) PClrVal sLst; -{ - AddVPair(sLst, 'y'); -} - -private -procedure AutoHSeg(sLst) PClrVal sLst; -{ - AddHPair(sLst, 'b'); -} - -private -procedure AddHColoring(h) PClrVal h; -{ - if (useH || AlreadyOnList(h, Hcoloring)) return; - h->vNxt = Hcoloring; - Hcoloring = h; - AutoHSeg(h); -} - -private -procedure AddVColoring(v) PClrVal v; -{ - if (useV || AlreadyOnList(v, Vcoloring)) return; - v->vNxt = Vcoloring; - Vcoloring = v; - AutoVSeg(v); -} - -private -integer TestColor(s, colorList, flg, doLst) - PClrSeg s; -PClrVal colorList; -boolean flg, doLst; -{ - /* -1 means already in colorList; 0 means conflicts; 1 means ok to add */ - PClrVal v, clst; - Fixed top, bot, cTop, cBot, vT, vB, loc, abstmp; - boolean loc1; - if (s == NULL) return -1L; - v = s->sLnk; - loc = s->sLoc; - if (v == NULL) return -1L; - vT = top = v->vLoc2; - vB = bot = v->vLoc1; - if (v->vGhst) { /* collapse width for conflict test */ - if (v->vSeg1->sType == sGHOST) - bot = top; - else - top = bot; - } - if (DEBUG) { - integer cnt = 0; - clst = colorList; - while (clst != NULL) { - if (++cnt > 100) { - LogMsg("Loop in hintlist for TestHint\n\007", WARNING, OK, TRUE); - return 0L; - } - clst = clst->vNxt; - } - } - if (v->vGhst) { - /* if best value for segment uses a ghost, and - segment loc is already in the colorList, then return -1 */ - clst = colorList; - if (ac_abs(loc - vT) < ac_abs(loc - vB)) { - loc1 = FALSE; - loc = vT; - } else { - loc1 = TRUE; - loc = vB; - } - while (clst != NULL) { - if ((loc1 ? clst->vLoc1 : clst->vLoc2) == loc) - return -1; - clst = clst->vNxt; - if (!doLst) break; - } - } - if (flg) { - top += bandMargin; - bot -= bandMargin; - } else { - top -= bandMargin; - bot += bandMargin; - } - while (colorList != NULL) { /* check for conflict */ - cTop = colorList->vLoc2; - cBot = colorList->vLoc1; - if (vB == cBot && vT == cTop) { - return -1L; - } - if (colorList->vGhst) { /* collapse width for conflict test */ - if (colorList->vSeg1->sType == sGHOST) - cBot = cTop; - else - cTop = cBot; - } - if ((flg && (cBot <= top) && (cTop >= bot)) || - (!flg && (cBot >= top) && (cTop <= bot))) { - return 0L; - } - colorList = colorList->vNxt; - if (!doLst) break; - } - return 1L; -} - -#define TestHColorLst(h) TestColorLst(h, Hcoloring, YgoesUp, TRUE) -#define TestVColorLst(v) TestColorLst(v, Vcoloring, TRUE, TRUE) - -public -int TestColorLst(lst, colorList, flg, doLst) - PSegLnkLst lst; -PClrVal colorList; -boolean flg, doLst; -{ - /* -1 means already in colorList; 0 means conflicts; 1 means ok to add */ - int result, i, cnt; - result = -1; - cnt = 0; - while (lst != NULL) { - i = TestColor(lst->lnk->seg, colorList, flg, doLst); - if (i == 0) { - result = 0; - break; - } - if (i == 1) result = 1L; - lst = lst->next; - if (++cnt > 100) { - LogMsg("Looping in TestHintLst\007\n", WARNING, OK, TRUE); - return 0L; - } - } - return result; -} - -#define FixedMidPoint(m, a, b) \ - (m).x = ((a).x + (b).x) >> 1; \ - (m).y = ((a).y + (b).y) >> 1 - -#define FixedBezDiv(a0, a1, a2, a3, b0, b1, b2, b3) \ - FixedMidPoint(b2, a2, a3); \ - FixedMidPoint(a3, a1, a2); \ - FixedMidPoint(a1, a0, a1); \ - FixedMidPoint(a2, a1, a3); \ - FixedMidPoint(b1, a3, b2); \ - FixedMidPoint(a3, a2, b1); - -public -boolean ResolveConflictBySplit(e, Hflg, lnk1, lnk2) register PPathElt e; -boolean Hflg; -PSegLnkLst lnk1, lnk2; -{ - /* insert new pathelt immediately following e */ - /* e gets first half of split; new gets second */ - /* e gets lnk1 in Hs or Vs; new gets lnk2 */ - register PPathElt new; - Cd d0, d1, d2, d3, d4, d5, d6, d7; - if (e->type != CURVETO || e->isFlex) return FALSE; - ReportSplit(e); - new = (PPathElt)Alloc(sizeof(PathElt)); - new->next = e->next; - e->next = new; - new->prev = e; - if (new->next == NULL) - pathEnd = new; - else - new->next->prev = new; - if (Hflg) { - e->Hs = lnk1; - new->Hs = lnk2; - } else { - e->Vs = lnk1; - new->Vs = lnk2; - } - if (lnk1 != NULL) lnk1->next = NULL; - if (lnk2 != NULL) lnk2->next = NULL; - new->type = CURVETO; - GetEndPoint(e->prev, &d0.x, &d0.y); - d1.x = e->x1; - d1.y = e->y1; - d2.x = e->x2; - d2.y = e->y2; - d3.x = e->x3; - d3.y = e->y3; - d4 = d0; - d5 = d1; - d6 = d2; - d7 = d3; - new->x3 = d3.x; - new->y3 = d3.y; - FixedBezDiv(d4, d5, d6, d7, d0, d1, d2, d3); - e->x1 = d5.x; - e->y1 = d5.y; - e->x2 = d6.x; - e->y2 = d6.y; - e->x3 = d7.x; - e->y3 = d7.y; - new->x1 = d1.x; - new->y1 = d1.y; - new->x2 = d2.x; - new->y2 = d2.y; - return TRUE; -} - -private -procedure RemDupLnks(e, Hflg) PPathElt e; -boolean Hflg; -{ - PSegLnkLst l1, l2, l2nxt; - l1 = Hflg ? e->Hs : e->Vs; - while (l1 != NULL) { - l2 = l1->next; - while (l2 != NULL) { - l2nxt = l2->next; - if (l1->lnk->seg == l2->lnk->seg) - RemLnk(e, Hflg, l2); - l2 = l2nxt; - } - l1 = l1->next; - } -} - -#define OkToRemLnk(loc, Hflg, spc) \ - (!(Hflg) || (spc) == 0 || \ - (!InBlueBand((loc), lenTopBands, topBands) && \ - !InBlueBand((loc), lenBotBands, botBands))) - -/* The changes made here were to fix a problem in MinisterLight/E. - The top left point was not getting colored. */ -private -boolean TryResolveConflict(e, Hflg) - PPathElt e; -boolean Hflg; -{ - integer typ; - PSegLnkLst lst, lnk1, lnk2; - PClrSeg seg, seg1, seg2; - PClrVal val1, val2; - Fixed lc1, lc2, loc0, loc1, loc2, loc3, x0, y0, x1, y1, abstmp; - RemDupLnks(e, Hflg); - typ = e->type; - if (typ == MOVETO) - GetEndPoints(GetClosedBy(e), &x0, &y0, &x1, &y1); - else if (typ == CURVETO) { - x0 = e->x1; - y0 = e->y1; - x1 = e->x3; - y1 = e->y3; - } else - GetEndPoints(e, &x0, &y0, &x1, &y1); - loc1 = Hflg ? y0 : x0; - loc2 = Hflg ? y1 : x1; - lst = Hflg ? e->Hs : e->Vs; - seg1 = lst->lnk->seg; - lc1 = seg1->sLoc; - lnk1 = lst; - lst = lst->next; - seg2 = lst->lnk->seg; - lc2 = seg2->sLoc; - lnk2 = lst; - if (lc1 == loc1 || lc2 == loc2) { - } else if (ac_abs(lc1 - loc1) > ac_abs(lc1 - loc2) || - ac_abs(lc2 - loc2) > ac_abs(lc2 - loc1)) { - seg = seg1; - seg1 = seg2; - seg2 = seg; - lst = lnk1; - lnk1 = lnk2; - lnk2 = lst; - } - val1 = seg1->sLnk; - val2 = seg2->sLnk; - if (val1->vVal < FixInt(50) && OkToRemLnk(loc1, Hflg, val1->vSpc)) { - RemLnk(e, Hflg, lnk1); - if (showClrInfo) ReportRemConflict(e); - return TRUE; - } - if (val2->vVal < FixInt(50) && val1->vVal > val2->vVal * 20L && - OkToRemLnk(loc2, Hflg, val2->vSpc)) { - RemLnk(e, Hflg, lnk2); - if (showClrInfo) ReportRemConflict(e); - return TRUE; - } - if (typ != CURVETO || - ((((Hflg && IsHorizontal(x0, y0, x1, y1)) || - (!Hflg && IsVertical(x0, y0, x1, y1)))) && - OkToRemLnk(loc1, Hflg, val1->vSpc))) { - RemLnk(e, Hflg, lnk1); - if (showClrInfo) ReportRemConflict(e); - return TRUE; - } - GetEndPoints(GetSubPathPrv(e), &x0, &y0, &x1, &y1); - loc0 = Hflg ? y0 : x0; - if (ProdLt0(loc2 - loc1, loc0 - loc1)) { - RemLnk(e, Hflg, lnk1); - if (showClrInfo) ReportRemConflict(e); - return TRUE; - } - GetEndPoint(GetSubPathNxt(e), &x1, &y1); - loc3 = Hflg ? y1 : x1; - if (ProdLt0(loc3 - loc2, loc1 - loc2)) { - RemLnk(e, Hflg, lnk2); - if (showClrInfo) ReportRemConflict(e); - return TRUE; - } - if ((loc2 == val2->vLoc1 || loc2 == val2->vLoc2) && - loc1 != val1->vLoc1 && loc1 != val1->vLoc2) { - RemLnk(e, Hflg, lnk1); - if (showClrInfo) ReportRemConflict(e); - return TRUE; - } - if ((loc1 == val1->vLoc1 || loc1 == val1->vLoc2) && - loc2 != val2->vLoc1 && loc2 != val2->vLoc2) { - RemLnk(e, Hflg, lnk2); - if (showClrInfo) ReportRemConflict(e); - return TRUE; - } - if (editChar && ResolveConflictBySplit(e, Hflg, lnk1, lnk2)) - return TRUE; - else - return FALSE; -} - -private -boolean CheckColorSegs(PPathElt e, boolean flg, boolean Hflg) { - PSegLnkLst lst; - PSegLnkLst lst2; - PClrSeg seg; - PClrVal val; - lst = Hflg ? e->Hs : e->Vs; - while (lst != NULL) { - lst2 = lst->next; - if (lst2 != NULL) { - seg = lst->lnk->seg; - val = seg->sLnk; - if (val != NULL && TestColorLst(lst2, val, flg, FALSE) == 0) { - if (TryResolveConflict(e, Hflg)) - return CheckColorSegs(e, flg, Hflg); - AskForSplit(e); - if (Hflg) - e->Hs = NULL; - else - e->Vs = NULL; - return TRUE; - } - } - lst = lst2; - } - return FALSE; -} - -private -procedure CheckElmntClrSegs() { - PPathElt e; - e = pathStart; - while (e != NULL) { - if (!CheckColorSegs(e, YgoesUp, TRUE)) - (void)CheckColorSegs(e, TRUE, FALSE); - e = e->next; - } -} -private -boolean ClrLstsClash(lst1, lst2, flg) - PSegLnkLst lst1, - lst2; -boolean flg; -{ - PClrSeg seg; - PClrVal val; - PSegLnkLst lst; - while (lst1 != NULL) { - seg = lst1->lnk->seg; - val = seg->sLnk; - if (val != NULL) { - lst = lst2; - while (lst != NULL) { - if (TestColorLst(lst, val, flg, FALSE) == 0) { - return TRUE; - } - lst = lst->next; - } - } - lst1 = lst1->next; - } - return FALSE; -} - -private -PSegLnkLst BestFromLsts(lst1, lst2) PSegLnkLst lst1, lst2; -{ - PSegLnkLst lst, bst; - PClrSeg seg; - PClrVal val; - Fixed bstval; - integer i; - bst = NULL; - bstval = 0; - for (i = 0; i < 2; i++) { - lst = i ? lst1 : lst2; - while (lst != NULL) { - seg = lst->lnk->seg; - val = seg->sLnk; - if (val != NULL && val->vVal > bstval) { - bst = lst; - bstval = val->vVal; - } - lst = lst->next; - } - } - return bst; -} - -private -boolean ClrsClash(e, p, hLst, vLst, phLst, pvLst) - PPathElt e, - p; -PSegLnkLst *hLst, *vLst, *phLst, *pvLst; -{ - boolean clash = FALSE; - PSegLnkLst bst, new; - if (ClrLstsClash(*hLst, *phLst, YgoesUp)) { - clash = TRUE; - bst = BestFromLsts(*hLst, *phLst); - if (bst) { - new = (PSegLnkLst)Alloc(sizeof(SegLnkLst)); - new->next = NULL; - new->lnk = bst->lnk; - } else - new = NULL; - e->Hs = p->Hs = *hLst = *phLst = new; - } - if (ClrLstsClash(*vLst, *pvLst, TRUE)) { - clash = TRUE; - bst = BestFromLsts(*vLst, *pvLst); - if (bst) { - new = (PSegLnkLst)Alloc(sizeof(SegLnkLst)); - new->next = NULL; - new->lnk = bst->lnk; - } else - new = NULL; - e->Vs = p->Vs = *vLst = *pvLst = new; - } - return clash; -} - -private -procedure GetColorLsts(e, phLst, pvLst, ph, pv) - PPathElt e; -PSegLnkLst *phLst, *pvLst; -integer *ph, *pv; -{ - PSegLnkLst hLst, vLst; - integer h, v; - if (useH) { - hLst = NULL; - h = -1; - } else { - hLst = e->Hs; - if (hLst == NULL) - h = -1; - else - h = TestHColorLst(hLst); - } - if (useV) { - vLst = NULL; - v = -1; - } else { - vLst = e->Vs; - if (vLst == NULL) - v = -1; - else - v = TestVColorLst(vLst); - } - *pvLst = vLst; - *phLst = hLst; - *ph = h; - *pv = v; -} - -private -procedure ReClrBounds(e) PPathElt e; -{ - if (!useH) { - if (clrHBounds && Hcoloring == NULL && !haveHBnds) - ReClrHBnds(); - else if (!clrBBox) { - if (Hcoloring == NULL) CpyHClr(e); - if (mergeMain) MergeFromMainColors('b'); - } - } - if (!useV) { - if (clrVBounds && Vcoloring == NULL && !haveVBnds) - ReClrVBnds(); - else if (!clrBBox) { - if (Vcoloring == NULL) CpyVClr(e); - if (mergeMain) MergeFromMainColors('y'); - } - } -} - -private -procedure AddColorLst(lst, vert) PSegLnkLst lst; -boolean vert; -{ - PClrVal val; - PClrSeg seg; - while (lst != NULL) { - seg = lst->lnk->seg; - val = seg->sLnk; - if (vert) - AddVColoring(val); - else - AddHColoring(val); - lst = lst->next; - } -} - -private -procedure StartNewColoring(e, hLst, vLst) - PPathElt e; -PSegLnkLst hLst, vLst; -{ - ReClrBounds(e); - if (e->newcolors != 0) { - FlushLogFiles(); - sprintf(globmsg, "Uninitialized extra hints list in file: %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - XtraClrs(e); - clrBBox = FALSE; - if (useV) CopyMainV(); - if (useH) CopyMainH(); - Hcoloring = Vcoloring = NULL; - if (!useH) AddColorLst(hLst, FALSE); - if (!useV) AddColorLst(vLst, TRUE); -} - -private -boolean IsIn(h, v) integer h, v; -{ - return (h == -1 && v == -1); -} - -private -boolean IsOk(h, v) integer h, v; -{ - return (h != 0 && v != 0); -} - -#define AddIfNeedV(v, vLst) \ - if (!useV && v == 1) AddColorLst(vLst, TRUE) -#define AddIfNeedH(h, hLst) \ - if (!useH && h == 1) AddColorLst(hLst, FALSE) - -private -procedure SetHColors(lst) PClrVal lst; -{ - if (useH) return; - Hcoloring = lst; - while (lst != NULL) { - AutoHSeg(lst); - lst = lst->vNxt; - } -} - -private -procedure SetVColors(lst) PClrVal lst; -{ - if (useV) return; - Vcoloring = lst; - while (lst != NULL) { - AutoVSeg(lst); - lst = lst->vNxt; - } -} - -public -PClrVal CopyClrs(lst) PClrVal lst; -{ - PClrVal v, vlst; - int cnt; - vlst = NULL; - cnt = 0; - while (lst != NULL) { - v = (PClrVal)Alloc(sizeof(ClrVal)); - *v = *lst; - v->vNxt = vlst; - vlst = v; - if (++cnt > 100) { - LogMsg("Loop in CopyClrs\007\n", WARNING, OK, TRUE); - return vlst; - } - lst = lst->vNxt; - } - return vlst; -} - -private -PPathElt ColorBBox(e) PPathElt e; -{ - e = FindSubpathBBox(e); - ClrBBox(); - clrBBox = TRUE; - return e; -} - -private -boolean IsFlare(loc, e, n, Hflg) Fixed loc; -PPathElt e, n; -boolean Hflg; -{ - Fixed x, y, abstmp; - while (e != n) { - GetEndPoint(e, &x, &y); - if ((Hflg && ac_abs(y - loc) > maxFlare) || (!Hflg && ac_abs(x - loc) > maxFlare)) - return FALSE; - e = GetSubPathNxt(e); - } - return TRUE; -} - -private -boolean IsTopSegOfVal(loc, top, bot) Fixed loc, top, bot; -{ - Fixed d1, d2, abstmp; - d1 = top - loc; - d2 = bot - loc; - return (ac_abs(d1) <= ac_abs(d2)) ? TRUE : FALSE; -} - -private -procedure RemFlareLnk(e, hFlg, rm, e2, i) - PPathElt e, - e2; -boolean hFlg; -PSegLnkLst rm; -integer i; -{ - RemLnk(e, hFlg, rm); - if (showClrInfo) ReportRemFlare(e, e2, hFlg, i); -} - -public -boolean CompareValues(val1, val2, factor, ghstshift) register PClrVal val1, val2; -integer factor, ghstshift; -{ - register Fixed v1 = val1->vVal, v2 = val2->vVal, mx; - mx = v1 > v2 ? v1 : v2; - mx <<= 1; - while (mx > 0) { - mx <<= 1; - v1 <<= 1; - v2 <<= 1; - } - if (ghstshift > 0 && val1->vGhst != val2->vGhst) { - if (val1->vGhst) v1 >>= ghstshift; - if (val2->vGhst) v2 >>= ghstshift; - } - if ((val1->vSpc > 0 && val2->vSpc > 0) || - (val1->vSpc == 0 && val2->vSpc == 0)) - return v1 > v2; - if (val1->vSpc > 0L) - return (v1 < FixedPosInf / factor) ? (v1 * factor > v2) : (v1 > v2 / factor); - return (v2 < FixedPosInf / factor) ? (v1 > v2 * factor) : (v1 / factor > v2); -} - -private -procedure RemFlares(Hflg) boolean Hflg; -{ - PSegLnkLst lst1, lst2, nxt1, nxt2; - PPathElt e, n; - PClrSeg seg1, seg2; - PClrVal val1, val2; - Fixed diff, abstmp; - boolean nxtE; - boolean Nm1, Nm2; - if (Hflg) { - Nm1 = TRUE; - Nm2 = FALSE; - } else { - Nm1 = FALSE; - Nm2 = TRUE; - } - e = pathStart; - while (e != NULL) { - if (Nm1 ? e->Hs == NULL : e->Vs == NULL) { - e = e->next; - continue; - } - /* e now is an element with Nm1 prop */ - n = GetSubPathNxt(e); - nxtE = FALSE; - while (n != e && !nxtE) { - if (Nm1 ? n->Hs != NULL : n->Vs != NULL) { - lst1 = ElmntClrSegLst(e, Nm1); - while (lst1 != NULL) { - seg1 = lst1->lnk->seg; - nxt1 = lst1->next; - lst2 = ElmntClrSegLst(n, Nm1); - while (lst2 != NULL) { - seg2 = lst2->lnk->seg; - nxt2 = lst2->next; - if (seg1 != NULL && seg2 != NULL) { - diff = seg1->sLoc - seg2->sLoc; - if (ac_abs(diff) > maxFlare) { - nxtE = TRUE; - goto Nxt2; - } - if (!IsFlare(seg1->sLoc, e, n, Hflg)) { - nxtE = TRUE; - goto Nxt2; - } - val1 = seg1->sLnk; - val2 = seg2->sLnk; - if (diff != 0 && - IsTopSegOfVal(seg1->sLoc, val1->vLoc2, val1->vLoc1) == - IsTopSegOfVal(seg2->sLoc, val2->vLoc2, val2->vLoc1)) { - if (CompareValues(val1, val2, spcBonus, 0L)) { - /* This change was made to fix flares in Bodoni2. */ - if (val2->vSpc == 0 && val2->vVal < FixInt(1000)) - RemFlareLnk(n, Nm1, lst2, e, 1); - } else if (val1->vSpc == 0 && val1->vVal < FixInt(1000)) { - RemFlareLnk(e, Nm1, lst1, n, 2); - goto Nxt1; - } - } - } - Nxt2: - lst2 = nxt2; - } - Nxt1: - lst1 = nxt1; - } - } - if (Nm2 ? n->Hs != NULL : n->Vs != NULL) break; - n = GetSubPathNxt(n); - } - e = e->next; - } -} - -private -procedure CarryIfNeed(loc, vert, clrs) - PClrVal clrs; -Fixed loc; -boolean vert; -{ - PClrSeg seg; - PClrVal seglnk; - Fixed l0, l1, tmp, halfMargin; - if ((vert && useV) || (!vert && useH)) return; - halfMargin = FixHalfMul(bandMargin); - /* DEBUG 8 BIT. Needed to double test from 10 to 20 for change in coordinate system */ - if (halfMargin > FixInt(20)) halfMargin = FixInt(20); - while (clrs != NULL) { - seg = clrs->vSeg1; - if (clrs->vGhst && seg->sType == sGHOST) seg = clrs->vSeg2; - if (seg == NULL) goto Nxt; - l0 = clrs->vLoc2; - l1 = clrs->vLoc1; - if (l0 > l1) { - tmp = l1; - l1 = l0; - l0 = tmp; - } - l0 -= halfMargin; - l1 += halfMargin; - if (loc > l0 && loc < l1) { - seglnk = seg->sLnk; - seg->sLnk = clrs; - if (vert) { - if (TestColor(seg, Vcoloring, TRUE, TRUE) == 1) { - if (showClrInfo) - ReportCarry(l0, l1, loc, clrs, vert); - AddVColoring(clrs); - seg->sLnk = seglnk; - break; - } - } else if (TestColor(seg, Hcoloring, YgoesUp, TRUE) == 1) { - if (showClrInfo) - ReportCarry(l0, l1, loc, clrs, vert); - AddHColoring(clrs); - seg->sLnk = seglnk; - break; - } - seg->sLnk = seglnk; - } - Nxt: - clrs = clrs->vNxt; - } -} - -#define PRODIST (FixInt(100)) /* DEBUG 8 BIT. Needed to double test from 50 to 100 for change in coordinate system */ -private -procedure ProClrs(e, hFlg, loc) - PPathElt e; -Fixed loc; -boolean hFlg; -{ - PSegLnkLst lst, plst; - PPathElt prv; - Fixed cx, cy, dst, abstmp; - lst = ElmntClrSegLst(e, hFlg); - if (lst == NULL) return; - if (hFlg ? e->Hcopy : e->Vcopy) return; - prv = e; - while (TRUE) { - prv = GetSubPathPrv(prv); - plst = ElmntClrSegLst(prv, hFlg); - if (plst != NULL) return; - GetEndPoint(prv, &cx, &cy); - dst = (hFlg ? cy : cx) - loc; - if (ac_abs(dst) > PRODIST) return; - if (hFlg) { - prv->Hs = lst; - prv->Hcopy = TRUE; - } else { - prv->Vs = lst; - prv->Vcopy = TRUE; - } - } -} - -private -procedure PromoteColors() { - PPathElt e; - Fixed cx, cy; - e = pathStart; - while (e != NULL) { - GetEndPoint(e, &cx, &cy); - ProClrs(e, TRUE, cy); - ProClrs(e, FALSE, cx); - e = e->next; - } -} - -private -procedure RemPromotedClrs() { - PPathElt e; - e = pathStart; - while (e != NULL) { - if (e->Hcopy) { - e->Hs = NULL; - e->Hcopy = FALSE; - } - if (e->Vcopy) { - e->Vs = NULL; - e->Vcopy = FALSE; - } - e = e->next; - } -} - -private -procedure RemShortColors() { - /* Must not change colors at a short element. */ - PPathElt e; - Fixed cx, cy, ex, ey, abstmp; - e = pathStart; - cx = 0; - cy = 0; - while (e != NULL) { - GetEndPoint(e, &ex, &ey); - if (ac_abs(cx - ex) < minColorElementLength && - ac_abs(cy - ey) < minColorElementLength) { - if (showClrInfo) ReportRemShortColors(ex, ey); - e->Hs = NULL; - e->Vs = NULL; - } - e = e->next; - cx = ex; - cy = ey; - } -} - -public -procedure AutoExtraColors(movetoNewClrs, soleol, solWhere) - boolean movetoNewClrs, - soleol; -integer solWhere; -{ - integer h, v, ph, pv; - PPathElt e, cp, p; - integer etype; - PSegLnkLst hLst, vLst, phLst, pvLst; - PClrVal mtVclrs, mtHclrs, prvHclrs, prvVclrs; - - boolean (*Tst)(), newClrs = TRUE; - boolean isSpc; - Fixed x, y; - - isSpc = clrBBox = clrVBounds = clrHBounds = FALSE; - mergeMain = (CountSubPaths() <= 5); - e = pathStart; - if (AutoExtraDEBUG) PrintMessage("RemFlares"); - RemFlares(TRUE); - RemFlares(FALSE); - if (AutoExtraDEBUG) PrintMessage("CheckElmntClrSegs"); - CheckElmntClrSegs(); - if (AutoExtraDEBUG) PrintMessage("PromoteColors"); - PromoteColors(); - if (AutoExtraDEBUG) PrintMessage("RemShortColors"); - RemShortColors(); - haveVBnds = clrVBounds; - haveHBnds = clrHBounds; - p = NULL; - Tst = IsOk; /* it is ok to add to primary coloring */ - if (AutoExtraDEBUG) PrintMessage("color loop"); - mtVclrs = mtHclrs = NULL; - while (e != NULL) { - etype = e->type; - if (movetoNewClrs && etype == MOVETO) { - StartNewColoring(e, (PSegLnkLst)NULL, (PSegLnkLst)NULL); - Tst = IsOk; - } - if (soleol && etype == MOVETO) { /* start new coloring on soleol mt */ - if ((solWhere == 1 && IsUpper(e)) || - (solWhere == -1 && IsLower(e)) || - (solWhere == 0)) { /* color bbox of next subpath */ - StartNewColoring(e, (PSegLnkLst)NULL, (PSegLnkLst)NULL); - Tst = IsOk; - haveHBnds = haveVBnds = isSpc = TRUE; - e = ColorBBox(e); - continue; - } else if (isSpc) { /* new coloring after the special */ - StartNewColoring(e, (PSegLnkLst)NULL, (PSegLnkLst)NULL); - Tst = IsOk; - haveHBnds = haveVBnds = isSpc = FALSE; - } - } - if (newClrs && e == p) { - StartNewColoring(e, (PSegLnkLst)NULL, (PSegLnkLst)NULL); - SetHColors(mtHclrs); - SetVColors(mtVclrs); - Tst = IsIn; - } - GetColorLsts(e, &hLst, &vLst, &h, &v); - if (etype == MOVETO && IsShort(cp = GetClosedBy(e))) { - GetColorLsts(p = cp->prev, &phLst, &pvLst, &ph, &pv); - if (ClrsClash(e, p, &hLst, &vLst, &phLst, &pvLst)) { - GetColorLsts(e, &hLst, &vLst, &h, &v); - GetColorLsts(p, &phLst, &pvLst, &ph, &pv); - } - if (!(*Tst)(ph, pv) || !(*Tst)(h, v)) { - StartNewColoring(e, hLst, vLst); - Tst = IsOk; - ph = pv = 1; /* force add of colors for p also */ - } else { - AddIfNeedH(h, hLst); - AddIfNeedV(v, vLst); - } - AddIfNeedH(ph, phLst); - AddIfNeedV(pv, pvLst); - newClrs = FALSE; /* so can tell if added new colors in subpath */ - } else if (!(*Tst)(h, v)) { /* e needs new coloring */ - if (etype == CLOSEPATH) { /* do not attach extra colors to closepath */ - e = e->prev; - GetColorLsts(e, &hLst, &vLst, &h, &v); - } - prvHclrs = CopyClrs(Hcoloring); - prvVclrs = CopyClrs(Vcoloring); - if (!newClrs) { /* this is the first extra since mt */ - newClrs = TRUE; - mtVclrs = CopyClrs(prvVclrs); - mtHclrs = CopyClrs(prvHclrs); - } - StartNewColoring(e, hLst, vLst); - Tst = IsOk; - if (etype == CURVETO) { - x = e->x1; - y = e->y1; - } else - GetEndPoint(e, &x, &y); - CarryIfNeed(y, FALSE, prvHclrs); - CarryIfNeed(x, TRUE, prvVclrs); - } else { /* do not need to start new coloring */ - AddIfNeedH(h, hLst); - AddIfNeedV(v, vLst); - } - e = e->next; - } - ReClrBounds(pathEnd); - if (AutoExtraDEBUG) PrintMessage("RemPromotedClrs"); - RemPromotedClrs(); - if (AutoExtraDEBUG) PrintMessage("done autoextracolors"); -} diff --git a/c/autohint/autohintlib/source/ac/bbox.c b/c/autohint/autohintlib/source/ac/bbox.c deleted file mode 100644 index 2fac46584..000000000 --- a/c/autohint/autohintlib/source/ac/bbox.c +++ /dev/null @@ -1,445 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* bbox.c */ - -#include "ac.h" -#include "bftoac.h" -#include "machinedep.h" - -private -Fixed xmin, ymin, xmax, ymax, vMn, vMx, hMn, hMx; -private -PPathElt pxmn, pxmx, pymn, pymx, pe, pvMn, pvMx, phMn, phMx; - -private -procedure FPBBoxPt(c) Cd c; -{ - if (c.x < xmin) { - xmin = c.x; - pxmn = pe; - } - if (c.x > xmax) { - xmax = c.x; - pxmx = pe; - } - if (c.y < ymin) { - ymin = c.y; - pymn = pe; - } - if (c.y > ymax) { - ymax = c.y; - pymx = pe; - } -} - -private -procedure FindPathBBox() { - FltnRec fr; - register PPathElt e; - Cd c0, c1, c2, c3; - if (pathStart == NULL) { - xmin = ymin = xmax = ymax = 0; - pxmn = pxmx = pymn = pymx = NULL; - return; - } - fr.report = FPBBoxPt; - xmin = ymin = FixInt(10000); - xmax = ymax = -xmin; - e = pathStart; - while (e != NULL) { - switch (e->type) { - case MOVETO: - case LINETO: - c0.x = e->x; - c0.y = e->y; - pe = e; - FPBBoxPt(c0); - break; - case CURVETO: - c1.x = e->x1; - c1.y = e->y1; - c2.x = e->x2; - c2.y = e->y2; - c3.x = e->x3; - c3.y = e->y3; - pe = e; - FltnCurve(c0, c1, c2, c3, &fr); - c0 = c3; - break; - case CLOSEPATH: - break; - default: { - FlushLogFiles(); - sprintf(globmsg, "Undefined operator in %s character.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } - e = e->next; - } - xmin = FHalfRnd(xmin); - ymin = FHalfRnd(ymin); - xmax = FHalfRnd(xmax); - ymax = FHalfRnd(ymax); -} - -public -PPathElt FindSubpathBBox(e) PPathElt e; -{ - FltnRec fr; - Cd c0, c1, c2, c3; - if (e == NULL) { - xmin = ymin = xmax = ymax = 0; - pxmn = pxmx = pymn = pymx = NULL; - return NULL; - } - fr.report = FPBBoxPt; - xmin = ymin = FixInt(10000); - xmax = ymax = -xmin; -#if 0 - e = GetDest(e); /* back up to moveto */ -#else - /* This and the following change (in the next else clause) were made - to fix the coloring in characters in the SolEol lists. These are - supposed to have subpath bbox colored, but were getting path bbox - colored instead. */ - if (e->type != MOVETO) e = GetDest(e); /* back up to moveto */ -#endif - while (e != NULL) { - switch (e->type) { - case MOVETO: - case LINETO: - c0.x = e->x; - c0.y = e->y; - pe = e; - FPBBoxPt(c0); - break; - case CURVETO: - c1.x = e->x1; - c1.y = e->y1; - c2.x = e->x2; - c2.y = e->y2; - c3.x = e->x3; - c3.y = e->y3; - pe = e; - FltnCurve(c0, c1, c2, c3, &fr); - c0 = c3; - break; - case CLOSEPATH: -#if 0 - break; -#else - e = e->next; - goto done; -#endif - default: { - FlushLogFiles(); - sprintf(globmsg, "Undefined operator in %s character.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } - e = e->next; - } -#if 1 -done: -#endif - xmin = FHalfRnd(xmin); - ymin = FHalfRnd(ymin); - xmax = FHalfRnd(xmax); - ymax = FHalfRnd(ymax); - return e; -} - -public -procedure FindCurveBBox( - x0, y0, px1, py1, px2, py2, x1, y1, pllx, plly, purx, pury) - Fixed x0, - y0, px1, py1, px2, py2, x1, y1, *pllx, *plly, *purx, *pury; -{ - FltnRec fr; - Cd c0, c1, c2, c3; - fr.report = FPBBoxPt; - xmin = ymin = FixInt(10000); - xmax = ymax = -xmin; - c0.x = x0; - c0.y = y0; - c1.x = px1; - c1.y = py1; - c2.x = px2; - c2.y = py2; - c3.x = x1; - c3.y = y1; - FPBBoxPt(c0); - FltnCurve(c0, c1, c2, c3, &fr); - *pllx = FHalfRnd(xmin); - *plly = FHalfRnd(ymin); - *purx = FHalfRnd(xmax); - *pury = FHalfRnd(ymax); -} - -public -procedure ClrVBnds() { - Fixed tmp; - PPathElt p; - if (pathStart == NULL || VColorChar()) return; - FindPathBBox(); - vMn = itfmx(xmin); - vMx = itfmx(xmax); - pvMn = pxmn; - pvMx = pxmx; - if (vMn > vMx) { - tmp = vMn; - vMn = vMx; - vMx = tmp; - p = pvMn; - pvMn = pvMx; - pvMx = p; - } - AddColorPoint(vMn, 0L, vMx, 0L, 'y', pvMn, pvMx); -} - -public -procedure ReClrVBnds() { - AddColorPoint(vMn, 0L, vMx, 0L, 'y', pvMn, pvMx); -} - -public -procedure ClrHBnds() { - Fixed tmp; - PPathElt p; - if (pathStart == NULL || HColorChar()) return; - FindPathBBox(); - hMn = itfmy(ymin); - hMx = itfmy(ymax); - phMn = pymn; - phMx = pymx; - if (hMn > hMx) { - tmp = hMn; - hMn = hMx; - hMx = tmp; - p = phMn; - phMn = phMx; - phMx = p; - } - AddColorPoint(0L, hMn, 0L, hMx, 'b', phMn, phMx); -} - -public -procedure ReClrHBnds() { - AddColorPoint(0L, hMn, 0L, hMx, 'b', phMn, phMx); -} - -private -boolean CheckValOverlaps(lft, rht, lst, xflg) - Fixed lft, - rht; -PClrVal lst; -boolean xflg; -{ - Fixed lft2, rht2, tmp; - if (xflg) { - lft = itfmx(lft); - rht = itfmx(rht); - } else { - lft = itfmy(lft); - rht = itfmy(rht); - } - if (lft > rht) { - tmp = lft; - lft = rht; - rht = tmp; - } - while (lst != NULL) { - lft2 = lst->vLoc1; - rht2 = lst->vLoc2; - if (xflg) { - lft2 = itfmx(lft2); - rht2 = itfmx(rht2); - } else { - lft2 = itfmy(lft2); - rht2 = itfmy(rht2); - } - if (lft2 > rht2) { - tmp = lft2; - lft2 = rht2; - rht2 = tmp; - } - if (lft2 <= rht && lft <= rht2) return TRUE; - lst = lst->vNxt; - } - return FALSE; -} - -public -procedure AddBBoxHV(Hflg, subs) boolean Hflg, subs; -{ - PPathElt e; - PClrVal val; - PClrSeg seg1, seg2; - e = pathStart; - while (e != NULL) { - if (subs) - e = FindSubpathBBox(e); - else { - FindPathBBox(); - e = NULL; - } - if (!Hflg) { - if (!CheckValOverlaps(xmin, xmax, Vcoloring, TRUE)) { - val = (PClrVal)Alloc(sizeof(ClrVal)); - seg1 = (PClrSeg)Alloc(sizeof(ClrSeg)); - seg1->sLoc = xmin; - seg1->sElt = pxmn; - seg1->sBonus = 0; - seg1->sType = sLINE; - seg1->sMin = ymin; - seg1->sMax = ymax; - seg1->sNxt = NULL; - seg1->sLnk = NULL; - seg2 = (PClrSeg)Alloc(sizeof(ClrSeg)); - seg2->sLoc = xmax; - seg2->sElt = pxmx; - seg2->sBonus = 0; - seg2->sType = sLINE; - seg2->sMin = ymin; - seg2->sMax = ymax; - seg2->sNxt = NULL; - seg2->sLnk = NULL; - val->vVal = 100; - val->vSpc = 0; - val->vLoc1 = xmin; - val->vLoc2 = xmax; - val->vSeg1 = seg1; - val->vSeg2 = seg2; - val->vGhst = FALSE; - val->vNxt = Vcoloring; - val->vBst = val; - Vcoloring = val; - } - } else { - if (!CheckValOverlaps(ymin, ymax, Hcoloring, FALSE)) { - val = (PClrVal)Alloc(sizeof(ClrVal)); - seg1 = (PClrSeg)Alloc(sizeof(ClrSeg)); - seg1->sLoc = ymax; - seg1->sElt = pymx; - seg1->sBonus = 0; - seg1->sType = sLINE; - seg1->sMin = xmin; - seg1->sMax = xmax; - seg1->sNxt = NULL; - seg1->sLnk = NULL; - seg2 = (PClrSeg)Alloc(sizeof(ClrSeg)); - seg2->sLoc = ymin; - seg2->sElt = pymn; - seg2->sBonus = 0; - seg2->sType = sLINE; - seg2->sMin = xmin; - seg2->sMax = xmax; - seg2->sNxt = NULL; - seg2->sLnk = NULL; - val->vVal = 100; - val->vSpc = 0; - val->vLoc1 = ymax; /* bot is > top because y axis is reversed */ - val->vLoc2 = ymin; - val->vSeg1 = seg1; - val->vSeg2 = seg2; - val->vGhst = FALSE; - val->vNxt = Hcoloring; - val->vBst = val; - Hcoloring = val; - } - } - } -} - -public -procedure ClrBBox() { - Fixed llx, lly, urx, ury, tmp; - PPathElt p, p0, p1; - if (!useV) { - llx = itfmx(xmin); - urx = itfmx(xmax); - p0 = pxmn; - p1 = pxmx; - if (llx > urx) { - tmp = llx; - llx = urx; - urx = tmp; - p = p0; - p0 = p1; - p1 = p0; - } - AddColorPoint(llx, 0L, urx, 0L, 'y', p0, p1); - } - if (!useH) { - lly = itfmy(ymax); - ury = itfmy(ymin); - p0 = pymx; - p1 = pymn; - if (lly > ury) { - tmp = lly; - lly = ury; - ury = tmp; - p = p0; - p0 = p1; - p1 = p0; - } - AddColorPoint(0L, lly, 0L, ury, 'b', p0, p1); - } -} - -public -procedure CheckPathBBox() { - Fixed llx, lly, urx, ury, tmp; - FindPathBBox(); - llx = itfmx(xmin); - urx = itfmx(xmax); - if (llx > urx) { - tmp = llx; - llx = urx; - urx = tmp; - } - lly = itfmy(ymax); - ury = itfmy(ymin); - if (lly > ury) { - tmp = lly; - lly = ury; - ury = tmp; - } - if (llx < FixInt(-600) || lly < FixInt(-600) || - urx > FixInt(1600) || ury > FixInt(1600)) - ReportBBoxBogus(llx, lly, urx, ury); -} - -public -Fixed GetPathLSB(void) { - Fixed llx, urx, tmp; - FindPathBBox(); - llx = itfmx(xmin); - urx = itfmx(xmax); - if (llx > urx) { - tmp = llx; - llx = urx; - urx = tmp; - } - return (llx); -} - -public -boolean CheckBBoxes(e1, e2) PPathElt e1, e2; -{ - /* return TRUE if e1 and e2 in same subpath or i - the bbox for one is inside the bbox of the other */ - Fixed xmn, xmx, ymn, ymx; - e1 = GetDest(e1); - e2 = GetDest(e2); - if (e1 == e2) return TRUE; /* same subpath */ - FindSubpathBBox(e1); - xmn = xmin; - xmx = xmax; - ymn = ymin; - ymx = ymax; - FindSubpathBBox(e2); - return ((xmn <= xmin && xmax <= xmx && ymn <= ymin && ymax <= ymx) || - (xmn >= xmin && xmax >= xmx && ymn >= ymin && ymax >= ymx)); -} diff --git a/c/autohint/autohintlib/source/ac/bfstub.c b/c/autohint/autohintlib/source/ac/bfstub.c deleted file mode 100644 index b33326579..000000000 --- a/c/autohint/autohintlib/source/ac/bfstub.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ - -/* bfstub.c - to resolve otherwise unresolved external references. These need to - be defined because of AC's dependency on filookup, but not on fiblues. */ -#include "ac.h" - -/* Procedures defined in bf/fiblues.c - BuildFont */ -public -boolean checkbandspacing() { - return true; -} - -public -boolean checkbandwidths(overshootptsize, undershoot) float overshootptsize; -boolean undershoot; -{ - return true; -} - -public -int build_bands() { - return true; -} - -public -void SetMasterDir(dirindx) - indx dirindx; -{ -} - -public -void WriteBlendedArray(barray, totalvals, subarraysz, str, dirCount) int *barray; -char *str; -int totalvals, subarraysz; -short dirCount; -{ -} - -boolean multiplemaster = 0; /* AC is never run at the MM level */ diff --git a/c/autohint/autohintlib/source/ac/charprop.c b/c/autohint/autohintlib/source/ac/charprop.c deleted file mode 100644 index 18f224909..000000000 --- a/c/autohint/autohintlib/source/ac/charprop.c +++ /dev/null @@ -1,274 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* charprop.c */ - -#include "ac.h" -#include "machinedep.h" -#if PYTHONLIB -extern char *FL_glyphname; -#endif - -public -char *VColorList[] = { - "m", "M", "T", "ellipsis", NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; -public -char *HColorList[] = { - "element", "equivalence", "notelement", "divide", NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL}; - -private -char *UpperSpecialChars[] = { - "questiondown", "exclamdown", "semicolon", NULL}; - -private -char *LowerSpecialChars[] = { - "question", "exclam", "colon", NULL}; - -private -char *NoBlueList[] = { - "at", "bullet", "copyright", "currency", "registered", NULL}; - -private -char *SolEol0List[] = { - "asciitilde", "asterisk", "bullet", "period", "periodcentered", - "colon", "dieresis", - "divide", "ellipsis", "exclam", "exclamdown", "guillemotleft", - "guillemotright", "guilsinglleft", "guilsinglright", "quotesingle", - "quotedbl", "quotedblbase", "quotesinglbase", "quoteleft", - "quoteright", "quotedblleft", "quotedblright", "tilde", NULL}; - -private -char *SolEol1List[] = { - "i", "j", "questiondown", "semicolon", NULL}; - -private -char *SolEolNeg1List[] = {"question", NULL}; - -public -boolean StrEqual(s1, s2) register char *s1, *s2; -{ - register unsigned char c1, c2; - while (TRUE) { - c1 = *s1++; - c2 = *s2++; - if (c1 != c2) return FALSE; - if (c1 == 0 && c2 == 0) return TRUE; - if (c1 == 0 || c2 == 0) return FALSE; - } -} - -extern boolean FindNameInList(nm, lst) char *nm, **lst; -{ - char **l, *lnm; - l = lst; - while (TRUE) { - lnm = *l; - if (lnm == NULL) return FALSE; - if (StrEqual(lnm, nm)) return TRUE; - l++; - } -} - -/* Adds specified characters to CounterColorList array. */ -extern int AddCounterColorChars(charlist, ColorList) char *charlist, *ColorList[]; -{ - const char *setList = "(), \t\n\r"; - char *token; - short length; - boolean firstTime = TRUE; - short ListEntries = COUNTERDEFAULTENTRIES; - - while (TRUE) { - if (firstTime) { - token = (char *)strtok(charlist, setList); - firstTime = FALSE; - } else - token = (char *)strtok(NULL, setList); - if (token == NULL) break; - if (FindNameInList(token, ColorList)) - continue; - /* Currently, ColorList must end with a NULL pointer. */ - if (ListEntries == (COUNTERLISTSIZE - 1)) { - FlushLogFiles(); - sprintf(globmsg, "Exceeded counter hints list size. (maximum is %d.)\n Cannot add %s or subsequent characters.\n", (int)COUNTERLISTSIZE, token); - LogMsg(globmsg, WARNING, OK, TRUE); - break; - } - length = (short)strlen(token); -#if DOMEMCHECK - ColorList[ListEntries] = memck_malloc(length + 1); -#else - ColorList[ListEntries] = AllocateMem(1, length + 1, "counter hints list"); -#endif - strcpy(ColorList[ListEntries++], token); - } - return (ListEntries - COUNTERDEFAULTENTRIES); -} - -public -integer SpecialCharType() { - /* 1 = upper; -1 = lower; 0 = neither */ -#if PYTHONLIB - if (featurefiledata) { - if (FindNameInList(FL_glyphname, UpperSpecialChars)) return 1; - if (FindNameInList(FL_glyphname, LowerSpecialChars)) return -1; - } -#endif - if (FindNameInList(bezGlyphName, UpperSpecialChars)) return 1; - if (FindNameInList(bezGlyphName, LowerSpecialChars)) return -1; - return 0; -} - -public -boolean HColorChar() { -#if PYTHONLIB - if (featurefiledata) { - return FindNameInList(FL_glyphname, HColorList); - } -#endif - return FindNameInList(bezGlyphName, HColorList); -} - -public -boolean VColorChar() { -#if PYTHONLIB - if (featurefiledata) { - return FindNameInList(FL_glyphname, VColorList); - } -#endif - return FindNameInList(bezGlyphName, VColorList); -} - -public -boolean NoBlueChar() { -#if PYTHONLIB - if (featurefiledata) { - return FindNameInList(FL_glyphname, NoBlueList); - } -#endif - return FindNameInList(bezGlyphName, NoBlueList); -} - -public -integer SolEolCharCode() { -#if PYTHONLIB - if (featurefiledata) { - if (FindNameInList(FL_glyphname, SolEol0List)) return 0; - if (FindNameInList(FL_glyphname, SolEol1List)) return 1; - if (FindNameInList(FL_glyphname, SolEolNeg1List)) return -1; - } -#endif - if (FindNameInList(bezGlyphName, SolEol0List)) return 0; - if (FindNameInList(bezGlyphName, SolEol1List)) return 1; - if (FindNameInList(bezGlyphName, SolEolNeg1List)) return -1; - return 2; -} - -/* This change was made to prevent bogus sol-eol's. And to prevent - adding sol-eol if there are a lot of subpaths. */ -public -boolean SpecialSolEol() { - integer code = SolEolCharCode(); - integer count; - if (code == 2) return FALSE; - count = CountSubPaths(); - if (code != 0 && count != 2) return FALSE; - if (code == 0 && count > 3) return FALSE; - return TRUE; -} - -private -PPathElt SubpathEnd(e) PPathElt e; -{ - while (TRUE) { - e = e->next; - if (e == NULL) return pathEnd; - if (e->type == MOVETO) return e->prev; - } -} - -private -PPathElt SubpathStart(e) PPathElt e; -{ - while (e != pathStart) { - if (e->type == MOVETO) break; - e = e->prev; - } - return e; -} - -private -PPathElt SolEol(e) PPathElt e; -{ - e = SubpathStart(e); - e->sol = TRUE; - e = SubpathEnd(e); - e->eol = TRUE; - return e; -} - -private -procedure SolEolAll() { - PPathElt e; - e = pathStart->next; - while (e != NULL) { - e = SolEol(e); - e = e->next; - } -} - -private -procedure SolEolUpperOrLower(upper) boolean upper; -{ - PPathElt e, s1, s2; - Fixed x1, y1, s1y, s2y; - boolean s1Upper; - if (pathStart == NULL) return; - e = s1 = pathStart->next; - GetEndPoint(e, &x1, &y1); - s1y = itfmy(y1); - e = SubpathEnd(e); - e = e->next; - if (e == NULL) return; - s2 = e; - GetEndPoint(e, &x1, &y1); - s2y = itfmy(y1); - s1Upper = (s1y > s2y); - if ((upper && s1Upper) || (!upper && !s1Upper)) - (void)SolEol(s1); - else - (void)SolEol(s2); -} - -/* This change was made to prevent bogus sol-eol's. And to prevent - adding sol-eol if there are a lot of subpaths. */ -public -procedure AddSolEol() { - if (pathStart == NULL) return; - if (!SpecialSolEol()) return; - switch (SolEolCharCode()) { - /* 1 means upper, -1 means lower, 0 means all */ - case 0: - SolEolAll(); - break; - case 1: - SolEolUpperOrLower(TRUE); - break; - case -1: - SolEolUpperOrLower(FALSE); - break; - } -} - -public -boolean MoveToNewClrs() { -#if PYTHONLIB - if (featurefiledata) { - return StrEqual(FL_glyphname, "percent") || StrEqual(FL_glyphname, "perthousand"); - } -#endif - return StrEqual(fileName, "percent") || StrEqual(fileName, "perthousand"); -} diff --git a/c/autohint/autohintlib/source/ac/check.c b/c/autohint/autohintlib/source/ac/check.c deleted file mode 100644 index 4eb87b280..000000000 --- a/c/autohint/autohintlib/source/ac/check.c +++ /dev/null @@ -1,811 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* check.c */ - -#include "ac.h" -#include "bftoac.h" -#include "machinedep.h" - -private -boolean xflat, yflat, xdone, ydone, bbquit; -private -integer xstate, ystate, xstart, ystart; -static Fixed x0, cy0, x1, cy1, xloc, yloc; -private -Fixed x, y, xnxt, ynxt; -private -Fixed yflatstartx, yflatstarty, yflatendx, yflatendy; -private -Fixed xflatstarty, xflatstartx, xflatendx, xflatendy; -private -boolean vert, started, reCheckSmooth; -private -Fixed loc, frst, lst, fltnvalue; -private -PPathElt e; -private -boolean forMultiMaster = FALSE, inflPtFound = FALSE; - -#define STARTING (0L) -#define goingUP (1L) -#define goingDOWN (2L) - -/* DEBUG 8 BIT. The SDELTA value must tbe increased by 2 due to change in coordinate system from 7 to 8 bit FIXED fraction. */ - -#define SDELTA (FixInt(8)) -#define SDELTA3 (FixInt(10)) - -private -procedure chkBad() { - reCheckSmooth = ResolveConflictBySplit(e, FALSE, NULL, NULL); - ; -} - -#define GrTan(n, d) (ac_abs(n) * 100L > ac_abs(d) * sCurveTan) -#define LsTan(n, d) (ac_abs(n) * 100L < ac_abs(d) * sCurveTan) - -private -procedure chkYDIR() { - if (y > yloc) { /* going up */ - if (ystate == goingUP) return; - if (ystate == STARTING) - ystart = ystate = goingUP; - else /*if (ystate == goingDOWN)*/ { - if (ystart == goingUP) { - yflatendx = xloc; - yflatendy = yloc; - } else if (!yflat) { - yflatstartx = xloc; - yflatstarty = yloc; - yflat = TRUE; - } - ystate = goingUP; - } - } else if (y < yloc) { /* going down */ - if (ystate == goingDOWN) return; - if (ystate == STARTING) - ystart = ystate = goingDOWN; - else /*if (ystate == goingUP)*/ { - if (ystart == goingDOWN) { - yflatendx = xloc; - yflatendy = yloc; - } else if (!yflat) { - yflatstartx = xloc; - yflatstarty = yloc; - yflat = TRUE; - } - ystate = goingDOWN; - } - } -} - -private -procedure chkYFLAT() { - Fixed abstmp; - if (!yflat) { - if (LsTan(y - yloc, x - xloc)) { - yflat = TRUE; - yflatstartx = xloc; - yflatstarty = yloc; - } - return; - } - if (ystate != ystart) return; - if (GrTan(y - yloc, x - xloc)) { - yflatendx = xloc; - yflatendy = yloc; - ydone = TRUE; - } -} - -private -procedure chkXFLAT() { - Fixed abstmp; - if (!xflat) { - if (LsTan(x - xloc, y - yloc)) { - xflat = TRUE; - xflatstartx = xloc; - xflatstarty = yloc; - } - return; - } - if (xstate != xstart) return; - if (GrTan(x - xloc, y - yloc)) { - xflatendx = xloc; - xflatendy = yloc; - xdone = TRUE; - } -} - -private -procedure chkXDIR() { - if (x > xloc) { /* going up */ - if (xstate == goingUP) return; - if (xstate == STARTING) - xstart = xstate = goingUP; - else /*if (xstate == goingDOWN)*/ { - if (xstart == goingUP) { - xflatendx = xloc; - xflatendy = yloc; - } else if (!xflat) { - xflatstartx = xloc; - xflatstarty = yloc; - xflat = TRUE; - } - xstate = goingUP; - } - } else if (x < xloc) { - if (xstate == goingDOWN) return; - if (xstate == STARTING) - xstart = xstate = goingDOWN; - else /*if (xstate == goingUP)*/ { - if (xstart == goingDOWN) { - xflatendx = xloc; - xflatendy = yloc; - } else if (!xflat) { - xflatstartx = xloc; - xflatstarty = yloc; - xflat = TRUE; - } - xstate = goingDOWN; - } - } -} - -private -procedure chkDT(c) Cd c; -{ - Fixed abstmp; - Fixed loc; - - x = c.x, y = c.y; - ynxt = y; - xnxt = x; - if (!ydone) { - chkYDIR(); - chkYFLAT(); - if (ydone && yflat && - ac_abs(yflatstarty - cy0) > SDELTA && - ac_abs(cy1 - yflatendy) > SDELTA) { - if ((ystart == goingUP && yflatstarty - yflatendy > SDELTA) || - (ystart == goingDOWN && yflatendy - yflatstarty > SDELTA)) { - if (editChar && !forMultiMaster) - chkBad(); - return; - } - if (ac_abs(yflatstartx - yflatendx) > SDELTA3) { - DEBUG_ROUND(yflatstartx); - DEBUG_ROUND(yflatendx); - DEBUG_ROUND(yflatstarty); - DEBUG_ROUND(yflatendy); - - loc = (yflatstarty + yflatendy) / 2; - DEBUG_ROUND(loc); - - if (!forMultiMaster) { - AddHSegment(yflatstartx, yflatendx, loc, - e, (PPathElt)NULL, sCURVE, 13L); - } else { - inflPtFound = TRUE; - fltnvalue = itfmy(loc); - } - } - } - } - if (!xdone) { - chkXDIR(); - chkXFLAT(); - if (xdone && xflat && - ac_abs(xflatstartx - x0) > SDELTA && - ac_abs(x1 - xflatendx) > SDELTA) { - if ((xstart == goingUP && xflatstartx - xflatendx > SDELTA) || - (xstart == goingDOWN && xflatendx - xflatstartx > SDELTA)) { - if (editChar && !forMultiMaster) - chkBad(); - return; - } - if (ac_abs(xflatstarty - xflatendy) > SDELTA3) { - DEBUG_ROUND(xflatstarty); - DEBUG_ROUND(xflatendy); - DEBUG_ROUND(xflatstartx); - DEBUG_ROUND(xflatendx); - - loc = (xflatstartx + xflatendx) / 2; - DEBUG_ROUND(loc); - - if (!forMultiMaster) - - { - AddVSegment(xflatstarty, xflatendy, loc, - e, (PPathElt)NULL, sCURVE, 13L); - } else { - inflPtFound = TRUE; - fltnvalue = itfmx(loc); - } - } - } - } - xloc = xnxt; - yloc = ynxt; -} - -#define FQ(x) ((long int)((x) >> 6)) -private -integer CPDirection(x1, cy1, x2, y2, x3, y3) Fixed x1, cy1, x2, y2, x3, y3; -{ - long int q, q1, q2, q3; - q1 = FQ(x2) * FQ(y3 - cy1); - q2 = FQ(x1) * FQ(y2 - y3); - q3 = FQ(x3) * FQ(cy1 - y2); - q = q1 + q2 + q3; - if (q > 0) return 1L; - if (q < 0) return -1L; - return 0L; -} - -private -PPathElt PointLine(e, whichcp) PPathElt e; -integer whichcp; -{ - PPathElt newline; - if (whichcp == cpCurve1) - whichcp = cpStart; - else if (whichcp == cpCurve2) - whichcp = cpEnd; - if (whichcp == cpEnd && e->type == CLOSEPATH) { - e = GetDest(e); - e = e->next; - whichcp = cpStart; - } - newline = (PPathElt)Alloc(sizeof(PathElt)); - newline->type = LINETO; - if (whichcp == cpStart) { /* insert line in front of e */ - newline->next = e; - newline->prev = e->prev; - if (e == pathStart) { - FlushLogFiles(); - sprintf(globmsg, "Malformed path list (Start) in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - e->prev->next = newline; - e->prev = newline; - } else { /* add line after e */ - newline->next = e->next; - e->next->prev = newline; - if (e == pathEnd) { - FlushLogFiles(); - sprintf(globmsg, "Malformed path list (End) in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - e->next = newline; - newline->prev = e; - } - GetEndPoint(newline->prev, &newline->x, &newline->y); - return newline; -} - -private -procedure MovePoint(x, y, e, whichcp) - Fixed x, - y; -PPathElt e; -int whichcp; -{ - if (whichcp == cpStart) { - e = e->prev; - whichcp = cpEnd; - } - if (whichcp == cpEnd) { - if (e->type == CLOSEPATH) e = GetDest(e); - if (e->type == CURVETO) { - e->x3 = x; - e->y3 = y; - } else { - e->x = x; - e->y = y; - } - return; - } - if (whichcp == cpCurve1) { - e->x1 = x; - e->y1 = y; - return; - } - if (whichcp == cpCurve2) { - e->x2 = x; - e->y2 = y; - return; - } - { - FlushLogFiles(); - sprintf(globmsg, "Malformed path list in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } -} - -public -procedure RMovePoint(dx, dy, whichcp, e) - Fixed dx, - dy; -PPathElt e; -integer whichcp; -{ - if (whichcp == cpStart) { - e = e->prev; - whichcp = cpEnd; - } - if (whichcp == cpEnd) { - if (e->type == CLOSEPATH) e = GetDest(e); - if (e->type == CURVETO) { - e->x3 += dx; - e->y3 += dy; - } else { - e->x += dx; - e->y += dy; - } - return; - } - if (whichcp == cpCurve1) { - e->x1 += dx; - e->y1 += dy; - return; - } - if (whichcp == cpCurve2) { - e->x2 += dx; - e->y2 += dy; - return; - } - { - FlushLogFiles(); - sprintf(globmsg, "Malformed path list in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } -} - -private -boolean ZeroLength(e) PPathElt e; -{ - Fixed x0, cy0, x1, cy1; - GetEndPoints(e, &x0, &cy0, &x1, &cy1); - return (x0 == x1 && cy0 == cy1); -} - -private -boolean ConsiderClipSharpPoint(rx0, ry0, rx1, ry1, rx2, ry2, e) - Fixed rx0, - ry0, rx1, ry1, rx2, ry2; -PPathElt e; -{ - Fixed x0 = rx0, cy0 = ry0, x1 = rx1, cy1 = ry1, x2 = rx2, y2 = ry2; - Fixed dx0, dy0, dx1, dy1, nlx, nly; - real rdx0, rdx1, rdy0, rdy1; - PPathElt newline; - x0 = itfmx(x0); - x1 = itfmx(x1); - x2 = itfmx(x2); - cy0 = itfmy(cy0); - cy1 = itfmy(cy1); - y2 = itfmy(y2); - dx0 = x1 - x0; - dy0 = cy1 - cy0; - dx1 = x2 - x1; - dy1 = y2 - cy1; - acfixtopflt(dx0, &rdx0); - acfixtopflt(dx1, &rdx1); - acfixtopflt(dy0, &rdy0); - acfixtopflt(dy1, &rdy1); - if (rdx1 * rdy0 < rdx0 * rdy1) return FALSE; - /* clip right turns (point toward inside of character) */ - /* do not clip left turns (point toward outside of character) */ - if (e->type != CLOSEPATH && e->next->type == CLOSEPATH && - ZeroLength(e->next)) - newline = e->next; - else - newline = PointLine(e, cpEnd); /* insert a zero length line */ - GetEndPoint(newline, &nlx, &nly); - (void)NxtForBend(newline, &x1, &cy1, &x2, &y2); - PrvForBend(newline, &x0, &cy0); - /* x0 cy0 is the point before newline */ - /* x1 cy1 is the point after newline */ - /* nlx nly is the location of newline */ - if (cy0 == nly) - MovePoint(nlx, (cy1 > cy0) ? nly + FixOne : nly - FixOne, newline, cpEnd); - else if (cy1 == nly) - MovePoint(nlx, (cy0 > cy1) ? nly + FixOne : nly - FixOne, newline, cpStart); - else if (x0 == nlx) - MovePoint((x1 > x0) ? nlx + FixOne : nlx - FixOne, nly, newline, cpEnd); - else if (x1 == nlx) - MovePoint((x0 > x1) ? nlx + FixOne : nlx - FixOne, nly, newline, cpStart); - else if (ProdGe0(nlx - x0, x1 - nlx)) { /* nlx between x0 and x1 */ - MovePoint((x1 > x0) ? nlx + FixHalf : nlx - FixHalf, nly, newline, cpEnd); - MovePoint((x0 > x1) ? nlx + FixHalf : nlx - FixHalf, nly, newline, cpStart); - } else if (ProdGe0(nly - cy0, cy1 - nly)) { /* nly between cy0 and cy1 */ - MovePoint(nlx, (cy1 > cy0) ? nly + FixHalf : nly - FixHalf, newline, cpEnd); - MovePoint(nlx, (cy0 > cy1) ? nly + FixHalf : nly - FixHalf, newline, cpStart); - } else { - real dydx0, dydx1; - integer wh1, wh2; - dx0 = x0 - nlx; - dy0 = cy0 - nly; - acfixtopflt(dx0, &rdx0); - acfixtopflt(dy0, &rdy0); - dydx0 = rdy0 / rdx0; - if (dydx0 < 0) dydx0 = -dydx0; - dx1 = x1 - nlx; - dy1 = cy1 - nly; - acfixtopflt(dx1, &rdx1); - acfixtopflt(dy1, &rdy1); - dydx1 = rdy1 / rdx1; - if (dydx1 < 0) dydx1 = -dydx1; - if (dydx1 < dydx0) { - wh1 = cpStart; - wh2 = cpEnd; - } else { - wh2 = cpStart; - wh1 = cpEnd; - } - MovePoint(nlx, (dy0 > 0) ? nly + FixOne : nly - FixOne, newline, wh1); - MovePoint((dx0 > 0) ? nlx + FixOne : nlx - FixOne, nly, newline, wh2); - } - return TRUE; -} - -public -procedure Delete(e) PPathElt e; -{ - PPathElt nxt, prv; - nxt = e->next; - prv = e->prev; - if (nxt != NULL) - nxt->prev = prv; - else - pathEnd = prv; - if (prv != NULL) - prv->next = nxt; - else - pathStart = nxt; -} - -/* This procedure is called from BuildFont when adding hints - to base designs of a multi-master font. */ -public -boolean GetInflectionPoint(x, y, x1, cy1, x2, y2, x3, y3, inflPt) - Fixed x, - y, x1, cy1, x2, y2, x3, y3; -Fixed *inflPt; -{ - FltnRec fltnrec; - Cd c0, c1, c2, c3; - - fltnrec.report = chkDT; - c0.x = tfmx(x); - c0.y = tfmy(y); - c1.x = tfmx(x1); - c1.y = tfmy(cy1); - c2.x = tfmx(x2); - c2.y = tfmy(y2); - c3.x = tfmx(x3); - c3.y = tfmy(y3); - xstate = ystate = STARTING; - xdone = ydone = xflat = yflat = inflPtFound = FALSE; - x0 = c0.x; - cy0 = c0.y; - x1 = c3.x; - cy1 = c3.y; - xloc = x0; - yloc = cy0; - forMultiMaster = TRUE; - FltnCurve(c0, c1, c2, c3, &fltnrec); - if (inflPtFound) - *inflPt = fltnvalue; - return inflPtFound; -} - -private -procedure CheckSCurve(ee) PPathElt ee; -{ - FltnRec fr; - Cd c0, c1, c2, c3; - if (ee->type != CURVETO) { - FlushLogFiles(); - sprintf(globmsg, "Malformed path list in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - - GetEndPoint(ee->prev, &c0.x, &c0.y); - fr.report = chkDT; - c1.x = ee->x1; - c1.y = ee->y1; - c2.x = ee->x2; - c2.y = ee->y2; - c3.x = ee->x3; - c3.y = ee->y3; - xstate = ystate = STARTING; - xdone = ydone = xflat = yflat = FALSE; - x0 = c0.x; - cy0 = c0.y; - x1 = c3.x; - cy1 = c3.y; - xloc = x0; - yloc = cy0; - e = ee; - forMultiMaster = FALSE; - FltnCurve(c0, c1, c2, c3, &fr); -} - -private -procedure CheckZeroLength() { - PPathElt e, NxtE; - Fixed x0, cy0, x1, cy1, x2, y2, x3, y3; - e = pathStart; - while (e != NULL) { /* delete zero length elements */ - NxtE = e->next; - GetEndPoints(e, &x0, &cy0, &x1, &cy1); - if (e->type == LINETO && x0 == x1 && cy0 == cy1) { - Delete(e); - goto Nxt1; - } - if (e->type == CURVETO) { - x2 = e->x1; - y2 = e->y1; - x3 = e->x2; - y3 = e->y2; - if (x0 == x1 && cy0 == cy1 && x2 == x1 && x3 == x1 && y2 == cy1 && y3 == cy1) { - Delete(e); - goto Nxt1; - } - } - Nxt1: - e = NxtE; - } -} - -public -procedure CheckSmooth() { - PPathElt e, nxt, NxtE; - boolean recheck; - Fixed x0, cy0, x1, cy1, x2, y2, x3, y3, smdiff, xx, yy; - CheckZeroLength(); -restart: - reCheckSmooth = FALSE; - recheck = FALSE; - e = pathStart; - while (e != NULL) { - NxtE = e->next; - if (e->type == MOVETO || IsTiny(e) || e->isFlex) goto Nxt; - GetEndPoint(e, &x1, &cy1); - if (e->type == CURVETO) { - integer cpd0, cpd1; - x2 = e->x1; - y2 = e->y1; - x3 = e->x2; - y3 = e->y2; - GetEndPoint(e->prev, &x0, &cy0); - cpd0 = CPDirection(x0, cy0, x2, y2, x3, y3); - cpd1 = CPDirection(x2, y2, x3, y3, x1, cy1); - if (ProdLt0(cpd0, cpd1)) - CheckSCurve(e); - } - nxt = NxtForBend(e, &x2, &y2, &xx, &yy); - if (nxt->isFlex) goto Nxt; - PrvForBend(nxt, &x0, &cy0); - if (!CheckSmoothness(x0, cy0, x1, cy1, x2, y2, &smdiff)) - ReportSmoothError(x1, cy1); - if (smdiff > FixInt(140)) { /* trim off sharp angle */ - /* As of version 2.21 angle blunting will not occur. */ - /* - if (editChar && ConsiderClipSharpPoint(x0, cy0, x1, cy1, x2, y2, e)) { - ReportClipSharpAngle(x1, cy1); recheck = TRUE; } - else */ - if (smdiff > FixInt(160)) - ReportSharpAngle(x1, cy1); - } - Nxt: - e = NxtE; - } - if (reCheckSmooth) goto restart; - if (!recheck) return; - CheckZeroLength(); - /* in certain cases clip sharp point can produce a zero length line */ -} - -#define BBdist (FixInt(20)) /* DEBUG 8 BIT. DOuble value from 10 to 20 for change in coordinate system. */ - -private -procedure chkBBDT(c) Cd c; -{ - Fixed x = c.x, y = c.y, abstmp; - if (bbquit) return; - if (vert) { - lst = y; - if (!started && ac_abs(x - loc) <= BBdist) { - started = TRUE; - frst = y; - } else if (started && ac_abs(x - loc) > BBdist) - bbquit = TRUE; - } else { - lst = x; - if (!started && ac_abs(y - loc) <= BBdist) { - started = TRUE; - frst = x; - } else if (started && ac_abs(y - loc) > BBdist) - bbquit = TRUE; - } -} - -public -procedure CheckForMultiMoveTo() { - PPathElt e = pathStart; - boolean moveto; - moveto = FALSE; - while (e != NULL) { - if (e->type != MOVETO) - moveto = FALSE; - else if (!moveto) - moveto = TRUE; - else - Delete(e->prev); /* delete previous moveto */ - e = e->next; - } -} - -public -procedure CheckBBoxEdge(e, vrt, lc, pf, pl) - PPathElt e; -boolean vrt; -Fixed lc, *pf, *pl; -{ - FltnRec fr; - Cd c0, c1, c2, c3; - if (e->type != CURVETO) { - FlushLogFiles(); - sprintf(globmsg, "Malformed path list in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - - GetEndPoint(e->prev, &c0.x, &c0.y); - fr.report = chkBBDT; - bbquit = FALSE; - c1.x = e->x1; - c1.y = e->y1; - c2.x = e->x2; - c2.y = e->y2; - c3.x = e->x3; - c3.y = e->y3; - loc = lc; - vert = vrt; - started = FALSE; - chkBBDT(c0); - FltnCurve(c0, c1, c2, c3, &fr); - *pf = frst; - *pl = lst; -} - -private -procedure MakeColinear(tx, ty, x0, cy0, x1, cy1, xptr, yptr) - Fixed tx, - ty, x0, cy0, x1, cy1, *xptr, *yptr; -{ - Fixed dx, dy; - real rdx, rdy, dxdy, dxsq, dysq, dsq, xi, yi, rx, ry, rx0, ry0; - dx = x1 - x0; - dy = cy1 - cy0; - if (dx == 0 && dy == 0) { - *xptr = tx; - *yptr = ty; - return; - } - if (dx == 0) { - *xptr = x0; - *yptr = ty; - return; - } - if (dy == 0) { - *xptr = tx; - *yptr = cy0; - return; - } - acfixtopflt(dx, &rdx); - acfixtopflt(dy, &rdy); - acfixtopflt(x0, &rx0); - acfixtopflt(cy0, &ry0); - acfixtopflt(tx, &rx); - acfixtopflt(ty, &ry); - dxdy = rdx * rdy; - dxsq = rdx * rdx; - dysq = rdy * rdy; - dsq = dxsq + dysq; - xi = (rx * dxsq + rx0 * dysq + (ry - ry0) * dxdy) / dsq; - yi = ry0 + ((xi - rx0) * rdy) / rdx; - *xptr = acpflttofix(&xi); - *yptr = acpflttofix(&yi); -} - -#define DEG(x) ((x)*57.29577951308232088) -extern double atan2(); -private -Fixed ATan(a, b) Fixed a, b; -{ - real aa, bb, cc; - acfixtopflt(a, &aa); - acfixtopflt(b, &bb); - cc = (real)DEG(atan2((double)aa, (double)bb)); - while (cc < 0) cc += 360.0; - return acpflttofix(&cc); -} - -public -boolean CheckSmoothness(x0, cy0, x1, cy1, x2, y2, pd) - Fixed x0, - cy0, x1, cy1, x2, y2, *pd; -{ - Fixed dx, dy, smdiff, smx, smy, at0, at1, abstmp; - dx = x0 - x1; - dy = cy0 - cy1; - *pd = 0L; - if (dx == 0 && dy == 0) return TRUE; - at0 = ATan(dx, dy); - dx = x1 - x2; - dy = cy1 - y2; - if (dx == 0 && dy == 0) return TRUE; - at1 = ATan(dx, dy); - smdiff = at0 - at1; - if (smdiff < 0) smdiff = -smdiff; - if (smdiff >= FixInt(180)) smdiff = FixInt(360) - smdiff; - *pd = smdiff; - if (smdiff == 0 || smdiff > FixInt(30)) return TRUE; - MakeColinear(x1, cy1, x0, cy0, x2, y2, &smx, &smy); - smx = FHalfRnd(smx); - smy = FHalfRnd(smy); - /* DEBUG 8 BIT. Double hard coded distance values, for change from 7 to 8 bits for fractions. */ - return ac_abs(smx - x1) < FixInt(4) && ac_abs(smy - cy1) < FixInt(4); -} - -public -procedure CheckForDups() { - register PPathElt ob, nxt; - register Fixed x, y; - ob = pathStart; - while (ob != NULL) { - nxt = ob->next; - if (ob->type == MOVETO) { - x = ob->x; - y = ob->y; - ob = nxt; - while (ob != NULL) { - if (ob->type == MOVETO && x == ob->x && y == ob->y) - goto foundMatch; - ob = ob->next; - } - } - ob = nxt; - } - return; -foundMatch: - x = itfmx(x); - y = itfmy(y); - ReportDuplicates(x, y); -} - -public -procedure MoveSubpathToEnd(e) PPathElt e; -{ - PPathElt subEnd, subStart, subNext, subPrev; - subEnd = (e->type == CLOSEPATH) ? e : GetClosedBy(e); - subStart = GetDest(subEnd); - if (subEnd == pathEnd) return; /* already at end */ - subNext = subEnd->next; - if (subStart == pathStart) { - pathStart = subNext; - subNext->prev = NULL; - } else { - subPrev = subStart->prev; - subPrev->next = subNext; - subNext->prev = subPrev; - } - pathEnd->next = subStart; - subStart->prev = pathEnd; - subEnd->next = NULL; - pathEnd = subEnd; -} diff --git a/c/autohint/autohintlib/source/ac/control.c b/c/autohint/autohintlib/source/ac/control.c deleted file mode 100644 index 6276177e4..000000000 --- a/c/autohint/autohintlib/source/ac/control.c +++ /dev/null @@ -1,906 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/************************************************************************/ -/* control.c */ - -#include "ac.h" -#include "machinedep.h" - -#if ALLOWCSOUTPUT && THISISACMAIN -extern boolean charstringoutput; -#endif - -extern void CSWrite(void); - -private -procedure DoHStems(); -private -procedure DoVStems(); - -private -boolean CounterFailed; - -public -procedure InitAll(integer reason) { - InitData(reason); /* must be first */ - InitAuto(reason); - InitFix(reason); - InitGen(reason); - InitPick(reason); -} - -private -integer PtLstLen(PClrPoint lst) { - integer cnt = 0; - while (lst != NULL) { - cnt++; - lst = lst->next; - } - return cnt; -} - -public -integer PointListCheck(PClrPoint new, PClrPoint lst) { - /* -1 means not a member, 1 means already a member, 0 means conflicts */ - Fixed l1, l2, n1, n2, tmp, halfMargin; - char ch = new->c; - halfMargin = FixHalfMul(bandMargin); - halfMargin = FixHalfMul(halfMargin); - /* DEBUG 8 BIT. In the previous version, with 7 bit fraction coordinates instead of the current - 8 bit, bandMargin is declared as 30, but scaled by half to match the 7 bit fraction coordinate -> a value of 15. - In the current version this scaling doesn't happen. However, in this part of the code, the hint values are scaled up to 8 bits of fraction even in the original version, but topBand is applied without correcting for the scaling difference. In this version I need to divide by half again in order to get to the same value. I think the original is a bug, but it has been working for 30 years, so I am not going to change the test now. - */ - switch (ch) { - case 'y': - case 'm': { - n1 = new->x0; - n2 = new->x1; - break; - } - case 'b': - case 'v': { - n1 = new->y0; - n2 = new->y1; - break; - } - default: { - FlushLogFiles(); - sprintf(globmsg, "Illegal character in point list in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } - if (n1 > n2) { - tmp = n1; - n1 = n2; - n2 = tmp; - } - while (TRUE) { - if (lst == NULL) { - return -1; - } - if (lst->c == ch) { /* same kind of color */ - switch (ch) { - case 'y': - case 'm': { - l1 = lst->x0; - l2 = lst->x1; - break; - } - case 'b': - case 'v': { - l1 = lst->y0; - l2 = lst->y1; - break; - } - } - if (l1 > l2) { - tmp = l1; - l1 = l2; - l2 = tmp; - } - if (l1 == n1 && l2 == n2) { - return 1L; - } - /* Add this extra margin to the band to fix a problem in - TimesEuropa/Italic/v,w,y where a main hstem hint was - being merged with newcolors. This main hstem caused - problems in rasterization so it shouldn't be included. */ - l1 -= halfMargin; - l2 += halfMargin; - if (l1 <= n2 && n1 <= l2) { - return 0L; - } - } - lst = lst->next; - } -} - -private -boolean SameColorLists(PClrPoint lst1, PClrPoint lst2) { - if (PtLstLen(lst1) != PtLstLen(lst2)) { - return FALSE; - } - while (lst1 != NULL) { /* go through lst1 */ - if (PointListCheck(lst1, lst2) != 1) { - return FALSE; - } - lst1 = lst1->next; - } - return TRUE; -} - -public -boolean SameColors(integer cn1, integer cn2) { - if (cn1 == cn2) { - return TRUE; - } - return SameColorLists(ptLstArray[cn1], ptLstArray[cn2]); -} - -public -procedure MergeFromMainColors(char ch) { - register PClrPoint lst; - for (lst = ptLstArray[0]; lst != NULL; lst = lst->next) { - if (lst->c != ch) { - continue; - } - if (PointListCheck(lst, pointList) == -1) { - if (ch == 'b') { - AddColorPoint(0L, lst->y0, 0L, lst->y1, ch, lst->p0, lst->p1); - } else { - AddColorPoint(lst->x0, 0L, lst->x1, 0L, ch, lst->p0, lst->p1); - } - } - } -} - -public -procedure AddColorPoint(Fixed x0, Fixed y0, Fixed x1, Fixed y1, char ch, PPathElt p0, PPathElt p1) { - register PClrPoint pt; - integer chk; - pt = (PClrPoint)Alloc(sizeof(ClrPoint)); - pt->x0 = x0; - pt->y0 = y0; - pt->x1 = x1; - pt->y1 = y1; - pt->c = ch; - pt->done = FALSE; - pt->next = NULL; - pt->p0 = p0; - pt->p1 = p1; - chk = PointListCheck(pt, pointList); - if (chk == 0 && showClrInfo) { - ReportColorConflict(x0, y0, x1, y1, ch); - } - if (chk == -1) { - pt->next = pointList; - pointList = pt; - if (logging) { - LogColorInfo(pointList); - } - } -} - -private -procedure CopyClrFromLst(char clr, register PClrPoint lst) { - boolean bvflg = (clr == 'b' || clr == 'v'); - while (lst != NULL) { - if (lst->c == clr) { - if (bvflg) { - AddColorPoint(0L, lst->y0, 0L, lst->y1, clr, lst->p0, lst->p1); - } else { - AddColorPoint(lst->x0, 0L, lst->x1, 0L, clr, lst->p0, lst->p1); - } - } - lst = lst->next; - } -} - -public -procedure CopyMainV() { - CopyClrFromLst('m', ptLstArray[0]); -} - -public -procedure CopyMainH() { - CopyClrFromLst('v', ptLstArray[0]); -} - -public -procedure AddHPair(PClrVal v, char ch) { - Fixed bot, top, tmp; - PPathElt p0, p1, p; - bot = itfmy(v->vLoc1); - top = itfmy(v->vLoc2); - p0 = v->vBst->vSeg1->sElt; - p1 = v->vBst->vSeg2->sElt; - if (top < bot) { - tmp = top; - top = bot; - bot = tmp; - p = p0; - p0 = p1; - p1 = p; - } - if (v->vGhst) { - if (v->vSeg1->sType == sGHOST) { - bot = top; - p0 = p1; - p1 = NULL; - top = bot - FixInt(20); /* width == -20 iff bottom seg is ghost */ - } else { - top = bot; - p1 = p0; - p0 = NULL; - bot = top + FixInt(21); /* width == -21 iff top seg is ghost */ - } - } - AddColorPoint(0L, bot, 0L, top, ch, p0, p1); -} - -public -procedure AddVPair(PClrVal v, char ch) { - Fixed lft, rght, tmp; - PPathElt p0, p1, p; - lft = itfmx(v->vLoc1); - rght = itfmx(v->vLoc2); - p0 = v->vBst->vSeg1->sElt; - p1 = v->vBst->vSeg2->sElt; - if (lft > rght) { - tmp = lft; - lft = rght; - rght = tmp; - p = p0; - p0 = p1; - p1 = p; - } - AddColorPoint(lft, 0L, rght, 0L, ch, p0, p1); -} - -private -boolean UseCounter(PClrVal sLst, boolean mclr) { - integer cnt = 0; - Fixed minLoc, midLoc, maxLoc, abstmp, prevBstVal, bestVal; - Fixed minDelta, midDelta, maxDelta, loc, delta, th; - PClrVal lst, newLst; - minLoc = midLoc = maxLoc = FixInt(20000L); - minDelta = midDelta = maxDelta = 0; - lst = sLst; - while (lst != NULL) { - cnt++; - lst = lst->vNxt; - } - if (cnt < 3) { - return FALSE; - } - cnt -= 3; - prevBstVal = 0; - while (cnt > 0) { - cnt--; - if (cnt == 0) { - prevBstVal = sLst->vVal; - } - sLst = sLst->vNxt; - } - bestVal = sLst->vVal; - if (prevBstVal > FixInt(1000L) || bestVal < prevBstVal * 10L) { - return FALSE; - } - newLst = sLst; - while (sLst != NULL) { - loc = sLst->vLoc1; - delta = sLst->vLoc2 - loc; - loc += FixHalfMul(delta); - if (loc < minLoc) { - maxLoc = midLoc; - maxDelta = midDelta; - midLoc = minLoc; - midDelta = minDelta; - minLoc = loc; - minDelta = delta; - } else if (loc < midLoc) { - maxLoc = midLoc; - maxDelta = midDelta; - midLoc = loc; - midDelta = delta; - } else { - maxLoc = loc; - maxDelta = delta; - } - sLst = sLst->vNxt; - } - th = FixInt(5) / 100L; - if (ac_abs(minDelta - maxDelta) < th && - ac_abs((maxLoc - midLoc) - (midLoc - minLoc)) < th) { - if (mclr) { - Vcoloring = newLst; - } else { - Hcoloring = newLst; - } - return TRUE; - } - if (ac_abs(minDelta - maxDelta) < FixInt(3) && - ac_abs((maxLoc - midLoc) - (midLoc - minLoc)) < FixInt(3)) { - ReportError(mclr ? "Near miss for using V counter hinting." : "Near miss for using H counter hinting."); - } - return FALSE; -} - -private -procedure GetNewPtLst() { - if (numPtLsts >= maxPtLsts) { /* increase size */ - PClrPoint *newArray; - integer i; - maxPtLsts += 5; - newArray = (PClrPoint *)Alloc(maxPtLsts * sizeof(PClrPoint)); - for (i = 0; i < maxPtLsts - 5; i++) { - newArray[i] = ptLstArray[i]; - } - ptLstArray = newArray; - } - ptLstIndex = numPtLsts; - numPtLsts++; - pointList = NULL; - ptLstArray[ptLstIndex] = NULL; -} - -public -procedure XtraClrs(PPathElt e) { - /* this can be simplified for standalone coloring */ - ptLstArray[ptLstIndex] = pointList; - if (e->newcolors == 0) { - GetNewPtLst(); - e->newcolors = (short)ptLstIndex; - } - ptLstIndex = e->newcolors; - pointList = ptLstArray[ptLstIndex]; -} - -private -procedure Blues() { - Fixed pv, pd, pc, pb, pa; - PClrVal sLst; - - /* - Top alignment zones are in the global 'topBands', bottom in 'botBands'. - - This function looks through the path, as defined by the linked list of 'elts', starting at the global 'pathStart', and adds to several lists. Coordinates are stored in the elt.(x,y) as (original value)/2.0, aka right shifted by 1 bit from the original 24.8 Fixed. I suspect that is to allow a larger integer portion - when this program was written, an int was 16 bits. - - - HStems, Vstems are global lists of Fixed 24.8 numbers.. - - segLists is an array of 4 ClrSeg linked lists. list 0 and 1 are respectively up and down vertical segments. Lists 2 and 3 are - respectively left pointing and right pointing horizontal segments. On a counter-clockwise path, this is the same as selecting - top and bottom stem locations. - - NoBlueChar() consults a hard-coded list of glyph names, If the glyph is in this list, set the alignment zones (top and botBands) to empty. - - 1) gen.c:GenHPts() . Buid the raw list of stem segments in global 'topList' and 'botList'. - - gen.c:GenHPts() steps through the liked list of path segments, starting at 'pathStart' It decides if a path is mostly H, - and if so, adds it to a linked list of hstem candidates in segLists, by calling gen.c:AddHSegment(). This calls ReportAddHSeg() (useful in debugging), - and then gen.c:AddSegment. - - If the path segment is in fact entirely vertical and is followed by a sharp bend, - gen.c:GenHPts adds two new path segments just 1 unit long, after the segment end point, - called H/VBends (segment type sBend=1). I have no idea what these are for. - - AddSegment is pretty simple. It creates a new hint segment 'ClrSeg' for the parent path elt , fills it in, - adds it to appropriate list of the 4 segLists, and then sorts by hstem location. - seg->sElt is the parent elt - seg->sType is the type - seg->sLoc is the location in Fixed 18.14: right shift 7 to get integer value. - - If the current path elt is a Closepath, It also calls LinkSegment() to add the current stem segment to the list of stem segments referenced by this elt. - e->Hs/Vs. - - Note that a hint segment is created for each nearly vertical or horioztonal path elt. Ths means that in an H, there will be two hint segments created for - the bottom and top of the H, as there are two horizontal paths with the same Y at the top and bottom of the H. - - Assign the top and bottom Hstem location lists. - topList = segLists[2] - botList = segLists[3]; - - 2) eval.c::EvalH(). Evaluate every combination of botList and topList, and assign a priority value and a 'Q' value. - - For each bottom stem - for each top stem - 1) assign priority (spc) and weight (val) values with EvalHPair() - 2) report stem near misses in the 'HStems' list with HStemMiss() - 3) decide whether to add pair to 'HStems' list with AddHValue() - - Add ghost hints. - For each bottom stem segment and then for each top stem segment: - if it is in an alignment zone, make a ghost hint segment and add it with AddHValue(). - - EvalHPair() sets priority (spc) and weight (val) values. - Omit pair by setting value to 0 if: - bottom is in bottom alignment zone, and top is in top alignment zone. (otherwise, these will override the ghost hints). - - Boost priority by +2 if either the bot or top segment is in an alignment zone. - - dy = stem widt ( top - bot) - - Calculcate dist. Dist is set to a fudge factor *dy. - if bottom segment xo->x1 overlaps top x0->x1, the fudge factor is 1.0. The - less the overlap, the larger the fduge factor. - if bottom segment xo->x1 overlaps top x0->x1:. - if top and bottom overlap exactly, dist = dy - if they barely overlap, dist = 1.4*dy - in between, interpolate. - else, look at closest ends betwen bottom and top segments. - dx = min X separation between top and bottom segments. - dist = 1.4 *dy - dist += dx*dx - if dx > dy: - dist *= dx / dy; - Look through the HStems global list. For each match to dy, boost priority by + 1. - Calculate weight with gen.c:AdjustVal() - if dy is more than twice the 1.1.5* the largest hint in HStems, set weight to 0. - Calculate weight as related to length of the segments squared divied by the distance squared. - Basically, the greater the ratio segment overlap to stem width, the higher the value. - if dy is greater than the largest stem hint in HStems, decrease the value - scale weight by of *(largest stem hint in HStems)/ dy)**3. - - AddHValue() decides whether add a (bottom, top) pair of color segments. - Do not add the pair if: - if weight (val) is 0, - if both are sBEND segments - if neither are a ghost hint, and weight <= pruneD and priority (spc) is <= 0: - if either is an sBEND: skip - if the BBox for one segment is the same or inside the BBox for the other: skip - - else add it with eval.c:InsertHValue() - add new ClrVal to global valList. - item->vVal = val; # weight - item->initVal = val; # originl weight from EvalHPair() - item->vSpc = spc; # priority - item->vLoc1 = bot; # bottom Y value in Fixed 18.14 - item->vLoc2 = top; # top Y value in Fixed 18.14 - item->vSeg1 = bSeg; # bottom color segment - item->vSeg2 = tSeg; # top color segment - item->vGhst = ghst; # if it is a ghost segment. - The new item is inserted after the first element where vlist->vLoc2 >= top and vlist->vLoc1 >= bottom - - 3) merge.c:PruneHVals(); - - item2 in the list knocks out item1 if: - 1) (item2 val is more than 3* greater than item1 val) and - val 1 is less than FixedInt(100) and - item2 top and bottom is within item 1 top and bottom - and ( if val1 is more than 50* less than val2 and - either top seg1 is close to top seg 2, or bottom seg1 is close to bottom seg 2 - ) - and (val 1 < FixInt(16)) or ( ( item1 top not in blue zone, or top1 = top2) and - ( item1 bottom not in blue zone, or top1 = bottom2)) - "Close to" for the bottom segment means you can get to the bottom elt for item 2 from bottom elt for 1 within the same path, by - stepping either forward or back from item 1's elt, and without going outside the bounds between - location 1 and location 2. Same for top segments. - - - - - 4) pick.c:FindBestHVals(); - When a hint segment */ - - if (showClrInfo) { - PrintMessage("generate blues"); - } - if (NoBlueChar()) { - lenTopBands = lenBotBands = 0; - } - GenHPts(); - if (showClrInfo) { - PrintMessage("evaluate"); - } - if (!CounterFailed && HColorChar()) { - pv = pruneValue; - pruneValue = (Fixed)minVal; - pa = pruneA; - pruneA = (Fixed)minVal; - pd = pruneD; - pruneD = (Fixed)minVal; - pc = pruneC; - pruneC = (Fixed)maxVal; - pb = pruneB; - pruneB = (Fixed)minVal; - } - EvalH(); - PruneHVals(); - FindBestHVals(); - MergeVals(FALSE); - - if (showClrInfo) { - ShowHVals(valList); - PrintMessage("pick best"); - } - MarkLinks(valList, TRUE); - CheckVals(valList, FALSE); - DoHStems(valList); /* Report stems and alignment zones, if this has been requested. */ - PickHVals(valList); /* Moves best ClrVal items from valList to Hcoloring list. (? Choose from set of ClrVals for the samte stem values.) */ - if (!CounterFailed && HColorChar()) { - pruneValue = pv; - pruneD = pd; - pruneC = pc; - pruneB = pb; - pruneA = pa; - useH = UseCounter(Hcoloring, FALSE); - if (!useH) { /* try to fix */ - AddBBoxHV(TRUE, TRUE); - useH = UseCounter(Hcoloring, FALSE); - if (!useH) { /* still bad news */ - ReportError("Note: Glyph is in list for using H counter hints, but didn't find any candidates."); - CounterFailed = TRUE; - } - } - } else { - useH = FALSE; - } - if (Hcoloring == NULL) { - AddBBoxHV(TRUE, FALSE); - } - if (showClrInfo) { - PrintMessage("results"); - PrintMessage(useH ? "rv" : "rb"); - ShowHVals(Hcoloring); - } - if (useH) { - PrintMessage("Using H counter hints."); - } - sLst = Hcoloring; - while (sLst != NULL) { - AddHPair(sLst, useH ? 'v' : 'b'); /* actually adds hint */ - sLst = sLst->vNxt; - } -} - -private -procedure DoHStems(PClrVal sLst1) { - Fixed bot, top; - Fixed charTop = MINinteger, charBot = MAXinteger; - boolean curved; - if (!doAligns && !doStems) { - return; - } - while (sLst1 != NULL) { - bot = itfmy(sLst1->vLoc1); - top = itfmy(sLst1->vLoc2); - if (top < bot) { - Fixed tmp = top; - top = bot; - bot = tmp; - } - if (top > charTop) { - charTop = top; - } - if (bot < charBot) { - charBot = bot; - } - /* skip if ghost or not a line on top or bottom */ - if (sLst1->vGhst) { - sLst1 = sLst1->vNxt; - continue; - } - curved = !FindLineSeg(sLst1->vLoc1, botList) && - !FindLineSeg(sLst1->vLoc2, topList); - AddHStem(top, bot, curved); - sLst1 = sLst1->vNxt; - if (top != MINinteger || bot != MAXinteger) { - AddStemExtremes(UnScaleAbs(bot), UnScaleAbs(top)); - } - } - if (charTop != MINinteger || charBot != MAXinteger) { - AddCharExtremes(UnScaleAbs(charBot), UnScaleAbs(charTop)); - } -} - -private -procedure Yellows() { - Fixed pv, pd, pc, pb, pa; - PClrVal sLst; - if (showClrInfo) { - PrintMessage("generate yellows"); - } - GenVPts(SpecialCharType()); - if (showClrInfo) { - PrintMessage("evaluate"); - } - if (!CounterFailed && VColorChar()) { - pv = pruneValue; - pruneValue = (Fixed)minVal; - pa = pruneA; - pruneA = (Fixed)minVal; - pd = pruneD; - pruneD = (Fixed)minVal; - pc = pruneC; - pruneC = (Fixed)maxVal; - pb = pruneB; - pruneB = (Fixed)minVal; - } - EvalV(); - PruneVVals(); - FindBestVVals(); - MergeVals(TRUE); - if (showClrInfo) { - ShowVVals(valList); - PrintMessage("pick best"); - } - MarkLinks(valList, FALSE); - CheckVals(valList, TRUE); - DoVStems(valList); - PickVVals(valList); - if (!CounterFailed && VColorChar()) { - pruneValue = pv; - pruneD = pd; - pruneC = pc; - pruneB = pb; - pruneA = pa; - useV = UseCounter(Vcoloring, TRUE); - if (!useV) { /* try to fix */ - AddBBoxHV(FALSE, TRUE); - useV = UseCounter(Vcoloring, TRUE); - if (!useV) { /* still bad news */ - ReportError("Note: Glyph is in list for using V counter hints, but didn't find any candidates."); - CounterFailed = TRUE; - } - } - } else { - useV = FALSE; - } - if (Vcoloring == NULL) { - AddBBoxHV(FALSE, FALSE); - } - if (showClrInfo) { - PrintMessage("results"); - PrintMessage(useV ? "rm" : "ry"); - ShowVVals(Vcoloring); - } - if (useV) { - PrintMessage("Using V counter hints."); - } - sLst = Vcoloring; - while (sLst != NULL) { - AddVPair(sLst, useV ? 'm' : 'y'); - sLst = sLst->vNxt; - } -} - -private -procedure DoVStems(PClrVal sLst) { - Fixed lft, rght; - boolean curved; - if (!doAligns && !doStems) { - return; - } - while (sLst != NULL) { - curved = !FindLineSeg(sLst->vLoc1, leftList) && - !FindLineSeg(sLst->vLoc2, rightList); - lft = itfmx(sLst->vLoc1); - rght = itfmx(sLst->vLoc2); - if (lft > rght) { - Fixed tmp = lft; - lft = rght; - rght = tmp; - } - AddVStem(rght, lft, curved); - sLst = sLst->vNxt; - } -} - -private -procedure RemoveRedundantFirstColors() { - register PPathElt e; - if (numPtLsts < 2 || !SameColors(0L, 1L)) { - return; - } - e = pathStart; - while (e != NULL) { - if (e->newcolors == 1) { - e->newcolors = 0; - return; - } - e = e->next; - } -} - -private -procedure PreCheckForSolEol() { - integer code; - Fixed yStart, yEnd, x1, y1; - if (!SpecialSolEol() || useV || useH || pathStart == NULL) { - return; - } - code = SolEolCharCode(); - if (code == 0) { - return; - } - GetEndPoint(pathStart, &x1, &y1); - yStart = itfmy(y1); - GetEndPoint(GetDest(pathEnd), &x1, &y1); - yEnd = itfmy(y1); - if (editChar && ((code == 1 && yStart > yEnd) || (code == -1 && yStart < yEnd))) { - MoveSubpathToEnd(pathStart); - } -} - -private -procedure AddColorsSetup() { - int i; - Fixed abstmp; - vBigDist = 0; - for (i = 0; i < NumVStems; i++) { - if (VStems[i] > vBigDist) { - vBigDist = VStems[i]; - } - } - vBigDist = dtfmx(vBigDist); - if (vBigDist < initBigDist) { - vBigDist = initBigDist; - } - vBigDist = (vBigDist * 23L) / 20L; - acfixtopflt(vBigDist, &vBigDistR); - hBigDist = 0; - for (i = 0; i < NumHStems; i++) { - if (HStems[i] > hBigDist) { - hBigDist = HStems[i]; - } - } - hBigDist = ac_abs(dtfmy(hBigDist)); - if (hBigDist < initBigDist) { - hBigDist = initBigDist; - } - hBigDist = (hBigDist * 23L) / 20L; - acfixtopflt(hBigDist, &hBigDistR); - if ((!scalinghints) && (roundToInt)) { - RoundPathCoords(); - } - CheckForMultiMoveTo(); - /* PreCheckForSolEol(); */ -} - -/* If extracolor is TRUE then it is ok to have multi-level - coloring. */ -private -procedure AddColorsInnerLoop(boolean extracolor) { - integer solEolCode = 2, retryColoring = 0; - boolean isSolEol = FALSE; - while (TRUE) { - PreGenPts(); - CheckSmooth(); - InitShuffleSubpaths(); - Blues(); - if (!doAligns) { - Yellows(); - } - if (editChar) { - DoShuffleSubpaths(); - } - Hprimary = CopyClrs(Hcoloring); - Vprimary = CopyClrs(Vcoloring); - /* - isSolEol = SpecialSolEol() && !useV && !useH; - solEolCode = isSolEol? SolEolCharCode() : 2; - */ - PruneElementColorSegs(); - if (listClrInfo) { - ListClrInfo(); - } - if (extracolor) { - AutoExtraColors(MoveToNewClrs(), isSolEol, solEolCode); - } - ptLstArray[ptLstIndex] = pointList; - if (isSolEol) { - break; - } - retryColoring++; - /* we want to retry coloring if - `1) CounterFailed or - 2) doFixes changed something, but in both cases, only on the first pass. - */ - if (CounterFailed && retryColoring == 1) { - goto retry; - } - if (!DoFixes()) { - break; - } - if (retryColoring > 1) { - break; - } - retry: - /* if we are doing the stem and zones reporting, we need to discard the reported. */ - if (reportRetryCB != NULL) { - reportRetryCB(); - } - if (pathStart == NULL || pathStart == pathEnd) { - FlushLogFiles(); - sprintf(globmsg, "No character path in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - - /* SaveFile(); SaveFile is always called in AddColorsCleanup, so this is a duplciate */ - InitAll(RESTART); - if (writecoloredbez && !ReadCharFile(FALSE, FALSE, FALSE, TRUE)) { - break; - } - AddColorsSetup(); - if (!PreCheckForColoring()) { - break; - } - if (flexOK) { - hasFlex = FALSE; - AutoAddFlex(); - } - reportErrors = FALSE; - } -} - -private -procedure AddColorsCleanup() { - RemoveRedundantFirstColors(); - reportErrors = TRUE; - if (writecoloredbez) { - if (pathStart == NULL || pathStart == pathEnd) { - sprintf(globmsg, "The %s character path vanished while adding hints.\n File not written.", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } else { -#if ALLOWCSOUTPUT && THISISACMAIN - if (charstringoutput) { - CSWrite(); - } else { -#endif - SaveFile(); -#if ALLOWCSOUTPUT && THISISACMAIN - } -#endif - } - } - InitAll(RESTART); -} - -private -procedure AddColors(boolean extracolor) { - if (pathStart == NULL || pathStart == pathEnd) { - PrintMessage("No character path, so no hints."); -#if ALLOWCSOUTPUT && THISISACMAIN - if (charstringoutput) { - CSWrite(); - } else { -#endif - SaveFile(); /* make sure it gets saved with no coloring */ -#if ALLOWCSOUTPUT && THISISACMAIN - } -#endif - return; - } - reportErrors = TRUE; - CounterFailed = bandError = FALSE; - CheckPathBBox(); - CheckForDups(); - AddColorsSetup(); - if (!PreCheckForColoring()) { - return; - } - if (flexOK) { - hasFlex = FALSE; - AutoAddFlex(); - } - AddColorsInnerLoop(extracolor); - AddColorsCleanup(); - Test(); -} - -public -boolean DoFile(char *fname, boolean extracolor) { - integer lentop = lenTopBands, lenbot = lenBotBands; - fileName = fname; - if (!ReadCharFile(TRUE, FALSE, FALSE, TRUE)) { - sprintf(globmsg, "Cannot open %s file.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - PrintMessage(""); /* Just print the file name. */ - LogYMinMax(); - AddColors(extracolor); - lenTopBands = lentop; - lenBotBands = lenbot; - return TRUE; -} diff --git a/c/autohint/autohintlib/source/ac/cswrite.c b/c/autohint/autohintlib/source/ac/cswrite.c deleted file mode 100644 index a48b51b36..000000000 --- a/c/autohint/autohintlib/source/ac/cswrite.c +++ /dev/null @@ -1,643 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* cswrite.c */ - -#include "ac.h" -#if THISISACMAIN && ALLOWCSOUTPUT /* entire file */ - -#include "machinedep.h" - -#include "opcodes.h" -/*#include "type_crypt_lib.h"*/ - -#if __CENTERLINE__ -#define STDOUT 1 -#define DEBUG 0 -#else -#define STDOUT 0 -#endif - -#ifndef DEBUG -#define DEBUG 0 -#endif - -extern int get_char_width(char *cname); -extern Fixed GetPathLSB(void); - -FILE *cstmpfile; -extern FILE *outputfile; -private -Fixed currentx, currenty; -private -boolean firstFlex, wrtColorInfo; -private -char S0[128]; -private -PClrPoint bst; -private -char bch; -private -Fixed bx, by; -private -boolean bstB; -private -Fixed lsb; -private -boolean needtoSubLSB; -private -short trilockcount = 0; -#if DEBUG -#else -FILE *outIOFILE; -/*crypt_Token tok;*/ -long val; -#endif - -#if DEBUG -private -ws(char *str) { - fputc(' ', cstmpfile); - fputs(str, cstmpfile); -} - -#define WRTNUM(i) \ - { \ - sprintf(S0, "%ld", (i)); \ - ws(S0); \ - } - -#else -void test(void) { - fprintf(stderr, "hi"); -} - -private -void ws(char *str) { - if (str[0] != ' ') { - fputc(' ', cstmpfile); - } - fputs(str, cstmpfile); - if ((str[0] <= '0' || str[0] >= '9') && str[0] != '-' && str[strlen(str) - 1] != '\n') { - fputc('\n', cstmpfile); - } -} - -#define WRTNUM(i) \ - { \ - sprintf(S0, "%ld", (i)); \ - ws(S0); \ - } -#endif - -/*To avoid pointless hint subs*/ -#define HINTMAXSTR 2048 -static char hintmaskstr[HINTMAXSTR]; -static char prevhintmaskstr[HINTMAXSTR]; - -private -void safestrcat(char *s1, char *s2) { - if (strlen(s1) + strlen(s2) + 1 > HINTMAXSTR) { - sprintf(S0, "ERROR: Hint information overflowing buffer: %s\n", fileName); - LogMsg(S0, LOGERROR, FATALERROR, TRUE); - } else { - strcat(s1, s2); - } -} - -private -void sws(char *str) { - safestrcat(hintmaskstr, " "); - safestrcat(hintmaskstr, str); - if ((str[0] <= '0' || str[0] >= '9') && str[0] != '-') { - safestrcat(hintmaskstr, "\n"); - } -} - -#define SWRTNUM(i) \ - { \ - sprintf(S0, "%ld", (i)); \ - sws(S0); \ - } - -private -void wrtfx(Fixed f) { - Fixed i = FRnd(f); - WRTNUM(FTrunc(i)); -} - -private -procedure wrtx(Fixed x, boolean subLSB) { - Fixed i = FRnd(x); - if (subLSB) { - WRTNUM(FTrunc(i - currentx - lsb)); - } else { - WRTNUM(FTrunc(i - currentx)); - } - currentx = i; -} - -private -procedure wrty(Fixed y) { - Fixed i = FRnd(y); - WRTNUM(FTrunc(i - currenty)); - currenty = i; -} - -#define wrtcd(c) \ - wrtx(c.x, 0); \ - wrty(c.y) - -private -procedure NewBest(PClrPoint lst) { - Fixed x0, x1, y0, y1; - bst = lst; - bch = lst->c; - if (bch == 'y' || bch == 'm') { - bstB = TRUE; - x0 = lst->x0; - x1 = lst->x1; - bx = MIN(x0, x1); - } else { - bstB = FALSE; - y0 = lst->y0; - y1 = lst->y1; - by = MIN(y0, y1); - } -} - -private -procedure WriteOne(Fixed s) { /* write s to output file */ - Fixed r = UnScaleAbs(s); - if (scalinghints) { - r = FRnd(r); - } - if (FracPart(r) == 0) { - SWRTNUM(FTrunc(r)); - } else { - if (FracPart(r * 10L) == 0) { - SWRTNUM(FTrunc(FRnd(r * 10L))); - sws("10 div"); - } else { - SWRTNUM(FTrunc(FRnd(r * 100L))); - sws("100 div"); - } - } -} - -private -procedure WritePointItem(PClrPoint lst) { - switch (lst->c) { - case 'b': - WriteOne(lst->y0); - WriteOne(lst->y1 - lst->y0); - sws("hstem"); - trilockcount = 0; - break; - - case 'v': - WriteOne(lst->y0); - WriteOne(lst->y1 - lst->y0); - trilockcount++; - if (trilockcount == 3) { - sws("hstem3"); - trilockcount = 0; - } - break; - - case 'y': - WriteOne(lst->x0 - lsb); - WriteOne(lst->x1 - lst->x0); - sws("vstem"); - trilockcount = 0; - break; - - case 'm': - WriteOne(lst->x0 - lsb); - WriteOne(lst->x1 - lst->x0); - trilockcount++; - if (trilockcount == 3) { - sws("vstem3"); - trilockcount = 0; - } - break; - default: - break; - } -} - -private -procedure WrtPntLst(PClrPoint lst) { - PClrPoint ptLst; - char ch; - Fixed x0, x1, y0, y1; - - ptLst = lst; - while (lst != NULL) { /* mark all as not yet done */ - lst->done = FALSE; - lst = lst->next; - } - while (TRUE) { /* write in sort order */ - lst = ptLst; - bst = NULL; - while (lst != NULL) { /* find first not yet done as init best */ - if (!lst->done) { - NewBest(lst); - break; - } - lst = lst->next; - } - if (bst == NULL) { - break; /* finished with entire list */ - } - lst = bst->next; - while (lst != NULL) { /* search for best */ - if (!lst->done) { - ch = lst->c; - if (ch > bch) { - NewBest(lst); - } else if (ch == bch) { - if (bstB) { - x0 = lst->x0; - x1 = lst->x1; - if (MIN(x0, x1) < bx) { - NewBest(lst); - } - } else { - y0 = lst->y0; - y1 = lst->y1; - if (MIN(y0, y1) < by) { - NewBest(lst); - } - } - } - } - lst = lst->next; - } - bst->done = TRUE; /* mark as having been done */ - WritePointItem(bst); - } -} - -private -procedure wrtnewclrs(PPathElt e) { - if (!wrtColorInfo) { - return; - } - hintmaskstr[0] = '\0'; - WrtPntLst(ptLstArray[e->newcolors]); - if (strcmp(prevhintmaskstr, hintmaskstr)) { - ws("4 callsubr"); - ws(hintmaskstr); - strcpy(prevhintmaskstr, hintmaskstr); - } -} - -private -boolean IsFlex(PPathElt e) { - PPathElt e0, e1; - if (firstFlex) { - e0 = e; - e1 = e->next; - } else { - e0 = e->prev; - e1 = e; - } - return (e0 != NULL && e0->isFlex && e1 != NULL && e1->isFlex); -} - -private -procedure mt(Cd c, PPathElt e) { - if (e->newcolors != 0) { - wrtnewclrs(e); - } - if (needtoSubLSB) { - if (FRnd(c.y) == currenty) { - wrtx(c.x, 1); - ws("hmoveto"); - needtoSubLSB = FALSE; - } else if ((FRnd(c.x) - currentx - FRnd(lsb)) == 0) { - wrty(c.y); - ws("vmoveto"); - } else { - wrtx(c.x, 1); - wrty(c.y); - ws("rmoveto"); - needtoSubLSB = FALSE; - } - } else { - if (FRnd(c.y) == currenty) { - wrtx(c.x, 0); - ws("hmoveto"); - } else if (FRnd(c.x) == currentx) { - wrty(c.y); - ws("vmoveto"); - } else { - wrtcd(c); - ws("rmoveto"); - } - } -} - -private -Fixed currentFlexx, currentFlexy; -private -boolean firstFlexMT; - -private -procedure wrtFlexx(Fixed x, boolean subLSB) { - Fixed i = FRnd(x); - if (subLSB) { - WRTNUM(FTrunc(i - currentFlexx - lsb)); - } else { - WRTNUM(FTrunc(i - currentFlexx)); - } - - currentFlexx = i; -} - -private -procedure wrtFlexy(Fixed y) { - Fixed i = FRnd(y); - WRTNUM(FTrunc(i - currentFlexy)); - currentFlexy = i; -} - -private -procedure wrtFlexmt(Cd c) { - if (firstFlexMT) { - if (FRnd(c.y) == currentFlexy) { - wrtFlexx(c.x, 1); - ws("hmoveto"); - } else if ((FRnd(c.x) - currentFlexx - FRnd(lsb)) == 0) { - wrtFlexy(c.y); - ws("vmoveto"); - } else { - wrtFlexx(c.x, 1); - wrtFlexy(c.y); - ws("rmoveto"); - } - firstFlexMT = FALSE; - } else { - if (FRnd(c.y) == currentFlexy) { - wrtFlexx(c.x, 0); - ws("hmoveto"); - } else if (FRnd(c.x) == currentFlexx) { - wrtFlexy(c.y); - ws("vmoveto"); - } else { - wrtFlexx(c.x, 0); - wrtFlexy(c.y); - ws("rmoveto"); - } - } -} - -private -procedure dt(Cd c, PPathElt e) { - if (e->newcolors != 0) { - wrtnewclrs(e); - } - if (needtoSubLSB) { - if (FRnd(c.y) == currenty) { - wrtx(c.x, 1); - ws("hlineto"); - needtoSubLSB = FALSE; - } else if ((FRnd(c.x) - currentx - FRnd(lsb)) == 0) { - wrty(c.y); - ws("vlineto"); - } else if (FRnd(c.x) == currentx) { - wrty(c.y); - ws("vlineto"); - needtoSubLSB = FALSE; - } else { - wrtx(c.x, 1); - wrty(c.y); - ws("rlineto"); - needtoSubLSB = FALSE; - } - } else { - if (FRnd(c.y) == currenty) { - wrtx(c.x, 0); - ws("hlineto"); - } else if (FRnd(c.x) == currentx) { - wrty(c.y); - ws("vlineto"); - } else { - wrtx(c.x, 0); - wrty(c.y); - ws("rlineto"); - } - } -} - -private -Fixed flX, flY; -private -Cd fc1, fc2, fc3; - -private -procedure wrtflex(Cd c1, Cd c2, Cd c3, PPathElt e) { - integer dmin, delta; - boolean yflag; - Cd c13; - real shrink, r1, r2; - if (firstFlex) { - flX = currentx; - flY = currenty; - fc1 = c1; - fc2 = c2; - fc3 = c3; - firstFlex = FALSE; - return; - } - yflag = e->yFlex; - dmin = DMIN; - delta = DELTA; - ws("1 callsubr"); - if (yflag) { - if (fc3.y == c3.y) { - c13.y = c3.y; - } else { - acfixtopflt(fc3.y - c3.y, &shrink); - shrink = (real)delta / shrink; - if (shrink < 0.0) { - shrink = -shrink; - } - acfixtopflt(fc3.y - c3.y, &r1); - r1 *= shrink; - acfixtopflt(c3.y, &r2); - r1 += r2; - c13.y = acpflttofix(&r1); - } - c13.x = fc3.x; - } else { - if (fc3.x == c3.x) { - c13.x = c3.x; - } else { - acfixtopflt(fc3.x - c3.x, &shrink); - shrink = (real)delta / shrink; - if (shrink < 0.0) { - shrink = -shrink; - } - acfixtopflt(fc3.x - c3.x, &r1); - r1 *= shrink; - acfixtopflt(c3.x, &r2); - r1 += r2; - c13.x = acpflttofix(&r1); - } - c13.y = fc3.y; - } - -#define wrtpreflx2(c) \ - wrtFlexmt(c); \ - ws("2 callsubr") - - currentFlexx = currentx; - currentFlexy = currenty; - - wrtpreflx2(c13); - wrtpreflx2(fc1); - wrtpreflx2(fc2); - wrtpreflx2(fc3); - wrtpreflx2(c1); - wrtpreflx2(c2); - wrtpreflx2(c3); - currentx = c3.x; - currenty = c3.y; - - WRTNUM(dmin); - WRTNUM(FTrunc(FRnd(currentx))); - WRTNUM(FTrunc(FRnd(currenty))); - ws("0 callsubr"); - firstFlex = TRUE; -} - -private -procedure ct(Cd c1, Cd c2, Cd c3, PPathElt e) { - if (e->newcolors != 0) { - wrtnewclrs(e); - } - if (e->isFlex && IsFlex(e)) { - wrtflex(c1, c2, c3, e); - } else if (needtoSubLSB && ((FRnd(c1.x) - currentx - FRnd(lsb)) == 0) && (c2.y == c3.y)) { - wrty(c1.y); - wrtx(c2.x, 1); - wrty(c2.y); - wrtx(c3.x, 0); - ws("vhcurveto"); - needtoSubLSB = FALSE; - } else if ((FRnd(c1.x) == currentx) && (c2.y == c3.y)) { - wrty(c1.y); - wrtx(c2.x, 0); - wrty(c2.y); - wrtx(c3.x, 0); - ws("vhcurveto"); - needtoSubLSB = FALSE; - } else if ((FRnd(c1.y) == currenty) && (c2.x == c3.x)) { - wrtx(c1.x, needtoSubLSB); - wrtcd(c2); - wrty(c3.y); - ws("hvcurveto"); - needtoSubLSB = FALSE; - } else { - wrtx(c1.x, needtoSubLSB); - wrty(c1.y); - wrtcd(c2); - wrtcd(c3); - ws("rrcurveto"); - needtoSubLSB = FALSE; - } - if (firstFlex) { - firstFlexMT = FALSE; - } -} - -private -procedure cp(PPathElt e) { - if (e->newcolors != 0) { - wrtnewclrs(e); - } - ws("closepath"); -} - -void CSWrite(void) { - register PPathElt e = pathStart; - Cd c1, c2, c3; - char outfile[MAXPATHLEN], tempfilename[MAXPATHLEN]; - int width; - - width = get_char_width(fileName); - lsb = GetPathLSB(); - - sprintf(tempfilename, "%s", TEMPFILE); -#if STDOUT - cstmpfile = stdout; -#else - cstmpfile = ACOpenFile(tempfilename, "w", OPENWARN); -#endif - if (cstmpfile == NULL) { - return; - } - - wrtColorInfo = (pathStart != NULL && pathStart != pathEnd); - fprintf(cstmpfile, "## -| {"); - - wrtfx(lsb); - WRTNUM((long int)width); - ws("hsbw"); - - prevhintmaskstr[0] = '\0'; - if (wrtColorInfo && !e->newcolors) { - hintmaskstr[0] = '\0'; - WrtPntLst(ptLstArray[0]); - ws(hintmaskstr); - strcpy(prevhintmaskstr, hintmaskstr); - } - - firstFlex = TRUE; - needtoSubLSB = TRUE; - firstFlexMT = TRUE; - - currentx = currenty = 0L; - while (e != NULL) { - switch (e->type) { - case CURVETO: - c1.x = UnScaleAbs(itfmx(e->x1)); - c1.y = UnScaleAbs(itfmy(e->y1)); - c2.x = UnScaleAbs(itfmx(e->x2)); - c2.y = UnScaleAbs(itfmy(e->y2)); - c3.x = UnScaleAbs(itfmx(e->x3)); - c3.y = UnScaleAbs(itfmy(e->y3)); - ct(c1, c2, c3, e); - break; - case LINETO: - c1.x = UnScaleAbs(itfmx(e->x)); - c1.y = UnScaleAbs(itfmy(e->y)); - dt(c1, e); - break; - case MOVETO: - c1.x = UnScaleAbs(itfmx(e->x)); - c1.y = UnScaleAbs(itfmy(e->y)); - mt(c1, e); - break; - case CLOSEPATH: - cp(e); - break; - default: { - sprintf(S0, "Illegal path list for file: %s.\n", fileName); - LogMsg(S0, LOGERROR, NONFATALERROR, TRUE); - } - } - - e = e->next; - } - - ws("endchar"); - fprintf(cstmpfile, " } |- \n"); - fclose(cstmpfile); - sprintf(outfile, "%s%s", outPrefix, fileName); - RenameFile(tempfilename, outfile); -} - -#endif /*THISISACMAIN && ALLOWCSOUTPUT*/ diff --git a/c/autohint/autohintlib/source/ac/enum.c b/c/autohint/autohintlib/source/ac/enum.c deleted file mode 100644 index 2fc5a1f66..000000000 --- a/c/autohint/autohintlib/source/ac/enum.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* enum.c */ - -#include "ac.h" -#include "bftoac.h" -#include "machinedep.h" - -public -int IncludeFile(struct direct *direntry) { - if (strcmp(direntry->d_name, ".notdef") == 0) - return (TRUE); /* added 22Apr98 */ - - /* skip dot and .BAK files */ - if (direntry->d_name[0] != '.' && !BAKFile(direntry->d_name)) - return (TRUE); - return (FALSE); -} - -public -boolean DoArgsIgnoreTime(cnt, nms, extracolor) int cnt; -char *nms[]; -boolean extracolor; -{ - int i; - boolean result = TRUE; - - for (i = 0; i < cnt; i++) { - if (!DoFile(nms[i], extracolor)) - result = FALSE; - } - return result; -} diff --git a/c/autohint/autohintlib/source/ac/eval.c b/c/autohint/autohintlib/source/ac/eval.c deleted file mode 100644 index fa331e7cc..000000000 --- a/c/autohint/autohintlib/source/ac/eval.c +++ /dev/null @@ -1,594 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* eval.c */ - -#include "ac.h" - -#define MAXF (1L << 15) -private -procedure AdjustVal(pv, l1, l2, dist, d, hFlg) - Fixed *pv, - l1, l2, dist, d; -boolean hFlg; -{ - real v, q, r1, r2, rd; - Fixed abstmp; - /* DEBUG 8 BIT. To get the saem result as the old auothint, had to change from FixedOne to FixedTwo. Since the returned weight is proportional to the square of l1 and l2, - these need to be clamped to twice the old clamped value, else when the clamped values are used, the weight comes out as 1/4 of the original value. */ - if (dist < FixTwo) - dist = FixTwo; - if (l1 < FixTwo) - l1 = FixTwo; - if (l2 < FixTwo) - l2 = FixTwo; - if (ac_abs(l1) < MAXF) - r1 = (real)(l1 * l1); - else { - r1 = (real)l1; - r1 = r1 * r1; - } - if (ac_abs(l2) < MAXF) - r2 = (real)(l2 * l2); - else { - r2 = (real)l2; - r2 = r2 * r2; - } - if (ac_abs(dist) < MAXF) - q = (real)(dist * dist); - else { - q = (real)dist; - q = q * q; - } - v = (real)((1000.0 * r1 * r2) / (q * q)); - if (d <= (hFlg ? hBigDist : vBigDist)) - goto done; - acfixtopflt(d, &rd); - q = (hFlg ? hBigDistR : vBigDistR) / rd; /* 0 < q < 1.0 */ - if (q <= 0.5) { - v = 0.0; - goto done; - } - q *= q; - q *= q; - q *= q; /* raise q to 8th power */ - v = v * q; /* if d is twice bigDist, value goes down by factor of 256 */ -done: - if (v > maxVal) - v = maxVal; - else if (v > 0.0 && v < minVal) - v = minVal; - *pv = acpflttofix(&v); -} - -private -Fixed CalcOverlapDist(d, overlaplen, minlen) - Fixed d, - overlaplen, minlen; -{ - real r = (real)d, ro = (real)overlaplen, rm = (real)minlen; - r = r * ((real)(1.0 + 0.4 * (1.0 - ro / rm))); - d = (Fixed)r; - return d; -} - -#define GapDist(d) (((d) < FixInt(127)) ? FTrunc(((d) * (d)) / 40) : ((long)(((double)(d)) * (d) / (40 * 256)))) -/* if d is >= 127.0 Fixed, then d*d will overflow the signed int 16 bit value. */ -/* DEBUG 8 BIT. No idea why d*d was divided by 20, but we need to divide it by 2 more to get a dist that is only 2* the old autohint value. - With the 8.8 fixed coordinate system, we still overflow a long int with d*(d/40), so rather than casting this to a long int and then doing >>8, we need to divide by 256, then cast to long int. - I also fail to understand why the original used FTrunc, which right shifts by 256. For the current coordinate space, which has a fractional part of 8 bits, you do need to divide by 256 after doing a simple int multiply, but the previous coordinate space - has a 7 bit Fixed fraction, and should be dividing by 128. I suspect that there was a yet earlier version which used a 8 bit fraction, and this is a bug. - */ - -private -procedure EvalHPair(botSeg, topSeg, pspc, pv) - PClrSeg botSeg, - topSeg; -Fixed *pspc, *pv; -{ - Fixed brght, blft, bloc, tloc, trght, tlft, ldst, rdst; - Fixed mndist, dist, dx, dy, minlen, overlaplen, abstmp; - boolean inBotBand, inTopBand; - int i; - *pspc = 0; - brght = botSeg->sMax; - blft = botSeg->sMin; - trght = topSeg->sMax; - tlft = topSeg->sMin; - bloc = botSeg->sLoc; - tloc = topSeg->sLoc; - dy = ac_abs(bloc - tloc); - if (dy < minDist) { - *pv = 0; - return; - } - inBotBand = InBlueBand(bloc, lenBotBands, botBands); - inTopBand = InBlueBand(tloc, lenTopBands, topBands); - if (inBotBand && inTopBand) { /* delete these */ - *pv = 0; - return; - } - if (inBotBand || inTopBand) /* up the priority of these */ - *pspc = FixInt(2); - /* left is always < right */ - if ((tlft <= brght) && (trght >= blft)) { /* overlap */ - overlaplen = MIN(trght, brght) - MAX(tlft, blft); - minlen = MIN(trght - tlft, brght - blft); - if (minlen == overlaplen) - dist = dy; - else - dist = CalcOverlapDist(dy, overlaplen, minlen); - } else { /* no overlap; take closer ends */ - ldst = ac_abs(tlft - brght); - rdst = ac_abs(trght - blft); - dx = MIN(ldst, rdst); - dist = GapDist(dx); - dist += (7 * dy) / 5; /* extra penalty for nonoverlap */ - /* changed from 7/5 to 12/5 for Perpetua/Regular/ */ - /* n, r ,m and other lowercase serifs; */ - /* undid change for Berthold/AkzidenzGrotesk 9/16/91; */ - /* this did not make Perpetua any worse. */ - DEBUG_ROUND(dist) /* DEBUG 8 BIT */ - if (dx > dy) - dist *= dx / dy; - } - mndist = FixTwoMul(minDist); - dist = MAX(dist, mndist); - if (NumHStems > 0) { - Fixed w = idtfmy(dy); - w = ac_abs(w); - for (i = 0; i < NumHStems; i++) - if (w == HStems[i]) { - *pspc += FixOne; - break; - } - } - AdjustVal(pv, brght - blft, trght - tlft, dist, dy, TRUE); -} - -private -procedure HStemMiss(botSeg, topSeg) - PClrSeg botSeg, - topSeg; -{ - Fixed brght, blft, bloc, tloc, trght, tlft, abstmp; - Fixed mndist, dist, dy, minlen, overlaplen; - Fixed b, t, diff, minDiff, minW, w, sw; - int i; - if (NumHStems == 0) - return; - brght = botSeg->sMax; - blft = botSeg->sMin; - trght = topSeg->sMax; - tlft = topSeg->sMin; - bloc = botSeg->sLoc; - tloc = topSeg->sLoc; - dy = ac_abs(bloc - tloc); - if (dy < minDist) return; - /* left is always < right */ - if ((tlft <= brght) && (trght >= blft)) { /* overlap */ - overlaplen = MIN(trght, brght) - MAX(tlft, blft); - minlen = MIN(trght - tlft, brght - blft); - if (minlen == overlaplen) - dist = dy; - else - dist = CalcOverlapDist(dy, overlaplen, minlen); - } else - return; - mndist = FixTwoMul(minDist); - if (dist < mndist) - return; - minDiff = FixInt(1000); - minW = 0; - b = itfmy(bloc); - t = itfmy(tloc); - w = t - b; - /* don't check ghost bands for near misses */ - if (((w = t - b) == botGhst) || (w == topGhst)) - return; - w = ac_abs(w); - for (i = 0; i < NumHStems; i++) { - sw = HStems[i]; - diff = ac_abs(sw - w); - if (diff == 0) - return; - if (diff < minDiff) { - minDiff = diff; - minW = sw; - } - } - if (minDiff > FixInt(2)) - return; - ReportStemNearMiss(FALSE, w, minW, b, t, - (botSeg->sType == sCURVE) || (topSeg->sType == sCURVE)); -} - -private -procedure EvalVPair(leftSeg, rightSeg, pspc, pv) - PClrSeg leftSeg, - rightSeg; -Fixed *pspc, *pv; -{ - Fixed ltop, lbot, lloc, rloc, rtop, rbot, tdst, bdst; - Fixed mndist, dx, dy, dist, overlaplen, minlen, abstmp; - Fixed bonus, lbonus, rbonus; - int i; - *pspc = 0; - ltop = leftSeg->sMax; - lbot = leftSeg->sMin; - rtop = rightSeg->sMax; - rbot = rightSeg->sMin; - lloc = leftSeg->sLoc; - rloc = rightSeg->sLoc; - dx = ac_abs(lloc - rloc); - if (dx < minDist) { - *pv = 0; - return; - } - /* top is always > bot, independent of YgoesUp */ - if ((ltop >= rbot) && (lbot <= rtop)) { /* overlap */ - overlaplen = MIN(ltop, rtop) - MAX(lbot, rbot); - minlen = MIN(ltop - lbot, rtop - rbot); - if (minlen == overlaplen) - dist = dx; - else - dist = CalcOverlapDist(dx, overlaplen, minlen); - } else { /* no overlap; take closer ends */ - tdst = ac_abs(ltop - rbot); - bdst = ac_abs(lbot - rtop); - dy = MIN(tdst, bdst); - dist = (7 * dx) / 5 + GapDist(dy); /* extra penalty for nonoverlap */ - DEBUG_ROUND(dist) /* DEBUG 8 BIT */ - if (dy > dx) - dist *= dy / dx; - } - mndist = FixTwoMul(minDist); - dist = MAX(dist, mndist); - lbonus = leftSeg->sBonus; - rbonus = rightSeg->sBonus; - bonus = MIN(lbonus, rbonus); - *pspc = (bonus > 0) ? FixInt(2) : 0; /* this is for sol-eol characters */ - if (NumVStems > 0) { - Fixed w = idtfmx(dx); - w = ac_abs(w); - for (i = 0; i < NumVStems; i++) - if (w == VStems[i]) { - *pspc = *pspc + FixOne; - break; - } - } - AdjustVal(pv, ltop - lbot, rtop - rbot, dist, dx, FALSE); -} - -private -procedure VStemMiss(leftSeg, rightSeg) - PClrSeg leftSeg, - rightSeg; -{ - Fixed ltop, lbot, lloc, rloc, rtop, rbot; - Fixed mndist, dx, dist, overlaplen, minlen, abstmp; - Fixed l, r, diff, minDiff, minW, w, sw; - int i; - if (NumVStems == 0) - return; - ltop = leftSeg->sMax; - lbot = leftSeg->sMin; - rtop = rightSeg->sMax; - rbot = rightSeg->sMin; - lloc = leftSeg->sLoc; - rloc = rightSeg->sLoc; - dx = ac_abs(lloc - rloc); - if (dx < minDist) return; - /* top is always > bot, independent of YgoesUp */ - if ((ltop >= rbot) && (lbot <= rtop)) { /* overlap */ - overlaplen = MIN(ltop, rtop) - MAX(lbot, rbot); - minlen = MIN(ltop - lbot, rtop - rbot); - if (minlen == overlaplen) - dist = dx; - else - dist = CalcOverlapDist(dx, overlaplen, minlen); - } else - return; - mndist = FixTwoMul(minDist); - dist = MAX(dist, mndist); - l = itfmx(lloc); - r = itfmx(rloc); - w = ac_abs(r - l); - minDiff = FixInt(1000); - minW = 0; - for (i = 0; i < NumVStems; i++) { - sw = VStems[i]; - diff = ac_abs(sw - w); - if (diff < minDiff) { - minDiff = diff; - minW = sw; - } - if (minDiff == 0) - return; - } - if (minDiff > FixInt(2)) - return; - ReportStemNearMiss(TRUE, w, minW, l, r, - (leftSeg->sType == sCURVE) || (rightSeg->sType == sCURVE)); -} - -private -procedure InsertVValue(lft, rght, val, spc, lSeg, rSeg) - Fixed lft, - rght, val, spc; -PClrSeg lSeg, rSeg; -{ - register PClrVal item, vlist, vprev; - item = (PClrVal)Alloc(sizeof(ClrVal)); - item->vVal = val; - item->initVal = val; - item->vLoc1 = lft; - item->vLoc2 = rght; - item->vSpc = spc; - item->vSeg1 = lSeg; - item->vSeg2 = rSeg; - item->vGhst = FALSE; - vlist = valList; - vprev = NULL; - while (vlist != NULL) { - if (vlist->vLoc1 >= lft) break; - vprev = vlist; - vlist = vlist->vNxt; - } - while (vlist != NULL && vlist->vLoc1 == lft) { - if (vlist->vLoc2 >= rght) break; - vprev = vlist; - vlist = vlist->vNxt; - } - if (vprev == NULL) - valList = item; - else - vprev->vNxt = item; - item->vNxt = vlist; - if (showClrInfo && showVs) - ReportAddVVal(item); -} - -#define LePruneValue(val) ((val) < FixOne && ((val) << 10) <= pruneValue) - -private -procedure AddVValue(lft, rght, val, spc, lSeg, rSeg) - Fixed lft, - rght, val, spc; -PClrSeg lSeg, rSeg; -{ - if (val == 0) return; - if (LePruneValue(val) && spc <= 0) return; - if (lSeg != NULL && lSeg->sType == sBEND && - rSeg != NULL && rSeg->sType == sBEND) return; - if (val <= pruneD && spc <= 0 && lSeg != NULL && rSeg != NULL) { - if (lSeg->sType == sBEND || rSeg->sType == sBEND || - !CheckBBoxes(lSeg->sElt, rSeg->sElt)) - return; - } - InsertVValue(lft, rght, val, spc, lSeg, rSeg); -} - -private -procedure InsertHValue(bot, top, val, spc, bSeg, tSeg, ghst) - Fixed bot, - top, val, spc; -PClrSeg bSeg, tSeg; -boolean ghst; -{ - PClrVal item, vlist, vprev, vl; - Fixed b; - b = itfmy(bot); - vlist = valList; - vprev = NULL; - while (vlist != NULL) { - if (vlist->vLoc2 >= top) break; - vprev = vlist; - vlist = vlist->vNxt; - } - while (vlist != NULL && vlist->vLoc2 == top) { - if (vlist->vLoc1 >= bot) break; - vprev = vlist; - vlist = vlist->vNxt; - } - /* prune ghost pair that is same as non ghost pair for same segment - only if val for ghost is less than an existing val with same - top and bottom segment (vl) */ - vl = vlist; - while (ghst && vl != NULL && vl->vLoc2 == top && vl->vLoc1 == bot) { - if (!vl->vGhst && (vl->vSeg1 == bSeg || vl->vSeg2 == tSeg) && vl->vVal > val) - return; - vl = vl->vNxt; - } - item = (PClrVal)Alloc(sizeof(ClrVal)); - item->vVal = val; - item->initVal = val; - item->vSpc = spc; - item->vLoc1 = bot; - item->vLoc2 = top; - item->vSeg1 = bSeg; - item->vSeg2 = tSeg; - item->vGhst = ghst; - if (vprev == NULL) - valList = item; - else - vprev->vNxt = item; - item->vNxt = vlist; - if (showClrInfo && showHs) - ReportAddHVal(item); -} - -private -procedure AddHValue(bot, top, val, spc, bSeg, tSeg) - Fixed bot, - top, val, spc; -PClrSeg bSeg, tSeg; -{ - boolean ghst; - if (val == 0) return; - if (LePruneValue(val) && spc <= 0) return; - if (bSeg->sType == sBEND && tSeg->sType == sBEND) return; - ghst = bSeg->sType == sGHOST || tSeg->sType == sGHOST; - if (!ghst && val <= pruneD && spc <= 0) { - if (bSeg->sType == sBEND || tSeg->sType == sBEND || - !CheckBBoxes(bSeg->sElt, tSeg->sElt)) - return; - } - InsertHValue(bot, top, val, spc, bSeg, tSeg, ghst); -} - -private -real mfabs(real in) { - if (in > 0) return in; - return -in; -} - -private -Fixed CombVals(v1, v2) Fixed v1, v2; -{ - register integer i; - real r1, r2; - register real x, a, xx; - acfixtopflt(v1, &r1); - acfixtopflt(v2, &r2); - /* home brew sqrt */ - a = r1 * r2; - x = a; - for (i = 0; i < 16; i++) { - xx = ((real)0.5) * (x + a / x); - if (i >= 8 && mfabs(xx - x) <= mfabs(xx) * 0.0000001) break; - x = xx; - } - r1 += r2 + ((real)2.0) * xx; - if (r1 > maxVal) - r1 = maxVal; - else if (r1 > 0 && r1 < minVal) - r1 = minVal; - return acpflttofix(&r1); -} - -private -procedure CombineValues() { /* works for both H and V */ - PClrVal vlist, v1; - Fixed loc1, loc2; - Fixed val; - boolean match; - vlist = valList; - while (vlist != NULL) { - v1 = vlist->vNxt; - loc1 = vlist->vLoc1; - loc2 = vlist->vLoc2; - val = vlist->vVal; - match = FALSE; - while (v1 != NULL && v1->vLoc1 == loc1 && v1->vLoc2 == loc2) { - if (v1->vGhst) - val = v1->vVal; - else - val = CombVals(val, v1->vVal); - /* increase value to compensate for length squared effect */ - match = TRUE; - v1 = v1->vNxt; - } - if (match) { - while (vlist != v1) { - vlist->vVal = val; - vlist = vlist->vNxt; - } - } else - vlist = v1; - } -} - -public -procedure EvalV() { - PClrSeg lList, rList; - Fixed lft, rght; - Fixed val, spc; - valList = NULL; - lList = leftList; - while (lList != NULL) { - rList = rightList; - while (rList != NULL) { - lft = lList->sLoc; - rght = rList->sLoc; - if (lft < rght) { - EvalVPair(lList, rList, &spc, &val); - VStemMiss(lList, rList); - AddVValue(lft, rght, val, spc, lList, rList); - } - rList = rList->sNxt; - } - lList = lList->sNxt; - } - CombineValues(); -} - -public -procedure EvalH() { - PClrSeg bList, tList, lst, ghostSeg; - Fixed lstLoc, tempLoc, cntr; - Fixed val, spc; - valList = NULL; - bList = botList; - while (bList != NULL) { - tList = topList; - while (tList != NULL) { - Fixed bot, top; - bot = bList->sLoc; - top = tList->sLoc; - if ((bot < top && YgoesUp) || (bot > top && !YgoesUp)) { - EvalHPair(bList, tList, &spc, &val); - HStemMiss(bList, tList); - AddHValue(bot, top, val, spc, bList, tList); - } - tList = tList->sNxt; - } - bList = bList->sNxt; - } - ghostSeg = (PClrSeg)Alloc(sizeof(ClrSeg)); - ghostSeg->sType = sGHOST; - ghostSeg->sElt = NULL; - if (lenBotBands < 2 && lenTopBands < 2) goto done; - lst = botList; - while (lst != NULL) { - lstLoc = lst->sLoc; - if (InBlueBand(lstLoc, lenBotBands, botBands)) { - tempLoc = lstLoc; - if (YgoesUp) - tempLoc += ghostWidth; - else - tempLoc -= ghostWidth; - ghostSeg->sLoc = tempLoc; - cntr = (lst->sMax + lst->sMin) / 2; - ghostSeg->sMax = cntr + ghostLength / 2; - ghostSeg->sMin = cntr - ghostLength / 2; - DEBUG_ROUND(ghostSeg->sMax) /* DEBUG 8 BIT */ - DEBUG_ROUND(ghostSeg->sMin) /* DEBUG 8 BIT */ - spc = FixInt(2); - val = FixInt(20); - AddHValue(lstLoc, tempLoc, val, spc, lst, ghostSeg); - } - lst = lst->sNxt; - } - lst = topList; - while (lst != NULL) { - lstLoc = lst->sLoc; - if (InBlueBand(lstLoc, lenTopBands, topBands)) { - tempLoc = lstLoc; - if (!YgoesUp) - tempLoc += ghostWidth; - else - tempLoc -= ghostWidth; - ghostSeg->sLoc = tempLoc; - cntr = (lst->sMin + lst->sMax) / 2; - ghostSeg->sMax = cntr + ghostLength / 2; - ghostSeg->sMin = cntr - ghostLength / 2; - spc = FixInt(2); - val = FixInt(20); - AddHValue(tempLoc, lstLoc, val, spc, ghostSeg, lst); - } - lst = lst->sNxt; - } -done: - CombineValues(); -} diff --git a/c/autohint/autohintlib/source/ac/fix.c b/c/autohint/autohintlib/source/ac/fix.c deleted file mode 100644 index 48d6d3fd1..000000000 --- a/c/autohint/autohintlib/source/ac/fix.c +++ /dev/null @@ -1,363 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* fix.c */ - -#include "ac.h" -#include "machinedep.h" - -#define maxFixes (100) -private -Fixed HFixYs[maxFixes], HFixDYs[maxFixes]; -private -Fixed VFixXs[maxFixes], VFixDXs[maxFixes]; -private -integer HFixCount, VFixCount; -private -Fixed bPrev, tPrev; - -public -procedure InitFix(reason) integer reason; -{ - switch (reason) { - case STARTUP: - case RESTART: - HFixCount = VFixCount = 0; - bPrev = tPrev = FixedPosInf; - } -} - -private -procedure RecordHFix(y, dy) Fixed y, dy; -{ - HFixYs[HFixCount] = y; - HFixDYs[HFixCount] = dy; - HFixCount++; -} - -private -procedure RecordVFix(x, dx) Fixed x, dx; -{ - VFixXs[VFixCount] = x; - VFixDXs[VFixCount] = dx; - VFixCount++; -} - -private -procedure RecordForFix(vert, w, minW, b, t) - boolean vert; -Fixed w, minW, b, t; -{ - Fixed mn, mx, delta; - if (b < t) { - mn = b; - mx = t; - } else { - mn = t; - mx = b; - } - if (!vert && HFixCount + 4 < maxFixes && autoHFix) { - Fixed fixdy = w - minW; - if (abs(fixdy) <= FixOne) { - RecordHFix(mn, fixdy); - RecordHFix(mx - fixdy, fixdy); - } else { - delta = FixHalfMul(fixdy); - RecordHFix(mn, delta); - RecordHFix(mn + fixdy, -delta); - RecordHFix(mx, -delta); - RecordHFix(mx - fixdy, delta); - } - } else if (vert && VFixCount + 4 < maxFixes && autoVFix) { - Fixed fixdx = w - minW; - if (abs(fixdx) <= FixOne) { - RecordVFix(mn, fixdx); - RecordVFix(mx - fixdx, fixdx); - } else { - delta = FixHalfMul(fixdx); - RecordVFix(mn, delta); - RecordVFix(mn + fixdx, -delta); - RecordVFix(mx, -delta); - RecordVFix(mx - fixdx, delta); - } - } -} - -private -boolean CheckForInsideBands(loc, blues, numblues) - Fixed loc, - *blues; -integer numblues; -{ - integer i; - for (i = 0; i < numblues; i += 2) { - if (loc >= blues[i] && loc <= blues[i + 1]) return TRUE; - } - return FALSE; -} - -#define bFuzz (FixInt(6)) -private -procedure CheckForNearBands(loc, blues, numblues) - Fixed loc, - *blues; -integer numblues; -{ - integer i; - boolean bottom = TRUE; - for (i = 0; i < numblues; i++) { - if ((bottom && loc >= blues[i] - bFuzz && loc < blues[i]) || - (!bottom && loc <= blues[i] + bFuzz && loc > blues[i])) { -#if 0 - ReportBandError(bottom? "below" : "above", loc, blues[i]); -#else - ReportBandNearMiss(bottom ? "below" : "above", loc, blues[i]); -#endif -#if 0 - bandError = TRUE; -#endif - } - bottom = !bottom; - } -} - -public -boolean FindLineSeg(loc, sL) Fixed loc; -PClrSeg sL; -{ - while (sL != NULL) { - if (sL->sLoc == loc && sL->sType == sLINE) return TRUE; - sL = sL->sNxt; - } - return FALSE; -} - -#if 1 -/* Traverses hSegList to check for near misses to - the horizontal alignment zones. The list contains - segments that may or may not have hints added. */ -public -procedure CheckTfmVal(hSegList, bandList, length) - PClrSeg hSegList; -Fixed *bandList; -long int length; -{ - Fixed tfmval; - PClrSeg sList = hSegList; - - while (sList != NULL) { - tfmval = itfmy(sList->sLoc); - if ((length >= 2) && !bandError && - !CheckForInsideBands(tfmval, bandList, length)) - CheckForNearBands(tfmval, bandList, length); - sList = sList->sNxt; - } -} -#else -public -procedure CheckTfmVal(b, t, vert) Fixed b, t; -boolean vert; -{ - if (t < b) { - Fixed tmp; - tmp = t; - t = b; - b = tmp; - } - if (!vert && (lenTopBands >= 2 || lenBotBands >= 2) && !bandError && - !CheckForInsideBands(t, topBands, lenTopBands) && - !CheckForInsideBands(b, botBands, lenBotBands)) { - CheckForNearBands(t, topBands, lenTopBands); - CheckForNearBands(b, botBands, lenBotBands); - } -} -#endif - -public -procedure CheckVal(val, vert) PClrVal val; -boolean vert; -{ - Fixed *stems; - integer numstems, i; - Fixed wd, diff, minDiff, minW, b, t, w; - boolean curve = FALSE; - if (vert) { - stems = VStems; - numstems = NumVStems; - b = itfmx(val->vLoc1); - t = itfmx(val->vLoc2); - } else { - stems = HStems; - numstems = NumHStems; - b = itfmy(val->vLoc1); - t = itfmy(val->vLoc2); - } - w = abs(t - b); - minDiff = FixInt(1000); - minW = 0; - for (i = 0; i < numstems; i++) { - wd = stems[i]; - diff = abs(wd - w); - if (diff < minDiff) { - minDiff = diff; - minW = wd; - if (minDiff == 0) break; - } - } - if (minDiff == 0 || minDiff > FixInt(2)) - return; - if (b != bPrev || t != tPrev) { - if ((vert && (!FindLineSeg(val->vLoc1, leftList) || - !FindLineSeg(val->vLoc2, rightList))) || - (!vert && (!FindLineSeg(val->vLoc1, botList) || - !FindLineSeg(val->vLoc2, topList)))) - curve = TRUE; - if (!val->vGhst) - ReportStemNearMiss(vert, w, minW, b, t, curve); - } - bPrev = b; - tPrev = t; - if ((vert && autoVFix) || (!vert && autoHFix)) - RecordForFix(vert, w, minW, b, t); -} - -public -procedure CheckVals(vlst, vert) PClrVal vlst; -boolean vert; -{ - while (vlst != NULL) { - CheckVal(vlst, vert); - vlst = vlst->vNxt; - } -} - -private -procedure FixH(e, fixy, fixdy) PPathElt e; -Fixed fixy, fixdy; -{ - PPathElt prev, nxt; - RMovePoint(0L, fixdy, cpStart, e); - RMovePoint(0L, fixdy, cpEnd, e); - prev = e->prev; - if (prev != NULL && prev->type == CURVETO && prev->y2 == fixy) - RMovePoint(0L, fixdy, cpCurve2, prev); - if (e->type == CLOSEPATH) e = GetDest(e); - nxt = e->next; - if (nxt != NULL && nxt->type == CURVETO && nxt->y1 == fixy) - RMovePoint(0L, fixdy, cpCurve1, nxt); -} - -private -procedure FixHs(fixy, fixdy) - Fixed fixy, - fixdy; -{ /* y dy in user space */ - PPathElt e; - Fixed xlst, ylst, xinit, yinit; - fixy = tfmy(fixy); - fixdy = dtfmy(fixdy); - e = pathStart; - while (e != NULL) { - switch (e->type) { - case MOVETO: - xlst = xinit = e->x; - ylst = yinit = e->y; - break; - case LINETO: - if (e->y == fixy && ylst == fixy) - FixH(e, fixy, fixdy); - xlst = e->x; - ylst = e->y; - break; - case CURVETO: - xlst = e->x3; - ylst = e->y3; - break; - case CLOSEPATH: - if (yinit == fixy && ylst == fixy && xinit != xlst) - FixH(e, fixy, fixdy); - break; - default: { - FlushLogFiles(); - sprintf(globmsg, "Illegal operator in path list in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } - e = e->next; - } -} - -private -procedure FixV(e, fixx, fixdx) PPathElt e; -Fixed fixx, fixdx; -{ - PPathElt prev, nxt; - RMovePoint(fixdx, 0L, cpStart, e); - RMovePoint(fixdx, 0L, cpEnd, e); - prev = e->prev; - if (prev != NULL && prev->type == CURVETO && prev->x2 == fixx) - RMovePoint(fixdx, 0L, cpCurve2, prev); - if (e->type == CLOSEPATH) e = GetDest(e); - nxt = e->next; - if (nxt != NULL && nxt->type == CURVETO && nxt->x1 == fixx) - RMovePoint(fixdx, 0L, cpCurve1, nxt); -} - -private -procedure FixVs(fixx, fixdx) - Fixed fixx, - fixdx; -{ /* x dx in user space */ - PPathElt e; - Fixed xlst, ylst, xinit, yinit; - fixx = tfmx(fixx); - fixdx = dtfmx(fixdx); - e = pathStart; - while (e != NULL) { - switch (e->type) { - case MOVETO: - xlst = xinit = e->x; - ylst = yinit = e->y; - break; - case LINETO: - if (e->x == fixx && xlst == fixx) - FixV(e, fixx, fixdx); - xlst = e->x; - ylst = e->y; - break; - case CURVETO: - xlst = e->x3; - ylst = e->y3; - break; - case CLOSEPATH: - if (xinit == fixx && xlst == fixx && yinit != ylst) - FixV(e, fixx, fixdx); - break; - default: { - FlushLogFiles(); - sprintf(globmsg, "Illegal operator in point list in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } - e = e->next; - } -} - -public -boolean DoFixes() { - boolean didfixes = FALSE; - integer i; - if (HFixCount > 0 && autoHFix) { - PrintMessage("Fixing horizontal near misses."); - didfixes = TRUE; - for (i = 0; i < HFixCount; i++) - FixHs(HFixYs[i], HFixDYs[i]); - } - if (VFixCount > 0 && autoVFix) { - PrintMessage("Fixing vertical near misses."); - didfixes = TRUE; - for (i = 0; i < VFixCount; i++) - FixVs(VFixXs[i], VFixDXs[i]); - } - return didfixes; -} diff --git a/c/autohint/autohintlib/source/ac/flat.c b/c/autohint/autohintlib/source/ac/flat.c deleted file mode 100644 index 18b79b1f6..000000000 --- a/c/autohint/autohintlib/source/ac/flat.c +++ /dev/null @@ -1,375 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* flat.c */ - -#include "ac.h" - -private -procedure FMiniFltn(f0, f1, f2, f3, pfr, inside) - Cd f0, - f1, f2, f3; -register PFltnRec pfr; -boolean inside; -{ - /* Like FFltnCurve, but assumes abs(deltas) <= 127 pixels */ - /* 8 bits of fraction gives enough precision for splitting curves */ -#define MFix(f) (f) -#define UnMFix(f) (f) -#define MFixInt(f) ((f) << 8) -#define MiniFltnMaxDepth (6) -#define inrect (p[-10]) -#define inbbox (p[-9]) -#define c0x (p[-8]) -#define c0y (p[-7]) -#define c1x (p[-6]) -#define c1y (p[-5]) -#define c2x (p[-4]) -#define c2y (p[-3]) -#define c3x (p[-2]) -#define c3y (p[-1]) -#define inrect2 (p[0]) -#define bbox2 (p[1]) -#define d0x (p[2]) -#define d0y (p[3]) -#define d1x (p[4]) -#define d1y (p[5]) -#define d2x (p[6]) -#define d2y (p[7]) -#define d3x (p[8]) -#define d3y (p[9]) -#define MiniBlkSz (10) -#define mdpt(a, b) (((long)(a) + (long)(b)) >> 1) - long int cds[MiniBlkSz * MiniFltnMaxDepth], dpth, eps; - long int bbLLX, bbLLY, bbURX, bbURY; - register long int *p; - p = cds; - dpth = 1; - *(p++) = inside; /* initial value of inrect2. Set to True by caller, and is never set false. */ - *(p++) = FALSE; /* inbbox2 starts out FALSE */ - /* shift coordinates so that lower left of BBox is at (0,0)*/ - /* This fills the first MiniBlkSz series of ints with the start point, control point, end end point - (x,y) values for the curve, minus the lower left (x,y) for the curve. - One each pass, it splits the curve in two, replacing the current MiniBlkSz series of ints with the first - of the two split curves, and the next MiniBlkSz series of ints with the second of the curves. - It then sets the pointer p so that the second MiniBlkSz series of ints becomes the current set, - and iterates, thereby splitting the second curve in two parts. This continues until the control points - get very close to the start point, or we reach the limit of MiniFltnMaxDepth iterations. At that time, - the PathBBox update function is called with the end point of the first of the most recently split curves. - -Once the the current set of points meets the test that one of the control points is very close to the start point, - then the algoithm iteratively steps back to the previous set. If thsi does not meet the test, the algorith - iterates forward again - */ - /*DEBUG 8 BIT. AFter chaning the fractinoal part to 8 bits form 7 bits, had to change all the short values to long in order to not overflow math operations. The only reason these were all shorts was speed and memory issues in 1986. */ - { - register Fixed llx, lly; - llx = pfr->llx; - lly = pfr->lly; - *(p++) = (long)MFix(f0.x - llx); - *(p++) = (long)MFix(f0.y - lly); - *(p++) = (long)MFix(f1.x - llx); - *(p++) = (long)MFix(f1.y - lly); - *(p++) = (long)MFix(f2.x - llx); - *(p++) = (long)MFix(f2.y - lly); - *(p++) = (long)MFix(f3.x - llx); - *(p++) = (long)MFix(f3.y - lly); - } - if (!inrect) { - register Fixed c, f128; - c = (long)pfr->ll.x; - bbLLX = (c <= 0) ? 0 : (long)MFix(c); - c = (long)pfr->ll.y; - bbLLY = (c <= 0) ? 0 : (long)MFix(c); - f128 = FixInt(128); - c = (long)pfr->ur.x; - bbURX = (c >= f128) ? 0x7fff : (long)MFix(c); - c = (long)pfr->ur.y; - bbURY = (c >= f128) ? 0x7fff : (long)MFix(c); - } - eps = (long)MFix(pfr->feps); - // if (eps < 8) - // eps = 8; /* Brotz patch */ - if (eps < 16) /* DEBUG 8 BIT FIX */ - eps = 16; /* Brotz patch */ - while (TRUE) { - /* Iterate until curve has been flattened into MiniFltnMaxDepth segments */ - if (dpth == MiniFltnMaxDepth) - goto ReportC3; - if (!inrect) { - register long int llx, lly, urx, ury, c; - llx = urx = c0x; - if ((c = c1x) < llx) - llx = c; - else if (c > urx) - urx = c; - if ((c = c2x) < llx) - llx = c; - else if (c > urx) - urx = c; - if ((c = c3x) < llx) - llx = c; - else if (c > urx) - urx = c; - if (urx < bbLLX || llx > bbURX) - goto ReportC3; - lly = ury = c0y; - if ((c = c1y) < lly) - lly = c; - else if (c > ury) - ury = c; - if ((c = c2y) < lly) - lly = c; - else if (c > ury) - ury = c; - if ((c = c3y) < lly) - lly = c; - else if (c > ury) - ury = c; - if (ury < bbLLY || lly > bbURY) - goto ReportC3; - if (urx <= bbURX && ury <= bbURY && - llx >= bbLLX && lly >= bbLLY) inrect = TRUE; - } - if (!inbbox) { - register long int mrgn = eps, r0, r3, ll, ur, c; - r0 = c0x; - r3 = c3x; - if (r0 < r3) { - ll = r0 - mrgn; - ur = r3 + mrgn; - } else { - ll = r3 - mrgn; - ur = r0 + mrgn; - } - if (ur < 0) - ur = MFixInt(128) - 1; - c = c1x; - if (c > ll && c < ur) { - c = c2x; - if (c > ll && c < ur) { - r0 = c0y; - r3 = c3y; - if (r0 < r3) { - ll = r0 - mrgn; - ur = r3 + mrgn; - } else { - ll = r3 - mrgn; - ur = r0 + mrgn; - } - if (ur < 0) - ur = MFixInt(128) - 1; - c = c1y; - if (c > ll && c < ur) { - c = c2y; - if (c > ll && c < ur) inbbox = TRUE; - } - } - } - } - if (inbbox) { - register long int eqa, eqb, x, y; - register Fixed EPS, d; - x = c0x; - y = c0y; - eqa = c3y - y; - eqb = x - c3x; - if (eqa == 0 && eqb == 0) goto ReportC3; - EPS = ((abs(eqa) > abs(eqb)) ? (long)eqa : (long)eqb) * (long)eps; - if (EPS < 0) EPS = -EPS; - d = (long)eqa * (long)(c1x - x); - d += (long)eqb * (long)(c1y - y); - if (abs(d) < EPS) { - d = (long)eqa * (long)(c2x - x); - d += (long)eqb * (long)(c2y - y); - if (abs(d) < EPS) - goto ReportC3; - } - } - { /* Bezier divide */ - register long int c0, c1, c2, d1, d2, d3; - d0x = c0 = c0x; - c1 = c1x; - c2 = c2x; - d1x = d1 = (long)mdpt(c0, c1); - d3 = (long)mdpt(c1, c2); - d2x = d2 = (long)mdpt(d1, d3); - c2x = c2 = (long)mdpt(c2, c3x); - c1x = c1 = (long)mdpt(d3, c2); - c0x = d3x = (long)mdpt(d2, c1); - d0y = c0 = c0y; - c1 = c1y; - c2 = c2y; - d1y = d1 = (long)mdpt(c0, c1); - d3 = (long)mdpt(c1, c2); - d2y = d2 = (long)mdpt(d1, d3); - c2y = c2 = (long)mdpt(c2, c3y); - c1y = c1 = (long)mdpt(d3, c2); - c0y = d3y = (long)mdpt(d2, c1); - bbox2 = inbbox; - inrect2 = inrect; - p += MiniBlkSz; - dpth++; - continue; - } - ReportC3 : { - Cd c; - if (--dpth == 0) - c = f3; - else { - c.x = UnMFix(c3x) + pfr->llx; - c.y = UnMFix(c3y) + pfr->lly; - } - (*pfr->report)(c); // call FPBBoxPt() to reset bbox. - if (dpth == 0) - return; - p -= MiniBlkSz; - } - } -} /* end of FMiniFltn */ -#undef MFix -#undef UnMFix -#undef MFixInt -#undef MiniFltnMaxDepth -#undef inrect -#undef inbbox -#undef c0x -#undef c0y -#undef c1x -#undef c1y -#undef c2x -#undef c2y -#undef c3x -#undef c3y -#undef inrect2 -#undef bbox2 -#undef d0x -#undef d0y -#undef d1x -#undef d1y -#undef d2x -#undef d2y -#undef d3x -#undef d3y -#undef MiniBlkSz -#undef mdpt - -#define FixedMidPoint(m, a, b) \ - (m).x = ((a).x + (b).x) >> 1; \ - (m).y = ((a).y + (b).y) >> 1 - -#define FixedBezDiv(a0, a1, a2, a3, b0, b1, b2, b3) \ - b3 = a3; \ - FixedMidPoint(b2, a2, a3); \ - FixedMidPoint(a3, a1, a2); \ - FixedMidPoint(a1, a0, a1); \ - FixedMidPoint(a2, a1, a3); \ - FixedMidPoint(b1, a3, b2); \ - FixedMidPoint(b0, a2, b1); \ - a3 = b0 - -private -procedure FFltnCurve(c0, c1, c2, c3, pfr, inrect) - /* inrect = !testRect */ - Cd c0, - c1, c2, c3; -register PFltnRec pfr; -register boolean inrect; -/* Like FltnCurve, but works in the Fixed domain. */ -/* abs values of coords must be < 2^14 so will not overflow when - find midpoint by add and shift */ -{ - Cd d0, d1, d2, d3; - register Fixed llx, lly, urx, ury; - if (c0.x == c1.x && c0.y == c1.y && c2.x == c3.x && c2.y == c3.y) - goto ReportC3; /* it is a flat curve - do not need to flatten. */ - if (pfr->limit <= 0) - goto ReportC3; - { /* set initial bbox of llx,lly, urx, ury from bez control and end points */ - register Fixed c; - llx = urx = c0.x; - if ((c = c1.x) < llx) - llx = c; - else if (c > urx) - urx = c; - if ((c = c2.x) < llx) - llx = c; - else if (c > urx) - urx = c; - if ((c = c3.x) < llx) - llx = c; - else if (c > urx) - urx = c; - lly = ury = c0.y; - if ((c = c1.y) < lly) - lly = c; - else if (c > ury) - ury = c; - if ((c = c2.y) < lly) - lly = c; - else if (c > ury) - ury = c; - if ((c = c3.y) < lly) - lly = c; - else if (c > ury) - ury = c; - } - - if (!inrect) { - if (urx < pfr->ll.x || llx > pfr->ur.x || - ury < pfr->ll.y || lly > pfr->ur.y) - goto ReportC3; - if (urx <= pfr->ur.x && ury <= pfr->ur.y && - llx >= pfr->ll.x && lly >= pfr->ll.y) - inrect = TRUE; - } - { /* if the height or width of the initial bbox is > 256, split it, and this function on the two parts. */ - register Fixed th; - th = FixInt(256); /* DEBUG 8 Bit */ /* delta threshhold of 127 pixels */ - /* The reason we split this is that the FMiniFltn function uses and 8.8 Fixed to hold coordindate data - so the max - intger part must be no more than 127, to allow for signed values. This made sense when an int was 16 bits, but is no longer an optimization. I still subdivide, so that FMiniFltn, which subdivides into a maximum of 6 curve segments, will be owkring with short segments. */ - if (urx - llx >= th || ury - lly >= th) { - goto Split; - } - } - pfr->llx = llx; - pfr->lly = lly; - if (!inrect) { - pfr->ll.x -= llx; - pfr->ur.x -= llx; - pfr->ll.y -= lly; - pfr->ur.y -= lly; - } - FMiniFltn(c0, c1, c2, c3, pfr, inrect); - if (!inrect) { - pfr->ll.x += llx; - pfr->ur.x += llx; - pfr->ll.y += lly; - pfr->ur.y += lly; - } - return; - -Split: - /* Split the bez curve in half */ - FixedBezDiv(c0, c1, c2, c3, d0, d1, d2, d3); - pfr->limit--; - FFltnCurve(c0, c1, c2, c3, pfr, inrect); - FFltnCurve(d0, d1, d2, d3, pfr, inrect); - pfr->limit++; - return; - -ReportC3: - (*pfr->report)(c3); -} - -public -procedure FltnCurve(c0, c1, c2, c3, pfr) - Cd c0, - c1, c2, c3; -PFltnRec pfr; -{ - pfr->limit = 6; /* limit on how many times a bez curve can be split in half by recursive calls to FFltnCurve() */ - /* pfr->feps = FixHalf; */ - pfr->feps = FixOne; /* DEBUG 8 BIT FIX */ - FFltnCurve(c0, c1, c2, c3, pfr, TRUE); -} diff --git a/c/autohint/autohintlib/source/ac/fontinfo.c b/c/autohint/autohintlib/source/ac/fontinfo.c deleted file mode 100644 index e8a559ad8..000000000 --- a/c/autohint/autohintlib/source/ac/fontinfo.c +++ /dev/null @@ -1,248 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* fontinfo.c */ - -#include "ac.h" -#include "fipublic.h" - -#define UNDEFINED (MAXinteger) - -public -integer NumHColors, NumVColors; - -private -procedure ParseStems(kw, stems, pnum) char *kw; -Fixed *stems; -integer *pnum; -{ - int istems[MAXSTEMS], i; - ParseIntStems(kw, ACOPTIONAL, MAXSTEMS, istems, pnum, NULL); - for (i = 0; i < *pnum; i++) - stems[i] = FixInt(istems[i]); -} - -private -procedure GetKeyValue(keyword, optional, value) char *keyword; -boolean optional; -long int *value; -{ - char *fontinfostr; - - fontinfostr = GetFntInfo(keyword, optional); - - if ((fontinfostr != NULL) && (fontinfostr[0] != 0)) { - *value = atol(fontinfostr); -#if DOMEMCHECK - memck_free(fontinfostr); -#else - ACFREEMEM(fontinfostr); -#endif - } - return; -} - -private -procedure GetKeyFixedValue(char *keyword, boolean optional, Fixed *value) { - char *fontinfostr; - float tempValue; - - fontinfostr = GetFntInfo(keyword, optional); - - if ((fontinfostr != NULL) && (fontinfostr[0] != 0)) { - sscanf(fontinfostr, "%g", &tempValue); - *value = (Fixed)tempValue * (1 << FixShift); -#if DOMEMCHECK - memck_free(fontinfostr); -#else - ACFREEMEM(fontinfostr); -#endif - } - return; -} - -public -boolean ReadFontInfo() { - char *fontinfostr; - long - AscenderHeight, - AscenderOvershoot, - BaselineYCoord, - BaselineOvershoot, - Baseline5, - Baseline5Overshoot, - Baseline6, - Baseline6Overshoot, - CapHeight, - CapOvershoot, - DescenderHeight, - DescenderOvershoot, - FigHeight, - FigOvershoot, - Height5, - Height5Overshoot, - Height6, - Height6Overshoot, - LcHeight, - LcOvershoot, - OrdinalBaseline, - OrdinalOvershoot, - SuperiorBaseline, - SuperiorOvershoot; - boolean ORDINARYCOLORING = !scalinghints && writecoloredbez; - - AscenderHeight = - AscenderOvershoot = - BaselineYCoord = - BaselineOvershoot = - Baseline5 = - Baseline5Overshoot = - Baseline6 = - Baseline6Overshoot = - CapHeight = - CapOvershoot = - DescenderHeight = - DescenderOvershoot = - FigHeight = - FigOvershoot = - Height5 = - Height5Overshoot = - Height6 = - Height6Overshoot = - LcHeight = - LcOvershoot = - OrdinalBaseline = - OrdinalOvershoot = - SuperiorBaseline = - SuperiorOvershoot = UNDEFINED; /* mark as undefined */ - NumHStems = NumVStems = 0; - NumHColors = NumVColors = 0; - lenBotBands = lenTopBands = 0; - - if (scalinghints) { - SetFntInfoFileName(SCALEDHINTSINFO); - } else { /* check for FlexOK, AuxHStems, AuxVStems */ - /* for intelligent scaling, it's too hard to check these */ - ParseStems("StemSnapH", HStems, &NumHStems); - ParseStems("StemSnapV", VStems, &NumVStems); - if (NumHStems == 0) { - ParseStems("DominantH", HStems, &NumHStems); - ParseStems("DominantV", VStems, &NumVStems); - } - } - fontinfostr = GetFntInfo("FlexOK", !ORDINARYCOLORING); - flexOK = (fontinfostr != NULL) && (fontinfostr[0] != '\0') && strcmp(fontinfostr, "false"); - -#if DOMEMCHECK - memck_free(fontinfostr); -#else - ACFREEMEM(fontinfostr); -#endif - fontinfostr = GetFntInfo("FlexStrict", TRUE); - if (fontinfostr != NULL) - flexStrict = strcmp(fontinfostr, "false"); -#if DOMEMCHECK - memck_free(fontinfostr); -#else - ACFREEMEM(fontinfostr); -#endif - - /* get bluefuzz. It is already set to its default value in ac.c::InitData(). - GetKeyFixedValue does nto change the value if it is not present in fontinfo. */ - GetKeyFixedValue("BlueFuzz", ACOPTIONAL, &bluefuzz); - - /* Check for counter coloring characters. */ - if ((fontinfostr = GetFntInfo("VCounterChars", ACOPTIONAL)) != NULL) { - NumVColors = AddCounterColorChars(fontinfostr, VColorList); -#if DOMEMCHECK - memck_free(fontinfostr); -#else - ACFREEMEM(fontinfostr); -#endif - }; - if ((fontinfostr = GetFntInfo("HCounterChars", ACOPTIONAL)) != NULL) { - NumHColors = AddCounterColorChars(fontinfostr, HColorList); -#if DOMEMCHECK - memck_free(fontinfostr); -#else - ACFREEMEM(fontinfostr); -#endif - }; - GetKeyValue("AscenderHeight", ACOPTIONAL, &AscenderHeight); - GetKeyValue("AscenderOvershoot", ACOPTIONAL, &AscenderOvershoot); - GetKeyValue("BaselineYCoord", !ORDINARYCOLORING, &BaselineYCoord); - GetKeyValue("BaselineOvershoot", !ORDINARYCOLORING, &BaselineOvershoot); - GetKeyValue("Baseline5", ACOPTIONAL, &Baseline5); - GetKeyValue("Baseline5Overshoot", ACOPTIONAL, &Baseline5Overshoot); - GetKeyValue("Baseline6", ACOPTIONAL, &Baseline6); - GetKeyValue("Baseline6Overshoot", ACOPTIONAL, &Baseline6Overshoot); - GetKeyValue("CapHeight", !ORDINARYCOLORING, &CapHeight); - GetKeyValue("CapOvershoot", !ORDINARYCOLORING, &CapOvershoot); - GetKeyValue("DescenderHeight", ACOPTIONAL, &DescenderHeight); - GetKeyValue("DescenderOvershoot", ACOPTIONAL, &DescenderOvershoot); - GetKeyValue("FigHeight", ACOPTIONAL, &FigHeight); - GetKeyValue("FigOvershoot", ACOPTIONAL, &FigOvershoot); - GetKeyValue("Height5", ACOPTIONAL, &Height5); - GetKeyValue("Height5Overshoot", ACOPTIONAL, &Height5Overshoot); - GetKeyValue("Height6", ACOPTIONAL, &Height6); - GetKeyValue("Height6Overshoot", ACOPTIONAL, &Height6Overshoot); - GetKeyValue("LcHeight", ACOPTIONAL, &LcHeight); - GetKeyValue("LcOvershoot", ACOPTIONAL, &LcOvershoot); - GetKeyValue("OrdinalBaseline", ACOPTIONAL, &OrdinalBaseline); - GetKeyValue("OrdinalOvershoot", ACOPTIONAL, &OrdinalOvershoot); - GetKeyValue("SuperiorBaseline", ACOPTIONAL, &SuperiorBaseline); - GetKeyValue("SuperiorOvershoot", ACOPTIONAL, &SuperiorOvershoot); - - lenBotBands = lenTopBands = 0; - if (BaselineYCoord != UNDEFINED && BaselineOvershoot != UNDEFINED) { - botBands[lenBotBands++] = ScaleAbs(FixInt(BaselineYCoord + BaselineOvershoot)); - botBands[lenBotBands++] = ScaleAbs(FixInt(BaselineYCoord)); - } - if (Baseline5 != UNDEFINED && Baseline5Overshoot != UNDEFINED) { - botBands[lenBotBands++] = ScaleAbs(FixInt(Baseline5 + Baseline5Overshoot)); - botBands[lenBotBands++] = ScaleAbs(FixInt(Baseline5)); - } - if (Baseline6 != UNDEFINED && Baseline6Overshoot != UNDEFINED) { - botBands[lenBotBands++] = ScaleAbs(FixInt(Baseline6 + Baseline6Overshoot)); - botBands[lenBotBands++] = ScaleAbs(FixInt(Baseline6)); - } - if (SuperiorBaseline != UNDEFINED && SuperiorOvershoot != UNDEFINED) { - botBands[lenBotBands++] = ScaleAbs(FixInt(SuperiorBaseline + SuperiorOvershoot)); - botBands[lenBotBands++] = ScaleAbs(FixInt(SuperiorBaseline)); - } - if (OrdinalBaseline != UNDEFINED && OrdinalOvershoot != UNDEFINED) { - botBands[lenBotBands++] = ScaleAbs(FixInt(OrdinalBaseline + OrdinalOvershoot)); - botBands[lenBotBands++] = ScaleAbs(FixInt(OrdinalBaseline)); - } - if (DescenderHeight != UNDEFINED && DescenderOvershoot != UNDEFINED) { - botBands[lenBotBands++] = ScaleAbs(FixInt(DescenderHeight + DescenderOvershoot)); - botBands[lenBotBands++] = ScaleAbs(FixInt(DescenderHeight)); - } - if (CapHeight != UNDEFINED && CapOvershoot != UNDEFINED) { - topBands[lenTopBands++] = ScaleAbs(FixInt(CapHeight)); - topBands[lenTopBands++] = ScaleAbs(FixInt(CapHeight + CapOvershoot)); - } - if (LcHeight != UNDEFINED && LcOvershoot != UNDEFINED) { - topBands[lenTopBands++] = ScaleAbs(FixInt(LcHeight)); - topBands[lenTopBands++] = ScaleAbs(FixInt(LcHeight + LcOvershoot)); - } - if (AscenderHeight != UNDEFINED && AscenderOvershoot != UNDEFINED) { - topBands[lenTopBands++] = ScaleAbs(FixInt(AscenderHeight)); - topBands[lenTopBands++] = ScaleAbs(FixInt(AscenderHeight + AscenderOvershoot)); - } - if (FigHeight != UNDEFINED && FigOvershoot != UNDEFINED) { - topBands[lenTopBands++] = ScaleAbs(FixInt(FigHeight)); - topBands[lenTopBands++] = ScaleAbs(FixInt(FigHeight + FigOvershoot)); - } - if (Height5 != UNDEFINED && Height5Overshoot != UNDEFINED) { - topBands[lenTopBands++] = ScaleAbs(FixInt(Height5)); - topBands[lenTopBands++] = ScaleAbs(FixInt(Height5 + Height5Overshoot)); - } - if (Height6 != UNDEFINED && Height6Overshoot != UNDEFINED) { - topBands[lenTopBands++] = ScaleAbs(FixInt(Height6)); - topBands[lenTopBands++] = ScaleAbs(FixInt(Height6 + Height6Overshoot)); - } - if (scalinghints) - ResetFntInfoFileName(); - return TRUE; -} diff --git a/c/autohint/autohintlib/source/ac/gen.c b/c/autohint/autohintlib/source/ac/gen.c deleted file mode 100644 index 2ddb47e18..000000000 --- a/c/autohint/autohintlib/source/ac/gen.c +++ /dev/null @@ -1,1007 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -#include "ac.h" -#include "bftoac.h" - -extern procedure ReportRemVSeg(Fixed from, Fixed to, Fixed loc); -extern procedure ReportRemHSeg(Fixed from, Fixed to, Fixed loc); - -private -PSegLnkLst Hlnks, Vlnks; -private -integer cpFrom, cpTo; - -public -procedure InitGen(reason) integer reason; -{ - integer i; - switch (reason) { - case STARTUP: - case RESTART: - for (i = 0; i < 4; i++) segLists[i] = NULL; - Hlnks = Vlnks = NULL; - } -} - -private -procedure LinkSegment(e, Hflg, seg) - PPathElt e; -boolean Hflg; -PClrSeg seg; -{ - PSegLnk newlnk; - PSegLnkLst newlst, globlst; - newlnk = (PSegLnk)Alloc(sizeof(SegLnk)); - newlnk->seg = seg; - newlst = (PSegLnkLst)Alloc(sizeof(SegLnkLst)); - globlst = (PSegLnkLst)Alloc(sizeof(SegLnkLst)); - globlst->lnk = newlnk; - newlst->lnk = newlnk; - if (Hflg) { - newlst->next = e->Hs; - e->Hs = newlst; - globlst->next = Hlnks; - Hlnks = globlst; - } else { - newlst->next = e->Vs; - e->Vs = newlst; - globlst->next = Vlnks; - Vlnks = globlst; - } -} - -private -procedure CopySegmentLink(e1, e2, Hflg) - PPathElt e1, - e2; -boolean Hflg; -{ - /* copy reference to first link from e1 to e2 */ - PSegLnkLst newlst; - newlst = (PSegLnkLst)Alloc(sizeof(SegLnkLst)); - if (Hflg) { - newlst->lnk = e1->Hs->lnk; - newlst->next = e2->Hs; - e2->Hs = newlst; - } else { - newlst->lnk = e1->Vs->lnk; - newlst->next = e2->Vs; - e2->Vs = newlst; - } -} - -private -procedure AddSegment(from, to, loc, lftLstNm, rghtLstNm, e1, e2, Hflg, typ) - Fixed from, - to, loc; -integer lftLstNm, rghtLstNm; -PPathElt e1, e2; -boolean Hflg; -integer typ; -{ - PClrSeg seg, segList, prevSeg; - integer segNm; - seg = (PClrSeg)Alloc(sizeof(ClrSeg)); - seg->sLoc = loc; - if (from > to) { - seg->sMax = from; - seg->sMin = to; - } else { - seg->sMax = to; - seg->sMin = from; - } - seg->sBonus = bonus; - seg->sType = (short)typ; - if (e1 != NULL) { - if (e1->type == CLOSEPATH) e1 = GetDest(e1); - LinkSegment(e1, Hflg, seg); - seg->sElt = e1; - } - if (e2 != NULL) { - if (e2->type == CLOSEPATH) e2 = GetDest(e2); - CopySegmentLink(e1, e2, Hflg); - if (e1 == NULL || e2 == e1->prev) seg->sElt = e2; - } - segNm = (from > to) ? lftLstNm : rghtLstNm; - segList = segLists[segNm]; - prevSeg = NULL; - while (TRUE) { /* keep list in increasing order by sLoc */ - if (segList == NULL) { /* at end of list */ - if (prevSeg == NULL) { - segLists[segNm] = seg; - break; - } - prevSeg->sNxt = seg; - break; - } - if (segList->sLoc >= loc) { /* insert before this one */ - if (prevSeg == NULL) - segLists[segNm] = seg; - else - prevSeg->sNxt = seg; - seg->sNxt = segList; - break; - } - prevSeg = segList; - segList = segList->sNxt; - } -} - -public -procedure AddVSegment(from, to, loc, p1, p2, typ, i) - Fixed from, - to, loc; -PPathElt p1, p2; -integer typ, i; -{ - if (DEBUG) ReportAddVSeg(from, to, loc, i); - if (YgoesUp) - AddSegment(from, to, loc, 0, 1, p1, p2, FALSE, typ); - else - AddSegment(from, to, loc, 1, 0, p1, p2, FALSE, typ); -} - -public -procedure AddHSegment(from, to, loc, p1, p2, typ, i) - Fixed from, - to, loc; -PPathElt p1, p2; -integer typ, i; -{ - if (DEBUG) ReportAddHSeg(from, to, loc, i); - AddSegment(from, to, loc, 2, 3, p1, p2, TRUE, typ); -} - -private -Fixed CPFrom(cp2, cp3) Fixed cp2, cp3; -{ - Fixed val = 2 * (((cp3 - cp2) * cpFrom) / 200L); /*DEBUG 8 BIT: hack to get same rounding as old version */ - val += cp2; - - DEBUG_ROUND(val) - return val; /* DEBUG 8 BIT to match results with 7 bit fractions */ -} - -private -Fixed CPTo(cp0, cp1) Fixed cp0, cp1; -{ - Fixed val = 2 * (((cp1 - cp0) * cpTo) / 200L); /*DEBUG 8 BIT: hack to get same rounding as old version */ - val += cp0; - DEBUG_ROUND(val) - return val; /* DEBUG 8 BIT to match results with 7 bit fractions */ -} - -private -boolean TestBend(x0, y0, x1, y1, x2, y2) Fixed x0, y0, x1, y1, x2, y2; -{ - /* return true if bend angle is sharp enough (135 degrees or less) */ - real dx1, dy1, dx2, dy2, dotprod, lensqprod; - acfixtopflt(x1 - x0, &dx1); - acfixtopflt(y1 - y0, &dy1); - acfixtopflt(x2 - x1, &dx2); - acfixtopflt(y2 - y1, &dy2); - dotprod = dx1 * dx2 + dy1 * dy2; - lensqprod = (dx1 * dx1 + dy1 * dy1) * (dx2 * dx2 + dy2 * dy2); - return (dotprod * dotprod / lensqprod) <= .5; -} - -#define TestTan(d1, d2) (abs(d1) > (abs(d2) * bendTan) / 1000L) -#define FRound(x) FTrunc(FRnd(x)) - -private -boolean IsCCW(x0, y0, x1, y1, x2, y2) - Fixed x0, - y0, x1, y1, x2, y2; -{ - /* returns true if (x0,y0) -> (x1,y1) -> (x2,y2) is counter clockwise - in character space */ - integer dx0, dy0, dx1, dy1; - boolean ccw; - dx0 = FRound(x1 - x0); - dy0 = FRound(y1 - y0); - dx1 = FRound(x2 - x1); - dy1 = FRound(y2 - y1); - if (!YgoesUp) { - dy0 = -dy0; - dy1 = -dy1; - } - ccw = (dx0 * dy1) >= (dx1 * dy0); - return ccw; -} - -private -procedure DoHBendsNxt(x0, y0, x1, y1, p) - Fixed x0, - y0, x1, y1; -PPathElt p; -{ - Fixed x2, y2, delta, strt, end, x3, y3; - boolean ysame, ccw, above, doboth; - if (y0 == y1) return; - (void)NxtForBend(p, &x2, &y2, &x3, &y3); - ysame = ProdLt0(y2 - y1, y1 - y0); /* y0 and y2 on same side of y1 */ - if (ysame || - (TestTan(x1 - x2, y1 - y2) && - (ProdLt0(x2 - x1, x1 - x0) || - (IsVertical(x0, y0, x1, y1) && TestBend(x0, y0, x1, y1, x2, y2))))) { - delta = FixHalfMul(bendLength); - doboth = FALSE; - if ((x0 <= x1 && x1 < x2) || (x0 < x1 && x1 <= x2)) { - } else if ((x2 < x1 && x1 <= x0) || (x2 <= x1 && x1 < x0)) - delta = -delta; - else if (ysame) { - above = y0 > y1; - if (!YgoesUp) above = !above; - ccw = IsCCW(x0, y0, x1, y1, x2, y2); - if (above != ccw) delta = -delta; - } else - doboth = TRUE; - strt = x1 - delta; - end = x1 + delta; - AddHSegment(strt, end, y1, p, (PPathElt)NULL, sBEND, 0L); - if (doboth) - AddHSegment(end, strt, y1, p, (PPathElt)NULL, sBEND, 1L); - } -} - -private -procedure DoHBendsPrv(x0, y0, x1, y1, p) - Fixed x0, - y0, x1, y1; -PPathElt p; -{ - Fixed x2, y2, delta, strt, end; - boolean ysame, ccw, above, doboth; - if (y0 == y1) return; - (void)PrvForBend(p, &x2, &y2); - ysame = ProdLt0(y2 - y0, y0 - y1); - if (ysame || - (TestTan(x0 - x2, y0 - y2) && - (ProdLt0(x2 - x0, x0 - x1) || - (IsVertical(x0, y0, x1, y1) && TestBend(x2, y2, x0, y0, x1, y1))))) { - delta = FixHalfMul(bendLength); - doboth = FALSE; - if ((x2 < x0 && x0 <= x1) || (x2 <= x0 && x0 < x1)) { - } else if ((x1 < x0 && x0 <= x2) || (x1 <= x0 && x0 < x2)) - delta = -delta; - else if (ysame) { - above = (y2 > y0); - if (!YgoesUp) above = !above; - ccw = IsCCW(x2, y2, x0, y0, x1, y1); - if (above != ccw) delta = -delta; - } - strt = x0 - delta; - end = x0 + delta; - AddHSegment(strt, end, y0, p->prev, (PPathElt)NULL, sBEND, 2L); - if (doboth) - AddHSegment(end, strt, y0, p->prev, (PPathElt)NULL, sBEND, 3L); - } -} - -private -procedure DoVBendsNxt(x0, y0, x1, y1, p) - Fixed x0, - y0, x1, y1; -PPathElt p; -{ - Fixed x2, y2, delta, strt, end, x3, y3; - boolean xsame, ccw, right, doboth; - if (x0 == x1) return; - (void)NxtForBend(p, &x2, &y2, &x3, &y3); - xsame = ProdLt0(x2 - x1, x1 - x0); - if (xsame || - (TestTan(y1 - y2, x1 - x2) && - (ProdLt0(y2 - y1, y1 - y0) || - (IsHorizontal(x0, y0, x1, y1) && TestBend(x0, y0, x1, y1, x2, y2))))) { - delta = FixHalfMul(bendLength); - doboth = FALSE; - if ((y0 <= y1 && y1 < y2) || (y0 < y1 && y1 <= y2)) { - } else if ((y2 < y1 && y1 <= y0) || (y2 <= y1 && y1 < y0)) - delta = -delta; - else if (xsame) { - right = x0 > x1; - ccw = IsCCW(x0, y0, x1, y1, x2, y2); - if (right != ccw) delta = -delta; - if (!YgoesUp) delta = -delta; - } else - doboth = TRUE; - strt = y1 - delta; - end = y1 + delta; - AddVSegment(strt, end, x1, p, (PPathElt)NULL, sBEND, 0L); - if (doboth) - AddVSegment(end, strt, x1, p, (PPathElt)NULL, sBEND, 1L); - } -} - -private -procedure DoVBendsPrv(x0, y0, x1, y1, p) - Fixed x0, - y0, x1, y1; -PPathElt p; -{ - Fixed x2, y2, delta, strt, end; - boolean xsame, ccw, right, doboth; - if (x0 == x1) return; - (void)PrvForBend(p, &x2, &y2); - xsame = ProdLt0(x2 - x0, x0 - x1); - if (xsame || - (TestTan(y0 - y2, x0 - x2) && - (ProdLt0(y2 - y0, y0 - y1) || - (IsHorizontal(x0, y0, x1, y1) && TestBend(x2, y2, x0, y0, x1, y1))))) { - delta = FixHalfMul(bendLength); - doboth = FALSE; - if ((y2 < y0 && y0 <= y1) || (y2 <= y0 && y0 < y1)) { - } else if ((y1 < y0 && y0 <= y2) || (y1 <= y0 && y0 < y2)) - delta = -delta; - else if (xsame) { - right = x0 > x1; - ccw = IsCCW(x2, y2, x0, y0, x1, y1); - if (right != ccw) delta = -delta; - if (!YgoesUp) delta = -delta; - } - strt = y0 - delta; - end = y0 + delta; - AddVSegment(strt, end, x0, p->prev, (PPathElt)NULL, sBEND, 2L); - if (doboth) - AddVSegment(end, strt, x0, p->prev, (PPathElt)NULL, sBEND, 3L); - } -} - -private -procedure MergeLnkSegs(seg1, seg2, lst) - PSegLnkLst lst; -PClrSeg seg1, seg2; -{ - /* replace lnk refs to seg1 by seg2 */ - PSegLnk lnk; - while (lst != NULL) { - lnk = lst->lnk; - if (lnk->seg == seg1) lnk->seg = seg2; - lst = lst->next; - } -} - -private -procedure MergeHSegs(seg1, seg2) PClrSeg seg1, seg2; -{ - MergeLnkSegs(seg1, seg2, Hlnks); -} - -private -procedure MergeVSegs(seg1, seg2) PClrSeg seg1, seg2; -{ - MergeLnkSegs(seg1, seg2, Vlnks); -} - -private -procedure ReportRemSeg(l, lst) integer l; -PClrSeg lst; -{ - Fixed from, to, loc; - /* this assumes !YgoesUp */ - switch (l) { - case 1: - case 2: - from = lst->sMax; - to = lst->sMin; - break; - case 0: - case 3: - from = lst->sMin; - to = lst->sMax; - break; - } - loc = lst->sLoc; - switch (l) { - case 0: - case 1: - ReportRemVSeg(from, to, loc); - break; - case 2: - case 3: - ReportRemHSeg(from, to, loc); - break; - } -} - -/* Filters out bogus bend segments. */ -private -procedure RemExtraBends(l0, l1) integer l0, l1; -{ - register PClrSeg lst0, lst, n, p; - PClrSeg nxt, prv; - register Fixed loc0, loc; - lst0 = segLists[l0]; - prv = NULL; - while (lst0 != NULL) { - nxt = lst0->sNxt; - loc0 = lst0->sLoc; - lst = segLists[l1]; - p = NULL; - while (lst != NULL) { - n = lst->sNxt; - loc = lst->sLoc; - if (loc > loc0) break; /* list in increasing order by sLoc */ - if (loc == loc0 && - lst->sMin < lst0->sMax && lst->sMax > lst0->sMin) { - if (lst0->sType == sBEND && lst->sType != sBEND && - lst->sType != sGHOST && - (lst->sMax - lst->sMin) > (lst0->sMax - lst0->sMin) * 3) { - /* delete lst0 */ - if (prv == NULL) - segLists[l0] = nxt; - else - prv->sNxt = nxt; - if (DEBUG) ReportRemSeg(l0, lst0); - lst0 = prv; - break; - } - if (lst->sType == sBEND && lst0->sType != sBEND && - lst0->sType != sGHOST && - (lst0->sMax - lst0->sMin) > (lst->sMax - lst->sMin) * 3) { - /* delete lst */ - if (p == NULL) - segLists[l1] = n; - else - p->sNxt = n; - if (DEBUG) ReportRemSeg(l1, lst); - lst = p; - } - } - p = lst; - lst = n; - } - prv = lst0; - lst0 = nxt; - } -} - -private -procedure CompactList(i, nm) - integer i; -procedure (*nm)(); -{ - PClrSeg lst, prv, nxtprv, nxt; - Fixed lstmin, lstmax, nxtmin, nxtmax; - boolean flg; - lst = segLists[i]; - prv = NULL; - while (lst != NULL) { - nxt = lst->sNxt; - nxtprv = lst; - while (TRUE) { - if ((nxt == NULL) || (nxt->sLoc > lst->sLoc)) { - flg = TRUE; - break; - } - lstmin = lst->sMin; - lstmax = lst->sMax; - nxtmin = nxt->sMin; - nxtmax = nxt->sMax; - if (lstmax >= nxtmin && lstmin <= nxtmax) { - /* do not worry about YgoesUp since "sMax" is really max in - device space, not in character space */ - if (abs(lstmax - lstmin) > abs(nxtmax - nxtmin)) { - /* merge into lst and remove nxt */ - (*nm)(nxt, lst); - lst->sMin = MIN(lstmin, nxtmin); - lst->sMax = MAX(lstmax, nxtmax); - lst->sBonus = MAX(lst->sBonus, nxt->sBonus); - nxtprv->sNxt = nxt->sNxt; - } else { /* merge into nxt and remove lst */ - (*nm)(lst, nxt); - nxt->sMin = MIN(lstmin, nxtmin); - nxt->sMax = MAX(lstmax, nxtmax); - nxt->sBonus = MAX(lst->sBonus, nxt->sBonus); - lst = lst->sNxt; - if (prv == NULL) - segLists[i] = lst; - else - prv->sNxt = lst; - } - flg = FALSE; - break; - } - nxtprv = nxt; - nxt = nxt->sNxt; - } - if (flg) { - prv = lst; - lst = lst->sNxt; - } - } -} - -private -Fixed PickVSpot(x0, y0, x1, y1, px1, py1, px2, py2, prvx, prvy, nxtx, nxty) - Fixed x0, - y0, x1, y1, px1, py1, px2, py2, prvx, prvy, nxtx, nxty; -{ - register Fixed a1, a2; - if (x0 == px1 && x1 != px2) return x0; - if (x0 != px1 && x1 == px2) return x1; - if (x0 == prvx && x1 != nxtx) return x0; - if (x0 != prvx && x1 == nxtx) return x1; - a1 = abs(py1 - y0); - a2 = abs(py2 - y1); - if (a1 > a2) return x0; - a1 = abs(py2 - y1); - a2 = abs(py1 - y0); - if (a1 > a2) return x1; - if (x0 == prvx && x1 == nxtx) { - a1 = abs(y0 - prvy); - a2 = abs(y1 - nxty); - if (a1 > a2) return x0; - return x1; - } - return FixHalfMul(x0 + x1); -} - -private -Fixed AdjDist(d, q) Fixed d, q; -{ - Fixed val; - if (q == FixOne) { - DEBUG_ROUND(d) /* DEBUG 8 BIT */ - return d; - } - val = (d * q) >> 8; - DEBUG_ROUND(val) /* DEBUG 8 BIT */ - return val; -} - -/* serifs of ITCGaramond Ultra have points that are not quite horizontal - e.g., in H: (53,51)(74,52)(116,54) - the following was added to let these through */ -private -boolean TstFlat(dmn, dmx) Fixed dmn, dmx; -{ - if (dmn < 0) dmn = -dmn; - if (dmx < 0) dmx = -dmx; - return (dmx >= PSDist(50) && dmn <= PSDist(4)); -} - -private -boolean NxtHorz(x, y, p) Fixed x, y; -PPathElt p; -{ - Fixed x2, y2, x3, y3; - p = NxtForBend(p, &x2, &y2, &x3, &y3); - return TstFlat(y2 - y, x2 - x); -} - -private -boolean PrvHorz(x, y, p) Fixed x, y; -PPathElt p; -{ - Fixed x2, y2; - p = PrvForBend(p, &x2, &y2); - return TstFlat(y2 - y, x2 - x); -} - -private -boolean NxtVert(x, y, p) Fixed x, y; -PPathElt p; -{ - Fixed x2, y2, x3, y3; - p = NxtForBend(p, &x2, &y2, &x3, &y3); - return TstFlat(x2 - x, y2 - y); -} - -private -boolean PrvVert(x, y, p) Fixed x, y; -PPathElt p; -{ - Fixed x2, y2; - p = PrvForBend(p, &x2, &y2); - return TstFlat(x2 - x, y2 - y); -} - -/* PrvSameDir and NxtSameDir were added to check the direction of a - path and not add a band if the point is not at an extreme and is - going in the same direction as the previous path. */ -private -boolean TstSameDir(x0, y0, x1, y1, x2, y2) - Fixed x0, - y0, x1, y1, x2, y2; -{ - if (ProdLt0(y0 - y1, y1 - y2) || ProdLt0(x0 - x1, x1 - x2)) - return FALSE; - return !TestBend(x0, y0, x1, y1, x2, y2); -} - -private -boolean PrvSameDir(x0, y0, x1, y1, p) - Fixed x0, - y0, x1, y1; -PPathElt p; -{ - Fixed x2, y2; - p = PrvForBend(p, &x2, &y2); - if (p != NULL && p->type == CURVETO && p->prev != NULL) - GetEndPoint(p->prev, &x2, &y2); - return TstSameDir(x0, y0, x1, y1, x2, y2); -} - -private -boolean NxtSameDir(x0, y0, x1, y1, p) - Fixed x0, - y0, x1, y1; -PPathElt p; -{ - Fixed x2, y2, x3, y3; - p = NxtForBend(p, &x2, &y2, &x3, &y3); - if (p != NULL && p->type == CURVETO) { - x2 = p->x3; - y2 = p->y3; - } - return TstSameDir(x0, y0, x1, y1, x2, y2); -} - -public -procedure GenVPts(specialCharType) integer specialCharType; -{ - /* specialCharType 1 = upper; -1 = lower; 0 = neither */ - PPathElt p, fl; - boolean isVert, flex1, flex2; - Fixed flx0, fly0, llx, lly, urx, ury, yavg, yend, ydist, q, q2; - Fixed prvx, prvy, nxtx, nxty, xx, yy, yd2; - p = pathStart; - flex1 = flex2 = FALSE; - cpTo = CPpercent; - cpFrom = 100L - cpTo; - flx0 = fly0 = 0; - fl = NULL; - while (p != NULL) { - Fixed x0, y0, x1, y1; - GetEndPoints(p, &x0, &y0, &x1, &y1); - if (p->type == CURVETO) { - Fixed px1, py1, px2, py2; - isVert = FALSE; - if (p->isFlex) { - if (flex1) { - if (IsVertical(flx0, fly0, x1, y1)) - AddVSegment(fly0, y1, x1, fl->prev, p, sLINE, 4L); - flex1 = FALSE; - flex2 = TRUE; - } else { - flex1 = TRUE; - flex2 = FALSE; - flx0 = x0; - fly0 = y0; - fl = p; - } - } else - flex1 = flex2 = FALSE; - px1 = p->x1; - py1 = p->y1; - px2 = p->x2; - py2 = p->y2; - if (!flex2) { - if ((q = VertQuo(px1, py1, x0, y0)) == 0L) /* first two not vertical */ - DoVBendsPrv(x0, y0, px1, py1, p); - else { - isVert = TRUE; - if (px1 == x0 || - (px2 != x1 && - (PrvVert(px1, py1, p) || !PrvSameDir(x1, y1, x0, y0, p)))) { - if ((q2 = VertQuo(px2, py2, x0, y0)) > 0L && - ProdGe0(py1 - y0, py2 - y0) && - abs(py2 - y0) > abs(py1 - y0)) { - ydist = AdjDist(CPTo(py1, py2) - y0, q2); - yend = AdjDist(CPTo(y0, py1) - y0, q); - if (abs(yend) > abs(ydist)) ydist = yend; - AddVSegment(y0, y0 + ydist, x0, p->prev, p, sCURVE, 5L); - } else { - ydist = AdjDist(CPTo(y0, py1) - y0, q); - AddVSegment(y0, CPTo(y0, py1), x0, p->prev, p, sCURVE, 6L); - } - } - } - } - if (!flex1) { - if ((q = VertQuo(px2, py2, x1, y1)) == 0L) /* last 2 not vertical */ - DoVBendsNxt(px2, py2, x1, y1, p); - else if (px2 == x1 || - (px1 != x0 && - (NxtVert(px2, py2, p) || !NxtSameDir(x0, y0, x1, y1, p)))) { - ydist = AdjDist(y1 - CPFrom(py2, y1), q); - isVert = TRUE; - q2 = VertQuo(x0, y0, x1, y1); - yd2 = (q2 > 0L) ? AdjDist(y1 - y0, q2) : 0L; - if (isVert && q2 > 0L && abs(yd2) > abs(ydist)) { - if (x0 == px1 && px1 == px2 && px2 == x1) - ReportLinearCurve(p, x0, y0, x1, y1); - ydist = FixHalfMul(yd2); - yavg = FixHalfMul(y0 + y1); - (void)PrvForBend(p, &prvx, &prvy); - (void)NxtForBend(p, &nxtx, &nxty, &xx, &yy); - AddVSegment(yavg - ydist, yavg + ydist, - PickVSpot(x0, y0, x1, y1, px1, py1, px2, py2, prvx, prvy, nxtx, nxty), - p, (PPathElt)NULL, sCURVE, 7L); - } else { - q2 = VertQuo(px1, py1, x1, y1); - if (q2 > 0L && ProdGe0(py1 - y1, py2 - y1) && - abs(py2 - y1) < abs(py1 - y1)) { - yend = AdjDist(y1 - CPFrom(py1, py2), q2); - if (abs(yend) > abs(ydist)) ydist = yend; - AddVSegment(y1 - ydist, y1, x1, p, (PPathElt)NULL, sCURVE, 8L); - } else - AddVSegment(y1 - ydist, y1, x1, p, (PPathElt)NULL, sCURVE, 9L); - } - } - } - if (!flex1 && !flex2) { - Fixed minx, maxx; - maxx = MAX(x0, x1); - minx = MIN(x0, x1); - if (px1 - maxx >= FixTwo || px2 - maxx >= FixTwo || - px1 - minx <= FixTwo || px2 - minx <= FixTwo) { - FindCurveBBox(x0, y0, px1, py1, px2, py2, x1, y1, &llx, &lly, &urx, &ury); - if (urx - maxx > FixTwo || minx - llx > FixTwo) { - Fixed loc, frst, lst; - loc = (minx - llx > urx - maxx) ? llx : urx; - CheckBBoxEdge(p, TRUE, loc, &frst, &lst); - yavg = FixHalfMul(frst + lst); - ydist = (frst == lst) ? (y1 - y0) / 10L : FixHalfMul(lst - frst); - if (abs(ydist) < bendLength) - ydist = (ydist > 0L) ? FixHalfMul(bendLength) : FixHalfMul(-bendLength); - AddVSegment(yavg - ydist, yavg + ydist, loc, - p, (PPathElt)NULL, sCURVE, 10L); - } - } - } - } else if (p->type == MOVETO) { - bonus = 0; - if (specialCharType == -1L) { - if (IsLower(p)) bonus = FixInt(200); - } else if (specialCharType == 1L) { - if (IsUpper(p)) bonus = FixInt(200); - } - } else if (!IsTiny(p)) { - if ((q = VertQuo(x0, y0, x1, y1)) > 0L) { - if (x0 == x1) - AddVSegment(y0, y1, x0, p->prev, p, sLINE, 11L); - else { - if (q < FixQuarter) q = FixQuarter; - ydist = FixHalfMul(AdjDist(y1 - y0, q)); - yavg = FixHalfMul(y0 + y1); - (void)PrvForBend(p, &prvx, &prvy); - (void)NxtForBend(p, &nxtx, &nxty, &xx, &yy); - AddVSegment(yavg - ydist, yavg + ydist, - PickVSpot(x0, y0, x1, y1, x0, y0, x1, y1, prvx, prvy, nxtx, nxty), - p, (PPathElt)NULL, sLINE, 12L); - if (abs(x0 - x1) <= FixTwo) - ReportNonVError(x0, y0, x1, y1); - } - } else { - DoVBendsNxt(x0, y0, x1, y1, p); - DoVBendsPrv(x0, y0, x1, y1, p); - } - } - p = p->next; - } - CompactList(0, MergeVSegs); - CompactList(1, MergeVSegs); - RemExtraBends(0, 1); - leftList = segLists[0]; - rightList = segLists[1]; -} - -public -boolean InBlueBand(loc, n, p) Fixed loc; -register Fixed *p; -integer n; -{ - register int i; - register Fixed y; - if (n <= 0) return FALSE; - y = itfmy(loc); - /* Augment the blue band by bluefuzz in each direction. This will - result in "near misses" being colored and so adjusted by the - PS interpreter. */ - for (i = 0; i < n; i += 2) - if ((p[i] - bluefuzz) <= y && - (p[i + 1] + bluefuzz) >= y) return TRUE; - return FALSE; -} - -private -Fixed PickHSpot(x0, y0, x1, y1, xdist, px1, py1, px2, py2, prvx, prvy, nxtx, nxty) - Fixed x0, - y0, x1, y1, xdist, px1, py1, px2, py2, prvx, prvy, nxtx, nxty; -{ - boolean topSeg = (xdist < 0L) ? TRUE : FALSE; - Fixed upper, lower; - boolean inBlue0, inBlue1; - if (topSeg) { - inBlue0 = InBlueBand(y0, lenTopBands, topBands); - inBlue1 = InBlueBand(y1, lenTopBands, topBands); - } else { - inBlue0 = InBlueBand(y0, lenBotBands, botBands); - inBlue1 = InBlueBand(y1, lenBotBands, botBands); - } - if (inBlue0 && !inBlue1) return y0; - if (inBlue1 && !inBlue0) return y1; - if (y0 == py1 && y1 != py2) return y0; - if (y0 != py1 && y1 == py2) return y1; - if (y0 == prvy && y1 != nxty) return y0; - if (y0 != prvy && y1 == nxty) return y1; - if (inBlue0 && inBlue1) { - if (y0 > y1) { - upper = y0; - lower = y1; - } else { - upper = y1; - lower = y0; - } - if (!YgoesUp) { - Fixed tmp = lower; - lower = upper; - upper = tmp; - } - return topSeg ? upper : lower; - } - if (abs(px1 - x0) > abs(px2 - x1)) return y0; - if (abs(px2 - x1) > abs(px1 - x0)) return y1; - if (y0 == prvy && y1 == nxty) { - if (abs(x0 - prvx) > abs(x1 - nxtx)) return y0; - return y1; - } - return FixHalfMul(y0 + y1); -} - -public -procedure GenHPts() { - PPathElt p, fl; - boolean isHoriz, flex1, flex2; - Fixed flx0, fly0, llx, lly, urx, ury, xavg, xend, xdist, q, q2; - Fixed prvx, prvy, nxtx, nxty, xx, yy, xd2; - p = pathStart; - bonus = 0; - flx0 = fly0 = 0; - fl = NULL; - flex1 = flex2 = FALSE; - cpTo = CPpercent; - cpFrom = 100L - cpTo; - while (p != NULL) { - Fixed x0, y0, x1, y1; - GetEndPoints(p, &x0, &y0, &x1, &y1); - if (p->type == CURVETO) { - Fixed px1, py1, px2, py2; - isHoriz = FALSE; - if (p->isFlex) { - if (flex1) { - flex1 = FALSE; - flex2 = TRUE; - if (IsHorizontal(flx0, fly0, x1, y1)) - AddHSegment(flx0, x1, y1, fl->prev, p, sLINE, 4L); - } else { - flex1 = TRUE; - flex2 = FALSE; - flx0 = x0; - fly0 = y0; - fl = p; - } - } else - flex1 = flex2 = FALSE; - px1 = p->x1; - py1 = p->y1; - px2 = p->x2; - py2 = p->y2; - if (!flex2) { - if ((q = HorzQuo(px1, py1, x0, y0)) == 0L) - DoHBendsPrv(x0, y0, px1, py1, p); - else { - isHoriz = TRUE; - if (py1 == y0 || - (py2 != y1 && - (PrvHorz(px1, py1, p) || !PrvSameDir(x1, y1, x0, y0, p)))) { - if ((q2 = HorzQuo(px2, py2, x0, y0)) > 0L && - ProdGe0(px1 - x0, px2 - x0) && - abs(px2 - x0) > abs(px1 - x0)) { - xdist = AdjDist(CPTo(px1, px2) - x0, q2); - xend = AdjDist(CPTo(x0, px1) - x0, q); - if (abs(xend) > abs(xdist)) xdist = xend; - AddHSegment(x0, x0 + xdist, y0, p->prev, p, sCURVE, 5L); - } else { - xdist = AdjDist(CPTo(x0, px1) - x0, q); - AddHSegment(x0, x0 + xdist, y0, p->prev, p, sCURVE, 6L); - } - } - } - } - if (!flex1) { - if ((q = HorzQuo(px2, py2, x1, y1)) == 0L) - DoHBendsNxt(px2, py2, x1, y1, p); - else if (py2 == y1 || - (py1 != y0 && - (NxtHorz(px2, py2, p) || !NxtSameDir(x0, y0, x1, y1, p)))) { - xdist = AdjDist(x1 - CPFrom(px2, x1), q); - q2 = HorzQuo(x0, y0, x1, y1); - isHoriz = TRUE; - xd2 = (q2 > 0L) ? AdjDist(x1 - x0, q2) : 0L; - if (isHoriz && q2 > 0 && abs(xd2) > abs(xdist)) { - Fixed hspot; - if (y0 == py1 && py1 == py2 && py2 == y1) - ReportLinearCurve(p, x0, y0, x1, y1); - (void)PrvForBend(p, &prvx, &prvy); - (void)NxtForBend(p, &nxtx, &nxty, &xx, &yy); - xdist = FixHalfMul(xd2); - xavg = FixHalfMul(x0 + x1); - hspot = PickHSpot( - x0, y0, x1, y1, xdist, px1, py1, px2, py2, prvx, prvy, nxtx, nxty); - AddHSegment( - xavg - xdist, xavg + xdist, hspot, p, (PPathElt)NULL, sCURVE, 7L); - } else { - q2 = HorzQuo(px1, py1, x1, y1); - if (q2 > 0L && ProdGe0(px1 - x1, px2 - x1) && - abs(px2 - x1) < abs(px1 - x1)) { - xend = AdjDist(x1 - CPFrom(px1, px2), q2); - if (abs(xend) > abs(xdist)) xdist = xend; - AddHSegment(x1 - xdist, x1, y1, p, (PPathElt)NULL, sCURVE, 8L); - } else - AddHSegment(x1 - xdist, x1, y1, p, (PPathElt)NULL, sCURVE, 9L); - } - } - } - if (!flex1 && !flex2) { - Fixed miny, maxy; - maxy = MAX(y0, y1); - miny = MIN(y0, y1); - if (py1 - maxy >= FixTwo || py2 - maxy >= FixTwo || - py1 - miny <= FixTwo || py2 - miny <= FixTwo) { - FindCurveBBox(x0, y0, px1, py1, px2, py2, x1, y1, &llx, &lly, &urx, &ury); - if (ury - maxy > FixTwo || miny - lly > FixTwo) { - Fixed loc, frst, lst; - loc = (miny - lly > ury - maxy) ? lly : ury; - CheckBBoxEdge(p, FALSE, loc, &frst, &lst); - xavg = FixHalfMul(frst + lst); - xdist = (frst == lst) ? (x1 - x0) / 10L : FixHalfMul(lst - frst); - if (abs(xdist) < bendLength) - xdist = (xdist > 0.0) ? FixHalfMul(bendLength) : FixHalfMul(-bendLength); - AddHSegment( - xavg - xdist, xavg + xdist, loc, p, (PPathElt)NULL, sCURVE, 10L); - } - } - } - } else if (p->type != MOVETO && !IsTiny(p)) { - if ((q = HorzQuo(x0, y0, x1, y1)) > 0L) { - if (y0 == y1) - AddHSegment(x0, x1, y0, p->prev, p, sLINE, 11L); - else { - if (q < FixQuarter) q = FixQuarter; - xdist = FixHalfMul(AdjDist(x1 - x0, q)); - xavg = FixHalfMul(x0 + x1); - (void)PrvForBend(p, &prvx, &prvy); - (void)NxtForBend(p, &nxtx, &nxty, &xx, &yy); - yy = PickHSpot(x0, y0, x1, y1, xdist, x0, y0, x1, y1, prvx, prvy, nxtx, nxty); - AddHSegment(xavg - xdist, xavg + xdist, yy, p->prev, p, sLINE, 12L); - if (abs(y0 - y1) <= FixTwo) - ReportNonHError(x0, y0, x1, y1); - } - } else { - DoHBendsNxt(x0, y0, x1, y1, p); - DoHBendsPrv(x0, y0, x1, y1, p); - } - } - p = p->next; - } - CompactList(2, MergeHSegs); - CompactList(3, MergeHSegs); - RemExtraBends(2, 3); - topList = segLists[2]; /* this is probably unnecessary */ - botList = segLists[3]; - CheckTfmVal(topList, topBands, lenTopBands); - CheckTfmVal(botList, botBands, lenBotBands); -} - -public -procedure PreGenPts() { - Hlnks = Vlnks = NULL; - segLists[0] = NULL; - segLists[1] = NULL; - segLists[2] = NULL; - segLists[3] = NULL; -} diff --git a/c/autohint/autohintlib/source/ac/head.c b/c/autohint/autohintlib/source/ac/head.c deleted file mode 100644 index 38dc1fa55..000000000 --- a/c/autohint/autohintlib/source/ac/head.c +++ /dev/null @@ -1,281 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* head.c */ - -#include "ac.h" -#include "machinedep.h" - -public -PPathElt GetDest(cldest) register PPathElt cldest; -{ - if (cldest == NULL) return NULL; - while (TRUE) { - cldest = cldest->prev; - if (cldest == NULL) return pathStart; - if (cldest->type == MOVETO) return cldest; - } -} - -public -PPathElt GetClosedBy(clsdby) register PPathElt clsdby; -{ - if (clsdby == NULL) return NULL; - if (clsdby->type == CLOSEPATH) return clsdby; - while (TRUE) { - clsdby = clsdby->next; - if (clsdby == NULL) return NULL; - if (clsdby->type == MOVETO) return NULL; - if (clsdby->type == CLOSEPATH) return clsdby; - } -} - -public -procedure GetEndPoint(e, x1p, y1p) register PPathElt e; -Fixed *x1p, *y1p; -{ - if (e == NULL) { - *x1p = 0; - *y1p = 0; - return; - } -retry: - switch (e->type) { - case MOVETO: - case LINETO: - *x1p = e->x; - *y1p = e->y; - break; - case CURVETO: - *x1p = e->x3; - *y1p = e->y3; - break; - case CLOSEPATH: - e = GetDest(e); - if (e == NULL || e->type == CLOSEPATH) { - sprintf(globmsg, "Bad character description file: %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - goto retry; - default: { - sprintf(globmsg, "Illegal operator in character file: %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } -} - -public -procedure GetEndPoints(p, px0, py0, px1, py1) - PPathElt p; -Fixed *px0, *py0, *px1, *py1; -{ - GetEndPoint(p, px1, py1); - GetEndPoint(p->prev, px0, py0); -} - -#define Interpolate(q, v0, q0, v1, q1) (v0 + (q - q0) * ((v1 - v0) / (q1 - q0))) -private -Fixed HVness(pq) real *pq; -{ - register real q; - real result; - /* approximately == 2 q neg exp */ - /* as q -> 0, result goes to 1.0 */ - /* as q -> inf, result goes to 0.0 */ - q = *pq; - if (q < .25) - result = (real)Interpolate(q, 1.0, 0.0, .841, .25); - else if (q < .5) - result = (real)Interpolate(q, .841, .25, .707, .5); - else if (q < 1) - result = (real)Interpolate(q, .707, .5, .5, 1.0); - else if (q < 2) - result = (real)Interpolate(q, .5, 1.0, .25, 2.0); - else if (q < 4) - result = (real)Interpolate(q, .25, 2.0, 0.0, 4.0); - else - result = 0.0; - return acpflttofix(&result); -} - -public -Fixed VertQuo(xk, yk, xl, yl) Fixed xk, yk, xl, yl; -{ - /* FixOne means exactly vertical. 0 means not vertical */ - /* intermediate values mean almost vertical */ - register Fixed xabs, yabs; - real rx, ry, q; - xabs = xk - xl; - if (xabs < 0L) - xabs = -xabs; - if (xabs == 0) - return FixOne; - yabs = yk - yl; - if (yabs < 0L) - yabs = -yabs; - if (yabs == 0) - return 0L; - acfixtopflt(xabs, &rx); - acfixtopflt(yabs, &ry); - q = (real)(rx * rx) / (theta * ry); /* DEBUG 8 BIT. Used to by 2*(rx*rx)/(theta*ry). Don't need thsi with the 8 bits of Fixed fraction. */ - return HVness(&q); -} - -public -Fixed HorzQuo(xk, yk, xl, yl) Fixed xk, yk, xl, yl; -{ - register Fixed xabs, yabs; - real rx, ry, q; - yabs = yk - yl; - if (yabs < 0) - yabs = -yabs; - if (yabs == 0L) - return FixOne; - xabs = xk - xl; - if (xabs < 0) - xabs = -xabs; - if (xabs == 0L) - return 0L; - acfixtopflt(xabs, &rx); - acfixtopflt(yabs, &ry); - q = (real)(ry * ry) / (theta * rx); /* DEBUG 8 BIT. Used to by 2*(ry*ry)/(theta*ry). Don't need thsi with the 8 bits of Fixed fraction. */ - return HVness(&q); -} - -public -boolean IsTiny(e) PPathElt e; -{ - Fixed x0, y0, x1, y1, abstmp; - GetEndPoints(e, &x0, &y0, &x1, &y1); - return ((ac_abs(x0 - x1) < FixTwo) && (ac_abs(y0 - y1) < FixTwo)) ? TRUE : FALSE; -} - -public -boolean IsShort(e) PPathElt e; -{ - Fixed x0, y0, x1, y1, dx, dy, mn, mx, abstmp; - GetEndPoints(e, &x0, &y0, &x1, &y1); - dx = ac_abs(x0 - x1); - dy = ac_abs(y0 - y1); - if (dx > dy) { - mn = dy; - mx = dx; - } else { - mn = dx; - mx = dy; - } - return ((mx + (mn * 42L) / 125L) < FixInt(6)) ? TRUE : FALSE; /* DEBUG 8 BIT. Increased threshold from 3 to 6, for change in coordinare system. */ -} - -public -PPathElt NxtForBend(p, px2, py2, px3, py3) - PPathElt p; -Fixed *px2, *py2, *px3, *py3; -{ - PPathElt nxt, nxtMT = NULL; - Fixed x, y, x2, y2; - nxt = p; - GetEndPoint(p, &x, &y); - while (TRUE) { - if (nxt->type == CLOSEPATH) { - nxt = GetDest(nxt); - /* The following test was added to prevent an infinite loop. */ - if (nxtMT != NULL && nxtMT == nxt) { - ReportPossibleLoop(p); - nxt = NULL; - } else { - nxtMT = nxt; - nxt = nxt->next; - } - } else - nxt = nxt->next; - if (nxt == NULL) { /* forget it */ - *px2 = *py2 = *px3 = *py3 = FixInt(-9999); - return nxt; - } - if (!IsTiny(nxt)) break; - } - if (nxt->type == CURVETO) { - x2 = nxt->x1; - y2 = nxt->y1; - if (x2 == x && y2 == y) { - x2 = nxt->x2; - y2 = nxt->y2; - } - *px2 = x2; - *py2 = y2; - } else - GetEndPoint(nxt, px2, py2); - GetEndPoint(nxt, px3, py3); - return nxt; -} - -public -PPathElt PrvForBend(p, px2, py2) PPathElt p; -Fixed *px2, *py2; -{ - PPathElt prv, prvCP = NULL; - Fixed x2, y2; - prv = p; - while (TRUE) { - prv = prv->prev; - if (prv == NULL) goto Bogus; - if (prv->type == MOVETO) { - prv = GetClosedBy(prv); - /* The following test was added to prevent an infinite loop. */ - if (prv == NULL || (prvCP != NULL && prvCP == prv)) - goto Bogus; - prvCP = prv; - } - if (!IsTiny(prv)) break; - } - if (prv->type == CURVETO) { - x2 = prv->x2; - y2 = prv->y2; - if (x2 == prv->x3 && y2 == prv->y3) { - x2 = prv->x1; - y2 = prv->y1; - } - *px2 = x2; - *py2 = y2; - } else { - p = prv->prev; - if (p == NULL) goto Bogus; - GetEndPoint(p, px2, py2); - } - return prv; -Bogus: - *px2 = *py2 = FixInt(-9999); - return prv; -} - -private -boolean CheckHeight(upperFlag, p) - boolean upperFlag; -PPathElt p; -{ - PPathElt ee; - Fixed y, yy; - ee = pathStart; - y = itfmy(p->y); - while (ee != NULL) { - if (ee->type == MOVETO && ee != p) { - yy = itfmy(ee->y); - if ((upperFlag && yy > y) || (!upperFlag && yy < y)) return FALSE; - } - ee = ee->next; - } - return TRUE; -} - -public -boolean IsLower(p) PPathElt p; -{ - return CheckHeight(FALSE, p); -} - -public -boolean IsUpper(p) PPathElt p; -{ - return CheckHeight(TRUE, p); -} diff --git a/c/autohint/autohintlib/source/ac/memcheck.c b/c/autohint/autohintlib/source/ac/memcheck.c deleted file mode 100644 index 5e52677f1..000000000 --- a/c/autohint/autohintlib/source/ac/memcheck.c +++ /dev/null @@ -1,922 +0,0 @@ -#if DOMEMCHECK - -#include -#include -#include -#include -#include - -#include "memcheck.h" - -#define PREFERREDALIGN 8 -#define MEMCK_NEED_ALIGN8 1 - -#define OSProvided_Malloc(x) malloc(x) -#define OSProvided_Free(x) free(x) -#define OSProvided_Calloc(x, y) calloc(x, y) -#define OSProvided_Realloc(x, y) realloc(x, y) - -#define DebugAssert(x) -#define Assert(x) - -typedef uint32_t Card32; -typedef uint32_t *pCard32; -typedef int32_t Int32; -typedef uint16_t Card16; -typedef uint8_t Card8; -typedef uint8_t *pCard8; -typedef bool boolean; - -#define NUM_MEM_MASK 32 -#define NUM_MEM_BLK 32 * NUM_MEM_MASK - -typedef struct _t_MemoryData { - void *address[NUM_MEM_BLK]; - Card32 allocNdx[NUM_MEM_BLK]; - Card32 inUseMask[NUM_MEM_MASK]; - Card32 keepMask[NUM_MEM_MASK]; - char *fileName[NUM_MEM_BLK]; - Card32 size[NUM_MEM_BLK]; - Card32 lineNo[NUM_MEM_BLK]; - Card32 memStore[NUM_MEM_BLK]; - Card32 numInUse; - struct _t_MemoryData *next; -} * MemoryData, MemoryDataRec; - -static MemoryData memoryData; - -static Card32 distAllocNdx = 0; -static Card32 distAllocCount = 0; -static Card32 totalAllocCount = 0; -static Card32 distAllocNdxStopper = 0; - -SINGEXPORT int memck_PrintAllAllocFreeCalls = 0; /* print out all allocations/reallocations/frees */ - -static FILE *logfile = NULL; - -/* ----------------------------------------------------------- */ - -static int MIN(int a, int b) { - if (a < b) return a; - return b; -} - -static int MAX(int a, int b) { - if (a > b) return a; - return b; -} - -static char *CheckName(char *filename) { -#define MEMCKMAXNUMFILENAMES 256 - static char outOfMemStr[] = ""; - static char *fileNames[MEMCKMAXNUMFILENAMES]; - static int numNames = 0; - - char *cptr; - int i; - - for (cptr = filename; *cptr; ++cptr) - if (*cptr == '/') filename = cptr + 1; - - for (i = 0; i < numNames; ++i) - if (!strcmp(filename, fileNames[i])) break; - if (i < numNames) return fileNames[i]; - if (numNames < (MEMCKMAXNUMFILENAMES - 1)) { - cptr = fileNames[numNames++] = (char *)OSProvided_Malloc(strlen(filename) + 1); - if (cptr) - strcpy(cptr, filename); - else - cptr = outOfMemStr; - } else - cptr = outOfMemStr; - return cptr; -} - -/* You can call this function from gdb or set the global distAllocNdxStopper - * directly to stop at a given allocation index with an assertion failure - * after the memory leak report has detected one and given you an index. */ -SINGEXPORT void StopOnAllocation(Card32 stopNum) { - distAllocNdxStopper = stopNum; -} - -/* - * This is a good place to set a breakpoint when we reach the given allocation - index - */ -static void AllocationBreakStop(Card32 stopNum) { - fprintf(stdout, "MemCheck allocator reached allocation #%d\n", stopNum); -} - -static boolean StoreAllocation( - void *ptr, - int size, - MemCheck_MemStore memStore, - char *filename, - int lineno) { - MemoryData mPtr, *prev; - - /* This debugassert will trip on the given allocation numbered - * distAllocNdx as * reported in the memory leak report. This is much - * faster than a conditional * breakpoint. */ - if (distAllocNdxStopper != 0 && distAllocNdxStopper <= distAllocNdx) { - AllocationBreakStop(distAllocNdx); - distAllocNdxStopper = 0; - } - DebugAssert(distAllocNdxStopper == 0 || distAllocNdxStopper != distAllocNdx); - prev = &memoryData; - for (mPtr = memoryData; mPtr; mPtr = mPtr->next) { - if (mPtr->numInUse < NUM_MEM_BLK) { - int i, j, k; - void **addr; - pCard32 mask = mPtr->inUseMask; - for (i = 0; i < NUM_MEM_MASK; ++i, ++mask) - if (*mask != 0xFFFFFFFF) break; - addr = &mPtr->address[i << 5]; - for (j = 0; j < 32; ++j, ++addr) - if (*addr == NULL) break; - k = (i << 5) + j; - *mask |= ((Card32)1 << j); - mPtr->keepMask[i] |= ((Card32)1 << j); - ++mPtr->numInUse; - *addr = ptr; - mPtr->allocNdx[k] = distAllocNdx; - mPtr->fileName[k] = CheckName(filename); - mPtr->lineNo[k] = lineno; - mPtr->size[k] = size; - mPtr->memStore[k] = memStore; - return 1; - } - prev = &mPtr->next; - } - *prev = mPtr = (MemoryData)OSProvided_Calloc(sizeof(MemoryDataRec), 1); - if (!mPtr) return 0; - mPtr->address[0] = ptr; - mPtr->allocNdx[0] = distAllocNdx; - mPtr->inUseMask[0] = 1; - mPtr->keepMask[0] = 1; - mPtr->fileName[0] = CheckName(filename); - mPtr->lineNo[0] = lineno; - mPtr->size[0] = size; - mPtr->memStore[0] = memStore; - mPtr->numInUse = 1; - mPtr->next = NULL; - return 1; -} - -static void ReplaceAllocation(void *ptr1, - void *ptr2, - int size, - char *filename, - int lineno) { - MemoryData mPtr, *prev; - - prev = &memoryData; - for (mPtr = memoryData; mPtr; mPtr = mPtr->next) { - int i, j, k; - void **addr; - pCard32 mask = mPtr->inUseMask; - pCard32 keep = mPtr->keepMask; - DebugAssert(mPtr->numInUse > 0); - for (i = 0; i < NUM_MEM_MASK; ++i, ++mask, ++keep) { - if (*mask == 0) continue; - addr = &mPtr->address[i << 5]; - for (k = i << 5, j = 0; j < 32; ++j, ++k, ++addr) { - if (*addr == ptr1) { - if ((*addr = ptr2) != NULL) { - mPtr->fileName[k] = CheckName(filename); - mPtr->allocNdx[k] = distAllocNdx; - mPtr->lineNo[k] = lineno; - mPtr->size[k] = size; - return; - } - *mask &= ~((Card32)1 << j); - *keep &= ~((Card32)1 << j); - if (--mPtr->numInUse == 0) { - MemoryData next = mPtr->next; - OSProvided_Free(mPtr); - *prev = next; - } - return; - } - } - } - prev = &mPtr->next; - } - DebugAssert(0); -} - -static void ResetAllocations(void) { - MemoryData mPtr; - for (mPtr = memoryData; mPtr; mPtr = mPtr->next) - memset(mPtr->keepMask, 0, NUM_MEM_MASK << 2); -} - -static void PrintAllocations() { - MemoryData mPtr; - int i, j, k; - int numLeft = 0; - - for (mPtr = memoryData; mPtr; mPtr = mPtr->next) { - void **addr; - pCard32 mask = mPtr->inUseMask; - pCard32 keep = mPtr->keepMask; - DebugAssert(mPtr->numInUse > 0); - for (i = 0; i < NUM_MEM_MASK; ++i, ++mask, ++keep) { - if (*mask == 0 || *keep == 0) continue; - addr = &mPtr->address[i << 5]; - for (j = 0; j < 32; ++j, ++addr) - if (*addr != NULL && (*keep & (1 << j)) != 0) ++numLeft; - } - } - if (!numLeft) return; - - if (logfile) - fprintf(logfile, "WARNING: Possible memory leak; %d items left allocated\n", numLeft); - for (mPtr = memoryData; mPtr; mPtr = mPtr->next) { - void **addr; - pCard32 mask = mPtr->inUseMask; - pCard32 keep = mPtr->keepMask; - DebugAssert(mPtr->numInUse > 0); - for (i = 0; i < NUM_MEM_MASK; ++i, ++mask, ++keep) { - if (*mask == 0 || *keep == 0) continue; - addr = &mPtr->address[i << 5]; - for (k = i << 5, j = 0; j < 32; ++j, ++k, ++addr) { - if (*addr == NULL || (*keep & (1 << j)) == 0) continue; - - if (logfile) - fprintf(logfile, - " (Store=%d)\t 0x%x size=%d (ndx=%d) file=%s@%d\n", - mPtr->memStore[k], - *addr, - mPtr->size[k], - mPtr->allocNdx[k], - mPtr->fileName[k], mPtr->lineNo[k]); - } - } - } - if (logfile) fflush(logfile); -} - -/* ----------------------------------------------------------- */ - -/* ----------------------------------------------------------- */ -/* ----------------------------------------------------------- */ -/* Mem Store buffers are allocated in per_store_Data Blocks */ -typedef struct t_PerstoreData *PPerstoreData; -typedef struct t_PerstoreData { - pCard8 data; /* use char* for easy pointer math */ - Int32 size; /* original size of the block */ - Int32 left; /* contiguious bytes left over in this block */ - Int32 discard; /* this block can be freed IF discard+left == size */ - PPerstoreData next; - PPerstoreData prev; -} PerstoreData; - -typedef struct t_MemStore { - PerstoreData head[1]; - - /* statistics for debugging */ - int allocated; /* Actual allocated size for this memStore - including freed */ - int used; /* size used AND re-used */ - int freed; /* allocated - freed = size used for this memStore */ - int maxInUse; /* Maximal mem size in use for this memStore: MAX(allocated-freed) */ - int maxBlock; /* max block size */ - int numBlocks; /* blocks left over */ - int reqBlocks; /* num of blocks requested - inlcuding freed ones */ -} MemStore, *PMemStore; - -#define PD_BLOCK_MIN_SIZE 0x4000 /* default min size */ -#define PD_BLOCK_MAX_SIZE 0xFFF0 /* Max size allowed from MemStores */ - -/* All blocks allocated are in one of the stores */ -static MemStore gMStores[memck_store_maxMemStore]; - -/* 2 Giga bytes is memck_*alloc()'s max size - * so the size in ((size << 1) | MEMCK_OSMALLOC_BIT) can be recovered - */ -#define MEMCK_MAX_SIZE 0x7FFFFFF0 -#define MEMCK_OSMALLOC_BIT 0x00000001 - -/* - * Every memck_*alloc()'d ptr has an Card32 tag in its front - * each buffer looks like this : - * (HEAD)(UserPtr)(TAIL) - * - * If the pointer is from OSProvided_*alloc(): - * (HEAD) has MEMCK_OSMALLOC_BIT set which will never be set - * by memstore_*alloc() - * - * If the pointer is from memstore_*alloc(): - * (HEAD) is divided into two Card16 (DS)(SZ) where - * SZ = size of (HEAD + UserPtr + TAIL), it is always even. - * DS = DistanceToBlockHeader, its maximal value is - * PD_BLOCK_MAX_SIZE - SZ - * - * In Release build. (TAIL) is not included - * - * For Sparc Solaris we have the additional requirement that all malloc - * pointers returned to the client must be 8-byte aligned. This is to - * allow the client to store doubles in the segment (if the ptr is not - * 8-byte aligned a BUS error will happen). So for Solaris we wrap the - * entire buffer like this: - * - * 1) If the client pointer is unaligned (only 4-byte aligned): - * - * Base malloc pointer - * | - * | Unaligned unwrapped client pointer - * | | - * | | Aligned wrapped client pointer - * | | | - * V V V - * 4 byte 4 byte 4 byte 4 byte - * +--------+--------+-------------------------------+--------+--------+ - * | HEAD | = 1 | Client segment | unused | TAIL | - * +--------+--------+-------------------------------+--------+--------+ - * - * |<--- MEMCK_GetInnerClientSize --->| - * - * |<-------------- MEMCK_GetClientSize --------------->| - * - * - * 2) If the client pointer is aligned (8-byte aligned): - * - * Base malloc pointer - * | - * | Aligned unwrapped client pointer - * | | - * | | Aligned wrapped client pointer - * | | | - * V V V - * 4 byte 4 byte 4 byte 4 byte - * +--------+--------+--------+-------------------------------+--------+ - * | HEAD | = 2 | = 2 | Client segment | TAIL | - * +--------+--------+--------+-------------------------------+--------+ - * - * |<--- MEMCK_GetInnerClientSize --->| - * - * |<-------------- MEMCK_GetClientSize --------------->| - * - * The 4-byte unsigned integers between the base pointer and the client - * pointer indicate whether or not the base pointer is unaligned. - * - * Exported functions: - * - * memck_mallocinternal - * memck_callocinternal - * memck_freeinternal - * memck_reallocinternal - * - * Internal call-hierarchy: - * - * memck_callocinternal - * | - * `---> memck_mallocinternal - * - * memck_reallocinternal - * | - * `---> memstore_reallocinternal - * | - * `---> memck_mallocinternal - * `---> mekck_freeinternal - */ - -#if MEMCK_NEED_ALIGN8 - -#define MEMCK_IS_ALIGNED8(ptr) ((((Card32)(ptr)) % 8) == 0) -#define MEMCK_PADDING_ALIGN8 (sizeof(Card32) * 2) - -/*------------------------------------------*/ -#define MEMCK_WRAP8(wPtr) \ - \ - { \ - if (wPtr) { \ - if (MEMCK_IS_ALIGNED8(wPtr)) { \ - *((pCard32)wPtr) = 2; \ - ((pCard32)wPtr)++; \ - *((pCard32)wPtr) = 2; \ - ((pCard32)wPtr)++; \ - } else { \ - *((pCard32)wPtr) = 1; \ - ((pCard32)wPtr)++; \ - } \ - DebugAssert(MEMCK_IS_ALIGNED8(wPtr)); \ - } \ - } - -/*--------------------------------------------*/ -#define MEMCK_UNWRAP8(wPtr) \ - \ - { \ - DebugAssert(wPtr); \ - DebugAssert(MEMCK_IS_ALIGNED8(wPtr)); \ - ((pCard32)wPtr)--; \ - if (*((pCard32)wPtr) == 2) { \ - ((pCard32)wPtr)--; \ - DebugAssert(*((pCard32)wPtr) == 2); \ - } else { \ - DebugAssert(*((pCard32)wPtr) == 1); \ - } \ - } - -#else - -#define MEMCK_PADDING_ALIGN8 (0) -#define MEMCK_WRAP8(wPtr) -#define MEMCK_UNWRAP8(wPtr) - -#endif - -#define MEMCK_HEAD_SIZE (sizeof(Card32)) - -/*------------------------------------------------*/ -/* From internal data pointer to clients' pointer */ -/*------------------------------------------------*/ - -#define MEMCK_MakeClientPtr(basePtr) ((void *)((pCard8)(basePtr) + MEMCK_HEAD_SIZE)) - -/*------------------------------*/ -/* From client's pointer to ... */ -/*------------------------------*/ - -#define MEMCK_BasePtr(clientPtr) ((void *)((pCard8)(clientPtr)-MEMCK_HEAD_SIZE)) -#define MEMCK_GET_HEAD32(clientPtr) (*((pCard32)MEMCK_BasePtr(clientPtr))) -#define PD_GET_SZ16(clientPtr) (MEMCK_GET_HEAD32(clientPtr) & 0x0000FFFF) -#define PD_GET_DS16(clientPtr) ((MEMCK_GET_HEAD32(clientPtr) & 0xFFFF0000) >> 16) -#define MEMCK_IsOSmalloc(clientPtr) (MEMCK_GET_HEAD32(clientPtr) & MEMCK_OSMALLOC_BIT) -#define PD_GetBlock(clientPtr) ((pCard8)(clientPtr)-PD_GET_DS16(clientPtr)) - -/* -** size set by MEMCK_SetTotalSize() inlcudes MEMCK_EXTRA_BYTES, actual saved -** (HEAD) is either ( size<<1 | 1) or (DS)(SZ) depends on if Blk==NULL -*/ - -#define MEMCK_SetTotalSize(clientPtr, Blk, siz) \ - \ - MEMCK_GET_HEAD32(clientPtr) = \ - ((Blk == NULL) ? ((((Card32)(siz)) << 1) | MEMCK_OSMALLOC_BIT) : ((Card32)(siz) | (((Card32)(clientPtr) - (Card32)(Blk)) << 16))) - -#define MEMCK_GetTotalSize(clientPtr) \ - (MEMCK_IsOSmalloc(clientPtr) ? (MEMCK_GET_HEAD32(clientPtr) >> 1) : PD_GET_SZ16(clientPtr)) - -#define MEMCK_AlignSize(M_Size) \ - (((((M_Size) + PREFERREDALIGN - 1) / PREFERREDALIGN) * PREFERREDALIGN) + MEMCK_PADDING_ALIGN8) - -/* -** Guard the tail for debugging purpose - because a corrupted -** tail is not easily spotted if it is from the big block -*/ - -#define MEMCK_TAIL_SIZE (sizeof(Card32)) -#define MEMCK_EXTRA_BYTES (MEMCK_HEAD_SIZE + MEMCK_TAIL_SIZE) -#define MEMCK_TAIL_GUARD 0xADBEADBE /* ADoBE ADoBE */ -#define MEMCK_TAIL_FREED 0xFEEDFEED /* FrEED FrEED */ - -#define MEMCK_GetClientSize(clientPtr) (MEMCK_GetTotalSize(clientPtr) - MEMCK_EXTRA_BYTES) - -#if MEMCK_NEED_ALIGN8 -#define MEMCK_GetInnerClientSize(clientPtr) (MEMCK_GetClientSize(clientPtr) - MEMCK_PADDING_ALIGN8) -#endif - -/*---------------------------------------*/ -/* From client's Ptr to its tail's value */ -/*---------------------------------------*/ - -#define MEMCK_GET_TAIL(clientPtr) *((pCard32)((pCard8)(clientPtr) + MEMCK_GetClientSize(clientPtr))) - -/*----------------------------*/ -/* Guard client's pointer Ptr */ -/*----------------------------*/ - -#define MEMCK_GuardTail(clientPtr) MEMCK_GET_TAIL(clientPtr) = (Card32)MEMCK_TAIL_GUARD -#define MEMCK_FreedTail(clientPtr) MEMCK_GET_TAIL(clientPtr) = (Card32)MEMCK_TAIL_FREED -#define MEMCK_BadTail(clientPtr) (MEMCK_GET_TAIL(clientPtr) != (Card32)MEMCK_TAIL_GUARD) - -/* -------------------------------------------------- */ -/* ------------ pointers from MemStores ------------- */ -/* -------------------------------------------------- */ -static void *memstore_mallocinternal( - int len, - MemCheck_MemStore index, - char *filename, - int lineno) { - PMemStore pms = &(gMStores[index]); - PPerstoreData ppd; - int size; - pCard8 pByte = NULL; - - pms->used += len; - DebugAssert(len < PD_BLOCK_MAX_SIZE + 4); - - /* The buffer we return has some extra bytes for internal use */ - len += MEMCK_EXTRA_BYTES; - /* Make len multiple of 4 */ - len = ((len + 3) / 4) * 4; - - /* search left overs */ - for (ppd = pms->head[0].next; ppd; ppd = ppd->next) { - if (ppd->left < len) - continue; - pByte = ppd->data + ppd->size - ppd->left; - ppd->left -= len; - break; - } - - if (pByte == NULL) { - /* need a new block for this store */ - if (len < PD_BLOCK_MIN_SIZE) - size = MAX(2 * len, PD_BLOCK_MIN_SIZE); - else - size = len; - size += sizeof(PerstoreData); - /* One OSProvided_Malloc() allocates both the structure and its data */ - ppd = (PPerstoreData)OSProvided_Malloc(size); - if (!ppd) - return NULL; - - ppd->data = (pCard8)((pCard8)ppd + sizeof(PerstoreData)); - ppd->size = - ppd->left = size - sizeof(PerstoreData); - ppd->discard = 0; - ppd->next = pms->head[0].next; - if (pms->head[0].next) - pms->head[0].next->prev = ppd; - ppd->prev = &(pms->head[0]); - pms->head[0].next = ppd; - - pByte = ppd->data; - ppd->left -= len; - - pms->numBlocks++; - pms->reqBlocks++; - pms->allocated += size; - if (size > pms->maxBlock) - pms->maxBlock = size; - if ((pms->allocated - pms->freed) > pms->maxInUse) - pms->maxInUse = (pms->allocated - pms->freed); - } - - if (pByte) { - /* Now tag pByte with length and block - size include the extra bytes */ - pByte = (pCard8)MEMCK_MakeClientPtr(pByte); - /* size set by MEMCK_SetTotalSize() inlcudes MEMCK_EXTRA_BYTES */ - MEMCK_SetTotalSize(pByte, ppd, len); - MEMCK_GuardTail(pByte); - } - return ((void *)pByte); -} - -static MemCheck_MemStore FindMemStore( - PPerstoreData ptr) { - PPerstoreData ppd; - int index; - for (index = memck_store_default; index < memck_store_maxMemStore; index++) { - ppd = gMStores[index].head[0].next; - while (ppd) { - if ((Card32)ptr > (Card32)ppd && - (Card32)ptr < (Card32)(ppd->data + ppd->size)) { - Assert(ppd == (PPerstoreData)PD_GetBlock(ptr)); - return (MemCheck_MemStore)index; - } - ppd = ppd->next; - } - } - return memck_store_maxMemStore; -} - -static boolean memstore_remove_from_store( - PPerstoreData ppd, - MemCheck_MemStore index) { - PMemStore pms = &(gMStores[index]); - if (ppd->discard + ppd->left == ppd->size) { - pms->numBlocks--; - pms->freed += ppd->size + sizeof(PerstoreData); - if (ppd->next) - ppd->next->prev = ppd->prev; - if (ppd->prev) - ppd->prev->next = ppd->next; - OSProvided_Free((void *)ppd); - return 1; - } - return 0; -} - -/* ptr must be memck_per_*alloc()-ed */ -static void memstore_freeinternal( - void *ptr) { - PPerstoreData ppd; - Int32 size; - ppd = (PPerstoreData)PD_GetBlock(ptr); - /* size set by MEMCK_SetTotalSize() inlcudes MEMCK_EXTRA_BYTES */ - size = MEMCK_GetTotalSize(ptr); - if (MEMCK_BasePtr(ptr) == (void *)(ppd->data + ppd->size - ppd->left - size)) { - /* Coalesce to left space */ - ppd->left += size; - } else { - /* don't bother to coalesce with other free items, just remember the size freed */ - ppd->discard += size; - /* remove the block if we can */ - if (ppd->discard + ppd->left == ppd->size) { - MemCheck_MemStore index = FindMemStore((PerstoreData *)ptr); - memstore_remove_from_store(ppd, index); - } - } -} - -#if (MEMCK_NEED_ALIGN8 == 0) - -static void *memstore_reallocinternal( - void *old_ptr, - int new_size, - char *filename, - int lineno) { - void *new_ptr; - MemCheck_MemStore index = FindMemStore((PerstoreData *)old_ptr); - DebugAssert(index < memck_store_maxMemStore); - /* realloc from Store index */ - new_ptr = memck_mallocinternal(new_size, index, filename, lineno); - if (new_ptr) { - /* size set by MEMCK_SetTotalSize() inlcudes MEMCK_EXTRA_BYTES */ - int old_size = MEMCK_GetTotalSize(old_ptr); - old_size -= MEMCK_EXTRA_BYTES; - - DebugAssert(old_size < gMStores[index].maxBlock); - DebugAssert(old_size >= 0); - - bcopy(old_ptr, new_ptr, MIN(old_size, new_size)); - memck_freeinternal(old_ptr, filename, lineno); - } - return (new_ptr); -} - -#endif /* MEMCK_NEED_ALIGN8 == 0 */ - -static void FreeOneMemStore( - MemCheck_MemStore index) { - PMemStore pms = &(gMStores[index]); - PPerstoreData ppd, next; - - if (pms->head[0].next == NULL) - return; - - /* Free the list */ - ppd = pms->head[0].next; - while (ppd) { - next = ppd->next; - memstore_remove_from_store(ppd, index); - ppd = next; - } - - /* These are report for current job - reset for next job*/ - pms->maxInUse = 0; - pms->allocated = 0; - pms->used = 0; - pms->freed = 0; -} - -/* -------------------------------------------------- */ -/* ----------------- SINGEXPORT functions ---------- */ - -SINGEXPORT int memck_Startup(char *logfilePathName) { - time_t timer; - - logfile = fopen(logfilePathName, "a+"); - if (logfile) { - time(&timer); - fprintf(logfile, "========= Started: %s\n", ctime(&timer)); - } - return (logfile == NULL); -} - -SINGEXPORT void memck_Shutdown(void) { - time_t timer; - int index; - for (index = memck_store_default; index < memck_store_maxMemStore; index++) - FreeOneMemStore((MemCheck_MemStore)index); - if (logfile) { - time(&timer); - fprintf(logfile, "========== Finished: %s\n", ctime(&timer)); - } - - fclose(logfile); - logfile = NULL; -} - -/* ----------------------------------------------------------- */ -SINGEXPORT void *memck_mallocinternal( - int size, - MemCheck_MemStore index, - char *filename, - int lineno) { - void *result; - - DebugAssert(index >= memck_store_default); - DebugAssert(index < memck_store_maxMemStore); - - /* malloc()/mc_Malloc() also allows 0 byte allocation */ - if (size < 0 || size > MEMCK_MAX_SIZE) - return NULL; - - size = MEMCK_AlignSize(size); - - if ((index > memck_store_default) && size < PD_BLOCK_MAX_SIZE) { - result = memstore_mallocinternal(size, index, filename, lineno); - DebugAssert(!MEMCK_IsOSmalloc(result)); - } else { - /* old way, but with MEMCK_EXTRA_BYTES more bytes allocated */ - result = OSProvided_Malloc(size + MEMCK_EXTRA_BYTES); - /* Convert to user's pointer, skip the header bytes and tag it */ - if (result) { - result = MEMCK_MakeClientPtr(result); - /* size set by MEMCK_SetTotalSize() inlcudes MEMCK_EXTRA_BYTES */ - MEMCK_SetTotalSize(result, NULL, size + MEMCK_EXTRA_BYTES); - MEMCK_GuardTail(result); - } - } - - if (!result) - return NULL; - - if (!StoreAllocation(result, size, index, filename, lineno)) { - if (MEMCK_IsOSmalloc(result)) - OSProvided_Free(MEMCK_BasePtr(result)); - else - memstore_freeinternal(result); - return NULL; - } - - ++distAllocCount; - ++distAllocNdx; - if (memck_PrintAllAllocFreeCalls) { - if (logfile) - fprintf(logfile, - "Malloc 0x%x\t siz=%d tcnt=%d cnt=%d file=%s@%d\n", - result, - size, - ++totalAllocCount, - distAllocCount, filename, lineno); - if (logfile) fflush(logfile); - } - - MEMCK_WRAP8(result); - - return (result); -} - -/* ----------------------------------------------------------- */ -SINGEXPORT void *memck_callocinternal( - int count, - int size, - MemCheck_MemStore index, - char *filename, - int lineno) { - void *result; - - DebugAssert(index >= memck_store_default); - DebugAssert(index < memck_store_maxMemStore); - - result = memck_mallocinternal(count * size, index, filename, lineno); - if (result) - memset(result, 0, count * size); - return result; -} - -/* ----------------------------------------------------------- */ -SINGEXPORT void memck_freeinternal( - void *ptr, - char *filename, - int lineno) { - /* Just ignore if ptr is NULL, but memck_free used to Assert() */ - DebugAssert(ptr != NULL); - - if (ptr == NULL) - return; - - MEMCK_UNWRAP8(ptr); - - ReplaceAllocation(ptr, 0, 0, 0, 0); - --distAllocCount; - if (MEMCK_BadTail(ptr)) { - if (logfile) { - fprintf(logfile, "WARNING: pointer 0x%x had been over written! Freed in file=%s@%d\n", ptr, filename, lineno); - fflush(logfile); - } - DebugAssert(0); - } else { - /* Mark tail to different value, so we can trap multiple - OSProvided_Free() on same pointer */ - MEMCK_FreedTail(ptr); - } - - if (memck_PrintAllAllocFreeCalls) { - if (logfile) { - fprintf(logfile, - "Free 0x%x\t cnt=%d file=%s@%d\n", - ptr, - distAllocCount, - filename, lineno); - fflush(logfile); - } - } - - if (MEMCK_IsOSmalloc(ptr)) { - OSProvided_Free(MEMCK_BasePtr(ptr)); - } else { - memstore_freeinternal(ptr); - } -} - -/* ----------------------------------------------------------- */ -SINGEXPORT void *memck_reallocinternal( - void *old_ptr, - int new_size, - char *filename, - int lineno) { -#if MEMCK_NEED_ALIGN8 - - int old_size; - MemCheck_MemStore myIndex; - void *new_ptr; - void *tmp_ptr = old_ptr; - - MEMCK_UNWRAP8(tmp_ptr); - - if (MEMCK_IsOSmalloc(tmp_ptr)) - myIndex = memck_store_default; - else { - myIndex = FindMemStore((PerstoreData *)tmp_ptr); - DebugAssert(myIndex < memck_store_maxMemStore); - } - - old_size = MEMCK_GetInnerClientSize(tmp_ptr); - - new_ptr = memck_mallocinternal(new_size, myIndex, filename, lineno); - if (new_ptr == NULL) - return (NULL); - - memcpy(new_ptr, old_ptr, MIN(old_size, new_size)); - memck_freeinternal(old_ptr, filename, lineno); - return (new_ptr); - -#else /* !MEMCK_NEED_ALIGN8 */ - - new_size = MEMCK_AlignSize(new_size); - - if (MEMCK_IsOSmalloc(old_ptr)) { - void *new_ptr; - /* old way, but with MEMCK_EXTRA_BYTES more bytes allocated */ - new_ptr = OSProvided_Realloc(MEMCK_BasePtr(old_ptr), new_size + MEMCK_EXTRA_BYTES); - if (new_ptr) { - new_ptr = MEMCK_MakeClientPtr(new_ptr); - /* size set by MEMCK_SetTotalSize() inlcudes MEMCK_EXTRA_BYTES */ - MEMCK_SetTotalSize(new_ptr, NULL, new_size + MEMCK_EXTRA_BYTES); - MEMCK_GuardTail(new_ptr); - } - if (new_ptr == NULL) - return NULL; - - ReplaceAllocation(old_ptr, new_ptr, new_size, filename, lineno); - ++distAllocNdx; - if (new_ptr != old_ptr) { - if (memck_PrintAllAllocFreeCalls) { - if (logfile) { - fprintf(logfile, - "Realloc 0x%x\t cnt=%d file=%s@%d\n", - old_ptr, - --distAllocCount, - filename, lineno); - fprintf(logfile, - "==> 0x%x\t siz=%d cnt=%d file=%s@%d\n", - new_ptr, - new_size, - ++distAllocCount, filename, lineno); - fflush(logfile); - } - } - } - return (new_ptr); - } else { - return (memstore_reallocinternal(old_ptr, new_size, filename, lineno)); - } - -#endif /* MEMCK_NEED_ALIGN8 */ -} - -/* ----------------------------------------------------------- */ - -SINGEXPORT void memck_ResetMemLeakDetection(void) { - distAllocCount = 0; - distAllocNdx = 0; - ResetAllocations(); -} - -SINGEXPORT void memck_CheckMemLeaks(void) { - PrintAllocations(); - memck_ResetMemLeakDetection(); -} - -#else -static int placeholder(void) { - return 0; -} -#endif diff --git a/c/autohint/autohintlib/source/ac/merge.c b/c/autohint/autohintlib/source/ac/merge.c deleted file mode 100644 index 01c7d473c..000000000 --- a/c/autohint/autohintlib/source/ac/merge.c +++ /dev/null @@ -1,469 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* merge.c */ - -#include "ac.h" - -private -boolean CloseElements(e1, e2, loc1, loc2, vert) -/* TRUE iff you can go from e1 to e2 without going out of band loc1..loc2 */ -/* if vert is TRUE, then band is vert (test x values) */ -/* else band is horizontal (test y values) */ -/* band is expanded by CLSMRG in each direction */ -#define CLSMRG (PSDist(20)) - register PPathElt e1, - e2; -register Fixed loc1, loc2; -register boolean vert; -{ - register Fixed tmp; - Fixed x, y; - register PPathElt e; - if (e1 == e2) return TRUE; - if (loc1 < loc2) { - if ((loc2 - loc1) > 5 * CLSMRG) - return FALSE; - loc1 -= CLSMRG; - loc2 += CLSMRG; - } else { - if ((loc1 - loc2) > 5 * CLSMRG) - return FALSE; - tmp = loc1; - loc1 = loc2 - CLSMRG; - loc2 = tmp + CLSMRG; - } - - e = e1; - while (TRUE) { - if (e == e2) return TRUE; - GetEndPoint(e, &x, &y); - tmp = vert ? x : y; - if (tmp > loc2 || tmp < loc1) return FALSE; - if (e->type == CLOSEPATH) - e = GetDest(e); - else - e = e->next; - if (e == e1) return FALSE; - } -} - -public -boolean CloseSegs(s1, s2, vert) PClrSeg s1, s2; -boolean vert; -{ - /* TRUE if the elements for these segs are "close" in the path */ - PPathElt e1, e2; - Fixed loc1, loc2; - if (s1 == s2) return TRUE; - e1 = s1->sElt; - e2 = s2->sElt; - if (e1 == NULL || e2 == NULL) return TRUE; - loc1 = s1->sLoc; - loc2 = s2->sLoc; - return (CloseElements(e1, e2, loc1, loc2, vert) || - CloseElements(e2, e1, loc2, loc1, vert)) - ? TRUE - : FALSE; -} - -public -procedure DoPrune() { - /* Step through valList to the first item which is not pruned; set - that to be the head of the list. Then remove from the list - any subsequent element for which 'pruned' is true. - */ - PClrVal vL = valList, vPrv; - while (vL != NULL && vL->pruned) - vL = vL->vNxt; - valList = vL; - if (vL == NULL) return; - vPrv = vL; - vL = vL->vNxt; - while (vL != NULL) { - if (vL->pruned) - vPrv->vNxt = vL = vL->vNxt; - else { - vPrv = vL; - vL = vL->vNxt; - } - } -} - -private -PClrVal PruneOne(sLst, hFlg, sL, i) - PClrVal sLst, - sL; -boolean hFlg; -integer i; -{ - /* Simply set the 'pruned' field to True for sLst. */ - if (hFlg) - ReportPruneHVal(sLst, sL, i); - else - ReportPruneVVal(sLst, sL, i); - sLst->pruned = TRUE; - return sLst->vNxt; -} - -#define PRNDIST (PSDist(10)) -#define PRNFCTR (3L) - -#define PruneLt(val, v) \ - (((v) < (FixedPosInf / 10L) && (val) < (FixedPosInf / PRNFCTR)) ? ((val)*PRNFCTR < (v)*10L) : ((val) / 10L < (v) / PRNFCTR)) -#define PruneLe(val, v) \ - (((val) < (FixedPosInf / PRNFCTR)) ? ((v) <= (val)*PRNFCTR) : ((v) / PRNFCTR <= (val))) -#define PruneGt(val, v) \ - (((val) < (FixedPosInf / PRNFCTR)) ? ((v) > (val)*PRNFCTR) : ((v) / PRNFCTR > (val))) -#define MUCHFCTR (50L) -#define PruneMuchGt(val, v) \ - (((val) < (FixedPosInf / MUCHFCTR)) ? ((v) > (val)*MUCHFCTR) : ((v) / MUCHFCTR > (val))) -#define VERYMUCHFCTR (100L) -#define PruneVeryMuchGt(val, v) \ - (((val) < (FixedPosInf / VERYMUCHFCTR)) ? ((v) > (val)*VERYMUCHFCTR) : ((v) / VERYMUCHFCTR > (val))) - -/* The changes made here and in PruneHVals are to fix a bug in - MinisterLight/E where the top left point was not getting colored. */ -public -procedure PruneVVals() { - PClrVal sLst, sL, sPrv; - PClrSeg seg1, seg2, sg1, sg2; - Fixed lft, rht, l, r, prndist; - Fixed val, v, abstmp; - boolean flg, otherLft, otherRht; - sLst = valList; - sPrv = NULL; - prndist = PRNDIST; - while (sLst != NULL) { - flg = TRUE; - otherLft = otherRht = FALSE; - val = sLst->vVal; - lft = sLst->vLoc1; - rht = sLst->vLoc2; - seg1 = sLst->vSeg1; - seg2 = sLst->vSeg2; - sL = valList; - while (sL != NULL) { - v = sL->vVal; - sg1 = sL->vSeg1; - sg2 = sL->vSeg2; - l = sL->vLoc1; - r = sL->vLoc2; - if ((l == lft && r == rht) || PruneLe(val, v)) goto NxtSL; - if (rht + prndist >= r && lft - prndist <= l && - (val < FixInt(100L) && PruneMuchGt(val, v) ? (CloseSegs(seg1, sg1, TRUE) || CloseSegs(seg2, sg2, TRUE)) : (CloseSegs(seg1, sg1, TRUE) && CloseSegs(seg2, sg2, TRUE)))) { - sLst = PruneOne(sLst, FALSE, sL, 1L); - flg = FALSE; - break; - } - if (seg1 != NULL && seg2 != NULL) { - if (ac_abs(l - lft) < FixOne) { - if (!otherLft && PruneLt(val, v) && ac_abs(l - r) < ac_abs(lft - rht) && - CloseSegs(seg1, sg1, TRUE)) - otherLft = TRUE; - if (seg2->sType == sBEND && CloseSegs(seg1, sg1, TRUE)) { - sLst = PruneOne(sLst, FALSE, sL, 2L); - flg = FALSE; - break; - } - } - if (ac_abs(r - rht) < FixOne) { - if (!otherRht && PruneLt(val, v) && ac_abs(l - r) < ac_abs(lft - rht) && - CloseSegs(seg2, sg2, TRUE)) - otherRht = TRUE; - if (seg1->sType == sBEND && CloseSegs(seg2, sg2, TRUE)) { - sLst = PruneOne(sLst, FALSE, sL, 3L); - flg = FALSE; - break; - } - } - if (otherLft && otherRht) { - sLst = PruneOne(sLst, FALSE, sL, 4L); - flg = FALSE; - break; - } - } - NxtSL: - sL = sL->vNxt; - } - if (flg) { - sPrv = sLst; - sLst = sLst->vNxt; - } - } - DoPrune(); -} - -#define Fix16 (FixOne << 4) -public -procedure PruneHVals() { - PClrVal sLst, sL, sPrv; - PClrSeg seg1, seg2, sg1, sg2; - Fixed bot, top, t, b; - Fixed val, v, abstmp, prndist; - boolean flg, otherTop, otherBot, topInBlue, botInBlue, ghst; - sLst = valList; - sPrv = NULL; - prndist = PRNDIST; - while (sLst != NULL) { - flg = TRUE; - otherTop = otherBot = FALSE; - seg1 = sLst->vSeg1; - seg2 = sLst->vSeg2; /* seg1 is bottom, seg2 is top */ - ghst = sLst->vGhst; - val = sLst->vVal; - bot = sLst->vLoc1; - top = sLst->vLoc2; - topInBlue = InBlueBand(top, lenTopBands, topBands); - botInBlue = InBlueBand(bot, lenBotBands, botBands); - sL = valList; - while (sL != NULL) { - if ((sL->pruned) && (doAligns || !doStems)) - goto NxtSL; - - sg1 = sL->vSeg1; - sg2 = sL->vSeg2; /* sg1 is b, sg2 is t */ - v = sL->vVal; - if (!ghst && sL->vGhst && !PruneVeryMuchGt(val, v)) - goto NxtSL; /* Do not bother checking if we should prune, if slSt is not ghost hint, sL is ghost hint, */ - /* and not (sL->vVal is more than 50* bigger than sLst->vVal. */ - /* Basically, we prefer non-ghost hints over ghost unless vVal is really low. */ - b = sL->vLoc1; - t = sL->vLoc2; - if (t == top && b == bot) - goto NxtSL; /* Don't compare two valList elements that have the same top and bot. */ - - if ( /* Prune sLst if the following are all true */ - PruneGt(val, v) && /* v is more than 3* val */ - - ((YgoesUp && top + prndist >= t && bot - prndist <= b) || - (!YgoesUp && top - prndist <= t && bot + prndist >= b)) && /* The sL hint is within the sLst hint */ - - (val < FixInt(100L) && - PruneMuchGt(val, v) - ? (CloseSegs(seg1, sg1, FALSE) || CloseSegs(seg2, sg2, FALSE)) - : (CloseSegs(seg1, sg1, FALSE) && CloseSegs(seg2, sg2, FALSE))) && /* val is less than 100, and the segments are close to each other.*/ - - (val < Fix16 || - /* needs to be greater than FixOne << 3 for - HelveticaNeue 95 Black G has val == 2.125 - Poetica/ItalicOne H has val == .66 */ - ( - (!topInBlue || top == t) && - (!botInBlue || bot == b))) /* either val is small ( < Fixed 16) or, for both bot and top, the value is the same as SL, and not in a blue zone. */ - - ) { - sLst = PruneOne(sLst, TRUE, sL, 5L); - flg = FALSE; - break; - } - - if (seg1 == NULL || seg2 == NULL) - goto NxtSL; /* If the sLst is aghost hint, skip */ - - if (ac_abs(b - bot) < FixOne) { - /* If the bottoms of the stems are within 1 unit */ - - if (PruneGt(val, v) && /* If v is more than 3* val) */ - !topInBlue && - seg2->sType == sBEND && - CloseSegs(seg1, sg1, FALSE) /* and the tops are close */ - ) { - sLst = PruneOne(sLst, TRUE, sL, 6L); - flg = FALSE; - break; - } - - if (!otherBot && PruneLt(val, v) && ac_abs(t - b) < ac_abs(top - bot)) { - if (CloseSegs(seg1, sg1, FALSE)) - otherBot = TRUE; - } - } - - if (ac_abs(t - top) < FixOne) { - /* If the tops of the stems are within 1 unit */ - if (PruneGt(val, v) && /* If v is more than 3* val) */ - !botInBlue && - seg2->sType == sBEND && - CloseSegs(seg1, sg1, FALSE)) /* and the tops are close */ - { - sLst = PruneOne(sLst, TRUE, sL, 7L); - flg = FALSE; - break; - } - - if (!otherTop && PruneLt(val, v) && ac_abs(t - b) < ac_abs(top - bot)) { - if (CloseSegs(seg2, sg2, FALSE)) - otherTop = TRUE; - } - } - - if (otherBot && otherTop) { - /* if v less than val by a factor of 3, and the sl stem width is less than the sLst stem width, - and the tops and bottoms are close */ - sLst = PruneOne(sLst, TRUE, sL, 8L); - flg = FALSE; - break; - } - NxtSL: - sL = sL->vNxt; - } - if (flg) { - sPrv = sLst; - sLst = sLst->vNxt; - } - } - DoPrune(); -} - -private -procedure FindBestVals(vL) register PClrVal vL; -{ - register Fixed bV, bS; - register Fixed t, b; - register PClrVal vL2, vPrv, bstV; - for (; vL != NULL; vL = vL->vNxt) { - if (vL->vBst != NULL) continue; /* already assigned */ - bV = vL->vVal; - bS = vL->vSpc; - bstV = vL; - b = vL->vLoc1; - t = vL->vLoc2; - vL2 = vL->vNxt; - vPrv = vL; - for (; vL2 != NULL; vL2 = vL2->vNxt) { - if (vL2->vBst != NULL || vL2->vLoc1 != b || vL2->vLoc2 != t) continue; - if ((vL2->vSpc == bS && vL2->vVal > bV) || (vL2->vSpc > bS)) { - bS = vL2->vSpc; - bV = vL2->vVal; - bstV = vL2; - } - vL2->vBst = vPrv; - vPrv = vL2; - } - while (vPrv != NULL) { - vL2 = vPrv->vBst; - vPrv->vBst = bstV; - vPrv = vL2; - } - } -} - -/* The following changes were made to fix a problem in Ryumin-Light and - possibly other fonts as well. The old version causes bogus coloring - and extra newcolors. */ -private -procedure ReplaceVals(oldB, oldT, newB, newT, newBst, vert) register Fixed oldB, oldT, newB, newT; -boolean vert; -register PClrVal newBst; -{ - register PClrVal vL; - for (vL = valList; vL != NULL; vL = vL->vNxt) { - if (vL->vLoc1 != oldB || vL->vLoc2 != oldT || vL->merge) continue; - if (showClrInfo) { - if (vert) - ReportMergeVVal(oldB, oldT, newB, newT, - vL->vVal, vL->vSpc, newBst->vVal, newBst->vSpc); - else - ReportMergeHVal(oldB, oldT, newB, newT, - vL->vVal, vL->vSpc, newBst->vVal, newBst->vSpc); - } - vL->vLoc1 = newB; - vL->vLoc2 = newT; - vL->vVal = newBst->vVal; - vL->vSpc = newBst->vSpc; - vL->vBst = newBst; - vL->merge = TRUE; - } -} - -public -procedure MergeVals(vert) boolean vert; -{ - register PClrVal vLst, vL; - PClrVal bstV, bV; - PClrSeg seg1, seg2, sg1, sg2; - Fixed bot, top, b, t; - Fixed val, v, spc, s, abstmp; - boolean ghst; - FindBestVals(valList); - /* We want to get rid of wider hstems in favor or overlapping smaller hstems only if we are NOT reporting all possible alignment zones. */ - if (addStemExtremesCB == NULL) - return; - - for (vL = valList; vL != NULL; vL = vL->vNxt) vL->merge = FALSE; - while (TRUE) { - /* pick best from valList with merge field still set to false */ - vLst = valList; - vL = NULL; - while (vLst != NULL) { - if (vLst->merge) { - } else if (vL == NULL || CompareValues(vLst->vBst, vL->vBst, SFACTOR, 0L)) - vL = vLst; - vLst = vLst->vNxt; - } - if (vL == NULL) break; - vL->merge = TRUE; - ghst = vL->vGhst; - b = vL->vLoc1; - t = vL->vLoc2; - sg1 = vL->vSeg1; /* left or bottom */ - sg2 = vL->vSeg2; /* right or top */ - vLst = valList; - bV = vL->vBst; - v = bV->vVal; - s = bV->vSpc; - while (vLst != NULL) { /* consider replacing vLst by vL */ - if (vLst->merge || ghst != vLst->vGhst) goto NxtVL; - bot = vLst->vLoc1; - top = vLst->vLoc2; - if (bot == b && top == t) - goto NxtVL; - bstV = vLst->vBst; - val = bstV->vVal; - spc = bstV->vSpc; - if ((top == t && CloseSegs(sg2, vLst->vSeg2, vert) && - (vert || (!InBlueBand(t, lenTopBands, topBands) && - !InBlueBand(bot, lenBotBands, botBands) && - !InBlueBand(b, lenBotBands, botBands)))) || - (bot == b && CloseSegs(sg1, vLst->vSeg1, vert) && - (vert || (!InBlueBand(b, lenBotBands, botBands) && - !InBlueBand(t, lenTopBands, topBands) && - !InBlueBand(top, lenTopBands, topBands)))) || - (ac_abs(top - t) <= maxMerge && ac_abs(bot - b) <= maxMerge && - (vert || (t == top || !InBlueBand(top, lenTopBands, topBands))) && - (vert || (b == bot || !InBlueBand(bot, lenBotBands, botBands))))) { - if (s == spc && val == v && !vert) { - if (InBlueBand(t, lenTopBands, topBands)) { - if ((YgoesUp && t > top) || (!YgoesUp && t < top)) - goto replace; - } else if (InBlueBand(b, lenBotBands, botBands)) { - if ((YgoesUp && b < bot) || (!YgoesUp && b > bot)) - goto replace; - } - } else - goto replace; - } else if (s == spc && sg1 != NULL && sg2 != NULL) { - seg1 = vLst->vSeg1; - seg2 = vLst->vSeg2; - if (seg1 != NULL && seg2 != NULL) { - if (ac_abs(bot - b) <= FixOne && ac_abs(top - t) <= maxBendMerge) { - if (seg2->sType == sBEND && - (vert || !InBlueBand(top, lenTopBands, topBands))) - goto replace; - } else if (ac_abs(top - t) <= FixOne && ac_abs(bot - b) <= maxBendMerge) { - if (v > val && seg1->sType == sBEND && - (vert || !InBlueBand(bot, lenBotBands, botBands))) - goto replace; - } - } - } - goto NxtVL; - replace: - ReplaceVals(bot, top, b, t, bV, vert); - NxtVL: - vLst = vLst->vNxt; - } - vL = vL->vNxt; - } -} diff --git a/c/autohint/autohintlib/source/ac/misc.c b/c/autohint/autohintlib/source/ac/misc.c deleted file mode 100644 index 0dc641d1b..000000000 --- a/c/autohint/autohintlib/source/ac/misc.c +++ /dev/null @@ -1,276 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* misc.c */ - -#include "ac.h" -#include "machinedep.h" - -public -integer CountSubPaths() { - register PPathElt e = pathStart; - integer cnt = 0; - while (e != NULL) { - if (e->type == MOVETO) cnt++; - e = e->next; - } - return cnt; -} -public -procedure RoundPathCoords() { - register PPathElt e; - e = pathStart; - while (e != NULL) { - if (e->type == CURVETO) { - e->x1 = FHalfRnd(e->x1); - e->y1 = FHalfRnd(e->y1); - e->x2 = FHalfRnd(e->x2); - e->y2 = FHalfRnd(e->y2); - e->x3 = FHalfRnd(e->x3); - e->y3 = FHalfRnd(e->y3); - } else if (e->type == LINETO || e->type == MOVETO) { - e->x = FHalfRnd(e->x); - e->y = FHalfRnd(e->y); - } - e = e->next; - } -} - -private -integer CheckForClr() { - PPathElt mt, cp; - mt = pathStart; - while (mt != NULL) { - if (mt->type != MOVETO) { - ExpectedMoveTo(mt); - return -1L; - } - cp = GetClosedBy(mt); - if (cp == NULL) { - ReportMissingClosePath(); - return -1L; - } - mt = cp->next; - } - return 0L; -} - -public -boolean PreCheckForColoring() { - PPathElt e, nxt; - integer cnt = 0; - integer chk; - while (pathEnd != NULL) { - if (pathEnd->type == MOVETO) - Delete(pathEnd); - else if (pathEnd->type != CLOSEPATH) { - ReportMissingClosePath(); - return FALSE; - } else - break; - } - e = pathStart; - while (e != NULL) { - if (e->type == CLOSEPATH) { - if (e == pathEnd) break; - nxt = e->next; - if (nxt->type == MOVETO) { - e = nxt; - continue; - } - if (nxt->type == CLOSEPATH) { /* remove double closepath */ - Delete(nxt); - continue; - } - } - e = e->next; - } - while (TRUE) { - chk = CheckForClr(); - if (chk == -1L) return FALSE; - if (chk == 0L) break; - if (++cnt > 10) { - LogMsg("Looping in PreCheckForHints!\n", WARNING, OK, TRUE); - break; - } - } - return TRUE; -} - -private -PPathElt GetSubpathNext(e) register PPathElt e; -{ - while (TRUE) { - e = e->next; - if (e == NULL) break; - if (e->type == CLOSEPATH) break; - if (!IsTiny(e)) break; - } - return e; -} - -private -PPathElt GetSubpathPrev(e) register PPathElt e; -{ - while (TRUE) { - e = e->prev; - if (e == NULL) break; - if (e->type == MOVETO) e = GetClosedBy(e); - if (!IsTiny(e)) break; - } - return e; -} - -private -boolean AddAutoFlexProp(e, yflag) PPathElt e; -boolean yflag; -{ - PPathElt e0 = e, e1 = e->next; - if (e0->type != CURVETO || e1->type != CURVETO) { - FlushLogFiles(); - sprintf(globmsg, "Illegal input in character file: %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - /* Don't add flex to linear curves. */ - if (yflag && e0->y3 == e1->y1 && e1->y1 == e1->y2 && e1->y2 == e1->y3) - return FALSE; - else if (e0->x3 == e1->x1 && e1->x1 == e1->x2 && e1->x2 == e1->x3) - return FALSE; - e0->yFlex = yflag; - e1->yFlex = yflag; - e0->isFlex = TRUE; - e1->isFlex = TRUE; - return TRUE; -} - -#define LENGTHRATIOCUTOFF 0.11 /* 0.33^2 : two curves must be in approximate length ratio of 1:3 or better */ - -private -procedure TryYFlex(e, n, x0, y0, x1, y1) - PPathElt e, - n; -Fixed x0, y0, x1, y1; -{ - Fixed x2, y2, x3, y3, x4, y4, abstmp; - PPathElt p, q; - boolean top, dwn; - longreal d0sq, d1sq, quot, dx, dy; - - GetEndPoint(n, &x2, &y2); - dy = ac_abs(y0 - y2); - if (dy > flexCand) return; /* too big diff in bases. If dy is within flexCand, flex will fail , but we will report it as a candidate. */ - dx = ac_abs(x0 - x2); - if (dx < MAXFLEX) return; /* Let's not add flex to features less than MAXFLEX wide. */ - if (dx < (3 * ac_abs(y0 - y2))) return; /* We want the width to be at least three times the height. */ - if (ProdLt0(y1 - y0, y1 - y2)) return; /* y0 and y2 not on same side of y1 */ - - /* check the ratios of the "lengths" of 'e' and 'n' */ - dx = (x1 - x0); - dy = (y1 - y0); - d0sq = dx * dx + dy * dy; - dx = (x2 - x1); - dy = (y2 - y1); - d1sq = dx * dx + dy * dy; - quot = (d0sq > d1sq) ? (d1sq / d0sq) : (d0sq / d1sq); - if (quot < LENGTHRATIOCUTOFF) return; - - if (flexStrict) { - q = GetSubpathNext(n); - GetEndPoint(q, &x3, &y3); - if (ProdLt0(y3 - y2, y1 - y2)) return; /* y1 and y3 not on same side of y2 */ - p = GetSubpathPrev(e); - GetEndPoint(p->prev, &x4, &y4); - if (ProdLt0(y4 - y0, y1 - y0)) return; /* y1 and y4 not on same side of y0 */ - top = (x0 > x1) ? TRUE : FALSE; - if (YgoesUp) - dwn = (y1 < y0) ? TRUE : FALSE; - else - dwn = (y1 > y0) ? TRUE : FALSE; - if ((top && !dwn) || (!top && dwn)) return; /* concave */ - } - if (n != e->next) { /* something in the way */ - n = e->next; - ReportTryFlexError(n->type == CLOSEPATH, x1, y1); - return; - } - if (y0 != y2) { - ReportTryFlexNearMiss(x0, y0, x2, y2); - return; - } - if (AddAutoFlexProp(e, TRUE)) - ReportAddFlex(); -} - -private -procedure TryXFlex(e, n, x0, y0, x1, y1) - PPathElt e, - n; -Fixed x0, y0, x1, y1; -{ - Fixed x2, y2, x3, y3, x4, y4, abstmp; - PPathElt p, q; - boolean lft; - longreal d0sq, d1sq, quot, dx, dy; - - GetEndPoint(n, &x2, &y2); - dx = ac_abs(y0 - y2); - if (dx > flexCand) return; /* too big diff in bases */ - - dy = ac_abs(x0 - x2); - if (dy < MAXFLEX) return; /* Let's not add flex to features less than MAXFLEX wide. */ - if (dy < (3 * ac_abs(x0 - x2))) return; /* We want the width to be at least three times the height. */ - - if (ProdLt0(x1 - x0, x1 - x2)) return; /* x0 and x2 not on same side of x1 */ - - /* check the ratios of the "lengths" of 'e' and 'n' */ - dx = (x1 - x0); - dy = (y1 - y0); - d0sq = dx * dx + dy * dy; - dx = (x2 - x1); - dy = (y2 - y1); - d1sq = dx * dx + dy * dy; - quot = (d0sq > d1sq) ? (d1sq / d0sq) : (d0sq / d1sq); - if (quot < LENGTHRATIOCUTOFF) return; - - if (flexStrict) { - q = GetSubpathNext(n); - GetEndPoint(q, &x3, &y3); - if (ProdLt0(x3 - x2, x1 - x2)) return; /* x1 and x3 not on same side of x2 */ - p = GetSubpathPrev(e); - GetEndPoint(p->prev, &x4, &y4); - if (ProdLt0(x4 - x0, x1 - x0)) return; /* x1 and x4 not on same side of x0 */ - if (YgoesUp) - lft = (y0 > y2) ? TRUE : FALSE; - else - lft = (y0 < y2) ? TRUE : FALSE; - if ((lft && x0 > x1) || (!lft && x0 < x1)) return; /* concave */ - } - if (n != e->next) { /* something in the way */ - n = e->next; - ReportTryFlexError(n->type == CLOSEPATH, x1, y1); - return; - } - if (x0 != x2) { - ReportTryFlexNearMiss(x0, y0, x2, y2); - return; - } - if (AddAutoFlexProp(e, FALSE)) - ReportAddFlex(); -} - -public -procedure AutoAddFlex() { - PPathElt e, n; - Fixed x0, y0, x1, y1, abstmp; - e = pathStart; - while (e != NULL) { - if (e->type != CURVETO || e->isFlex) goto Nxt; - n = GetSubpathNext(e); - if (n->type != CURVETO) goto Nxt; - GetEndPoints(e, &x0, &y0, &x1, &y1); - if (ac_abs(y0 - y1) <= MAXFLEX) TryYFlex(e, n, x0, y0, x1, y1); - if (ac_abs(x0 - x1) <= MAXFLEX) TryXFlex(e, n, x0, y0, x1, y1); - Nxt: - e = e->next; - } -} diff --git a/c/autohint/autohintlib/source/ac/path.c b/c/autohint/autohintlib/source/ac/path.c deleted file mode 100644 index 8d172b906..000000000 --- a/c/autohint/autohintlib/source/ac/path.c +++ /dev/null @@ -1,419 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* path.c */ - -#include "ac.h" - -#if 0 -#define GetSubpathNext(e) ((e)->type == CLOSEPATH) ? GetDest(e) : (e)->next -#define GetSubpathPrev(e) ((e)->type == MOVETO) ? GetClosedBy(e) : (e)->prev - -private -procedure NumberSubpath(e) register PPathElt e; -{ - /* number the elements of the subpath starting at e */ - PPathElt first; - integer cnt; - first = e; - cnt = 0; - while (TRUE) { - e->count = cnt; - e = GetSubpathNext(e); - if (e == first) break; - cnt++; - } -} - -private -integer TstClrLsts(l1, l2, flg) - PSegLnkLst l1, - l2; -boolean flg; -{ - integer result, i; - result = -1; - if (l1 != NULL) - while (l2 != NULL) { - i = TestColorLst(l1, l2->lnk->seg->sLnk, flg, FALSE); - if (i == 0) return 0L; - if (i == 1) result = 1; - l2 = l2->next; - } - return result; -} - -private -integer ClrLstLen(lst) PSegLnkLst lst; -{ - integer cnt = 0; - while (lst != NULL) { - cnt++; - lst = lst->next; - } - return cnt; -} - -private -boolean SameClrLsts(l1, l2, flg) - PSegLnkLst l1, - l2; -boolean flg; -{ - if (ClrLstLen(l1) != ClrLstLen(l2)) return FALSE; - return (TstClrLsts(l1, l2, flg) == -1) ? TRUE : FALSE; -} - -private -procedure FindConflicts(e) PPathElt e; -{ - /* find conflicts in subpath for e */ - PSegLnkLst hLst, vLst, phLst, pvLst; - boolean checked; - PPathElt start, p; - integer h, v; - if (e->type != MOVETO) e = GetDest(e); - while (TRUE) { - hLst = e->Hs; - vLst = e->Vs; - if (hLst == NULL && vLst == NULL) goto Nxt; - /* search for previous subpath element with conflicting colors */ - start = e; - p = GetSubpathPrev(e); - checked = TRUE; - while (p != start) { - if (checked) { - if (p->type == CLOSEPATH) checked = FALSE; - } - phLst = p->Hs; - pvLst = p->Vs; - if (phLst == NULL && pvLst == NULL) goto NxtP; - if (hLst != NULL && phLst != NULL) - h = TstClrLsts(hLst, phLst, YgoesUp); - else if (hLst == NULL && phLst == NULL) - h = -1; - else - h = 1; - if (vLst != NULL && pvLst != NULL) - v = TstClrLsts(vLst, pvLst, TRUE); - else if (vLst == NULL && pvLst == NULL) - v = -1; - else - v = 1; - if (checked && h == -1L && v == -1L && - ClrLstLen(hLst) == ClrLstLen(phLst) && - ClrLstLen(vLst) == ClrLstLen(pvLst)) { /* same coloring */ - p = p->conflict; - if (p != NULL) e->conflict = p; - break; - } - if (h == 0 || v == 0) { - e->conflict = p; - break; - } - NxtP: - p = GetSubpathPrev(p); - } - Nxt: - e = e->next; - if (e == NULL) break; - if (e->type == MOVETO) break; - } -} - -private -integer CountConflicts(e) PPathElt e; -{ - /* e is a proposed closepath. return number of color conflicts */ - integer conflicts, nc, c, cnt; - PPathElt first, conflict; - first = e; - cnt = conflicts = nc = 0; - NumberSubpath(e); - while (TRUE) { - conflict = e->conflict; - if (conflict == NULL) goto Nxt; - c = conflict->count; - if (c >= nc && c < cnt) { - conflicts++; - nc = cnt; - } - Nxt: - e = GetSubpathNext(e); - cnt++; - if (e == first) break; - } - return conflicts; -} - -private -boolean TestColorSection(first, after) - /* returns FALSE if there is a conflict, TRUE otherwise */ - PPathElt first, - after; -{ - PPathElt e; - PSegLnkLst hLst, vLst, hPrv, vPrv; - e = first; - hPrv = vPrv = NULL; - while (e != after) { - hLst = e->Hs; - vLst = e->Vs; - if (hLst != NULL && !SameClrLsts(hLst, hPrv, YgoesUp)) { - if (TestColorLst(hLst, Hprimary, YgoesUp, TRUE) == 0) return FALSE; - hPrv = hLst; - } - if (vLst != NULL && !SameClrLsts(vLst, vPrv, TRUE)) { - if (TestColorLst(vLst, Vprimary, TRUE, TRUE) == 0) return FALSE; - vPrv = vLst; - } - e = GetSubpathNext(e); - } - return TRUE; -} - -private -boolean StartsOkWithPrimaryClrs(cp) - PPathElt cp; -{ - /* return TRUE if proposed cp yields subpath whose - first coloring section is consistent with the primary coloring */ - PPathElt e, conflict, first; - integer c, cnt; - first = e = cp; - NumberSubpath(e); - cnt = 0; - while (TRUE) { - conflict = e->conflict; - if (conflict != NULL) { - c = conflict->count; - if (c < cnt) break; - } - e = GetSubpathNext(e); - if (e == cp) break; - cnt++; - } - /* e is start of new coloring in subpath */ - return TestColorSection(first, e); -} - -private -boolean OkCandidate(cp, conflict, isShort) - PPathElt cp, - conflict; -boolean isShort; -{ - PPathElt cpConflict, nxt, nxtConflict; - if (cp == conflict) return FALSE; - cpConflict = cp->conflict; - if (cpConflict == conflict) return FALSE; - if (!isShort) return TRUE; - /* don't put short closepath between two conflicting elements */ - nxt = cp->next; - if (nxt == NULL) return TRUE; - nxtConflict = nxt->conflict; - if (nxtConflict == cp) return FALSE; - return TRUE; -} - -private -boolean OkJunction(p, e) PPathElt p, e; -{ - Fixed x, y, x0, y0, x1, y1, sm; - if (p->isFlex && e->isFlex) return FALSE; - if (e->type == CURVETO) { - x0 = e->x1; - y0 = e->y1; - } else - GetEndPoint(e, &x0, &y0); - if (p->type == CURVETO) { - x1 = p->x2; - y1 = p->y2; - } else - GetEndPoint(p->prev, &x1, &y1); - GetEndPoint(p, &x, &y); - return CheckSmoothness(x0, y0, x, y, x1, y1, &sm); -} - -private -PPathElt FindMinConflict(e) PPathElt e; -{ - PPathElt conflict, cp, cpnxt, bestCP, first, prevConflict; - integer best, cnt; - boolean isShort; - first = e; - if (e->type != MOVETO) e = GetDest(e); - best = 10000; - prevConflict = bestCP = NULL; - while (TRUE) { - conflict = e->conflict; - if (conflict == NULL || conflict == prevConflict) goto Nxt; - cp = e; - isShort = FALSE; - while (TRUE) { /* search for a possible place for a closepath */ - if ((cp->type == LINETO || cp->type == CLOSEPATH) && !IsShort(cp)) break; - if (!OkCandidate(cp, conflict, isShort)) { - cp = NULL; - break; - } - cp = GetSubpathPrev(cp); - } - if (cp == NULL) { /* consider short cp */ - cp = e; - isShort = TRUE; - while (TRUE) { - if (cp->type == CLOSEPATH || cp->type == LINETO) break; - if (cp->type == CURVETO && cp != e) { - cpnxt = GetSubpathNext(cp); - if (cpnxt->type == CURVETO && OkJunction(cp, cpnxt)) break; - } - if (!OkCandidate(cp, conflict, isShort)) { - cp = NULL; - break; - } - cp = GetSubpathPrev(cp); - } - } - if (cp == NULL) goto Nxt; - if (DEBUG) ReportConflictCheck(e, conflict, cp); - cnt = CountConflicts(cp); - if (isShort) { - cnt++; /* bias against short closepaths */ - if (DEBUG) fprintf(OUTPUTBUFF, "short, "); - } - if (!StartsOkWithPrimaryClrs(cp)) { - cnt++; /* bias against conflict with primary colors */ - if (DEBUG) fprintf(OUTPUTBUFF, "conflicts with primary, "); - } - if (DEBUG) ReportConflictCnt(cp, cnt); - if (cnt < best || (cnt == best && cp->type == CLOSEPATH)) { - /* break ties in favor of leaving closepath where it is */ - bestCP = cp; - best = cnt; - } - Nxt: - e = e->next; - if (e == NULL) break; - if (e->type == MOVETO) break; - if (conflict != NULL) prevConflict = conflict; - } - if (DEBUG) { - fprintf(OUTPUTBUFF, "final choice: cnt %d ", best); - ReportBestCP(first, bestCP); - } - return bestCP; -} - -#define SubpathConflictsWithPrimary(e) \ - (!TestColorSection(e, GetClosedBy(e))) - -private -PPathElt NewCP(cp) PPathElt cp; -{ - PPathElt first; - first = cp; - while (TRUE) { - if (cp->newCP) return cp; - cp = GetSubpathPrev(cp); - if (cp == first) return cp; - } -} - -private -boolean ReorderSubpaths() { - /* if first subpath conflicts with primary, - and there is a later subpath that does not, - do tailsubpaths until later one becomes first */ - PPathElt e, first; - first = e = pathStart; - if (!SubpathConflictsWithPrimary(e)) return FALSE; - while (TRUE) { - e = GetClosedBy(e); - if (e == NULL) break; - e = e->next; /* moveto */ - if (e == NULL) break; - if (!SubpathConflictsWithPrimary(e)) { - first = e; - goto Rt; - } - } - if (e == NULL) { - /* if first subpath start with coloring that conflicts with primary, - and there is a later subpath that does not, - do tailsubpaths until later one becomes first */ - e = GetClosedBy(first); - if (StartsOkWithPrimaryClrs(NewCP(e))) return FALSE; - while (TRUE) { - e = e->next; /* moveto */ - if (e == NULL) return FALSE; - e = GetClosedBy(e); - if (e == NULL) return FALSE; - if (StartsOkWithPrimaryClrs(NewCP(e))) break; - } - } - first = GetDest(e); -Rt: - if (DEBUG) ReportMoveSubpath(first, "front"); - while (TRUE) { - e = pathStart; - if (e == first) break; - if (DEBUG) ReportMoveSubpath(e, "end"); - MoveSubpathToEnd(e); - } - return TRUE; -} - -public -boolean RotateSubpaths(flg) boolean flg; -{ - PPathElt e, cp, nxt; - boolean chng = FALSE, chngSub; - DEBUG = flg; - e = pathStart; - if (DEBUG) PrintMessage("RotateSubpaths"); - while (e != NULL) { - e->conflict = NULL; - e->newCP = FALSE; - e = e->next; - } - e = pathStart; - while (e != NULL) { - FindConflicts(e); - cp = FindMinConflict(e); - e = GetClosedBy(e); - nxt = e->next; - if (cp == NULL) goto Nxt; - if (cp->type == CLOSEPATH) goto Nxt; - cp->newCP = TRUE; - /* dont change yet so preserve info for ReorderSubpaths */ - chng = TRUE; - Nxt: - e = nxt; - } - chngSub = chng; - if (DEBUG) PrintMessage("ReorderSubpaths"); - if (ReorderSubpaths()) chng = TRUE; - if (!chngSub) goto Done; - e = pathStart; /* must reload since may have reordered */ - while (e != NULL) { - nxt = GetClosedBy(e); /* closepath for this subpath */ - if (nxt != NULL) nxt = nxt->next; /* start of next subpath */ - while (e != NULL) { - if (e->type == CLOSEPATH) break; - if (e->newCP) { - ReportRotateSubpath(e); - /* fix this someday - if (e->type == CURVETO) PointClosePath(cpEnd); - else ChangeClosePath(); - */ - break; - } - e = e->next; - } - e = nxt; - } -Done: - if (DEBUG) PrintMessage("done with ReorderSubpaths"); - return chng; -} -#endif diff --git a/c/autohint/autohintlib/source/ac/pick.c b/c/autohint/autohintlib/source/ac/pick.c deleted file mode 100644 index 3f791d9a0..000000000 --- a/c/autohint/autohintlib/source/ac/pick.c +++ /dev/null @@ -1,420 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* pick.c */ - -#include "ac.h" -#include "machinedep.h" - -private -PClrVal Vrejects, Hrejects; - -public -procedure InitPick(reason) integer reason; -{ - switch (reason) { - case STARTUP: - case RESTART: - Vrejects = Hrejects = NULL; - } -} - -#define LtPruneB(val) ((val) < FixOne && ((val) << 10) < pruneB) - -private -boolean ConsiderPicking(bestSpc, bestVal, colorList, prevBestVal) - Fixed bestSpc, - bestVal, prevBestVal; -PClrVal colorList; -{ - if (bestSpc > 0L) return TRUE; - if (colorList == NULL) return bestVal >= pruneD; - if (bestVal > pruneA) return TRUE; - if (LtPruneB(bestVal)) return FALSE; - return (bestVal < FixedPosInf / pruneC) ? (prevBestVal <= bestVal * pruneC) : (prevBestVal / pruneC <= bestVal); -} - -public -procedure PickVVals(valList) PClrVal valList; -{ - PClrVal colorList, rejectList, vlist, prev, best, bestPrev, nxt; - Fixed bestVal, prevBestVal; - Fixed lft, rght, vlft, vrght; - colorList = rejectList = NULL; - prevBestVal = 0; - while (TRUE) { - vlist = valList; - prev = bestPrev = best = NULL; - while (vlist != NULL) { - if ((best == NULL || CompareValues(vlist, best, spcBonus, 0L)) && - ConsiderPicking(vlist->vSpc, vlist->vVal, colorList, prevBestVal)) { - best = vlist; - bestPrev = prev; - bestVal = vlist->vVal; - } - prev = vlist; - vlist = vlist->vNxt; - } - if (best == NULL) break; /* no more */ - if (bestPrev == NULL) - valList = best->vNxt; - else - bestPrev->vNxt = best->vNxt; - /* have now removed best from valList */ - best->vNxt = colorList; /* add best to front of list */ - colorList = best; - prevBestVal = bestVal; - lft = best->vLoc1 - bandMargin; - rght = best->vLoc2 + bandMargin; - /* remove segments from valList that overlap lft..rght */ - vlist = valList; - prev = NULL; - while (vlist != NULL) { - vlft = vlist->vLoc1; - vrght = vlist->vLoc2; - if ((vlft <= rght) && (vrght >= lft)) { - nxt = vlist->vNxt; - vlist->vNxt = rejectList; - rejectList = vlist; - vlist = nxt; - if (prev == NULL) - valList = vlist; - else - prev->vNxt = vlist; - } else { - prev = vlist; - vlist = vlist->vNxt; - } - } - } - vlist = valList; /* move rest of valList to rejectList */ - while (vlist != NULL) { - nxt = vlist->vNxt; - vlist->vNxt = rejectList; - rejectList = vlist; - vlist = nxt; - } - if (colorList == NULL) ClrVBnds(); - Vcoloring = colorList; - Vrejects = rejectList; -} - -private -boolean InSerifBand(y0, y1, n, p) register Fixed y0, y1, *p; -integer n; -{ - register integer i; - if (n <= 0) return FALSE; - y0 = itfmy(y0); - y1 = itfmy(y1); - if (y0 > y1) { - Fixed tmp = y1; - y1 = y0; - y0 = tmp; - } - for (i = 0; i < n; i += 2) - if (p[i] <= y0 && p[i + 1] >= y1) return TRUE; - return FALSE; -} - -private -boolean ConsiderValForSeg(val, seg, loc, nb, b, ns, s, primary) - PClrVal val; -PClrSeg seg; -Fixed loc, *b, *s; -integer nb, ns; -boolean primary; -{ - if (primary && val->vSpc > 0.0) return TRUE; - if (InBlueBand(loc, nb, b)) return TRUE; - if (val->vSpc <= 0.0 && - InSerifBand(seg->sMax, seg->sMin, ns, s)) return FALSE; - if (LtPruneB(val->vVal)) return FALSE; - return TRUE; -} - -private -PClrVal FndBstVal( - seg, seg1Flg, cList, rList, nb, b, ns, s, locFlg, hFlg) - PClrSeg seg; -PClrVal cList, rList; -boolean seg1Flg; -integer nb, ns; -Fixed *b, *s; -boolean locFlg, hFlg; -{ - Fixed loc, vloc; - PClrVal best, vList, initLst; - PClrSeg vseg; - best = NULL; - loc = seg->sLoc; - vList = cList; - while (TRUE) { - initLst = vList; - while (vList != NULL) { - if (seg1Flg) { - vseg = vList->vSeg1; - vloc = vList->vLoc1; - } else { - vseg = vList->vSeg2; - vloc = vList->vLoc2; - } - if (abs(loc - vloc) <= maxMerge && - (locFlg ? !vList->vGhst : (vseg == seg || CloseSegs(seg, vseg, !hFlg))) && - (best == NULL || - (vList->vVal == best->vVal && vList->vSpc == best->vSpc && - vList->initVal > best->initVal) || - CompareValues(vList, best, spcBonus, 3L)) && - /* last arg is "ghostshift" that penalizes ghost values */ - /* ghost values are set to 20 */ - /* so ghostshift of 3 means prefer nonghost if its value is > (20 >> 3) */ - ConsiderValForSeg(vList, seg, loc, nb, b, ns, s, TRUE)) - best = vList; - vList = vList->vNxt; - } - if (initLst == rList) break; - vList = rList; - } - if (showClrInfo) - ReportFndBstVal(seg, best, hFlg); - return best; -} - -#define FixSixteenth (0x10L) -private -PClrVal FindBestValForSeg( - seg, seg1Flg, cList, rList, nb, b, ns, s, hFlg) - PClrSeg seg; -PClrVal cList, rList; -boolean seg1Flg, hFlg; -integer nb, ns; -Fixed *b, *s; -{ - PClrVal best, nonghst, ghst = NULL; - best = FndBstVal(seg, seg1Flg, cList, rList, nb, b, ns, s, FALSE, hFlg); - if (best != NULL && best->vGhst) { - nonghst = FndBstVal(seg, seg1Flg, cList, rList, nb, b, ns, s, TRUE, hFlg); - /* If nonghst hints are "better" use it instead of ghost band. */ - if (nonghst != NULL && nonghst->vVal >= FixInt(2)) { - /* threshold must be greater than 1.004 for ITC Garamond Ultra "q" */ - ghst = best; - best = nonghst; - } - } - if (best != NULL) { - if (best->vVal < FixSixteenth && - (ghst == NULL || ghst->vVal < FixSixteenth)) best = NULL; - /* threshold must be > .035 for Monotype/Plantin/Bold Thorn - and < .08 for Bookman2/Italic asterisk */ - else - best->pruned = FALSE; - } - return best; -} - -private -boolean MembValList(val, vList) register PClrVal val, vList; -{ - while (vList != NULL) { - if (val == vList) return TRUE; - vList = vList->vNxt; - } - return FALSE; -} - -private -PClrVal PrevVal(val, vList) register PClrVal val, vList; -{ - PClrVal prev; - if (val == vList) return NULL; - prev = vList; - while (TRUE) { - vList = vList->vNxt; - if (vList == NULL) { - FlushLogFiles(); - sprintf(globmsg, "Malformed value list in %s.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - - if (vList == val) return prev; - prev = vList; - } -} - -private -procedure FindRealVal(vlist, top, bot, pseg1, pseg2) - PClrVal vlist; -PClrSeg *pseg1, *pseg2; -Fixed top, bot; -{ - while (vlist != NULL) { - if (vlist->vLoc2 == top && vlist->vLoc1 == bot && !vlist->vGhst) { - *pseg1 = vlist->vSeg1; - *pseg2 = vlist->vSeg2; - return; - } - vlist = vlist->vNxt; - } -} - -public -procedure PickHVals(valList) PClrVal valList; -{ - PClrVal vlist, colorList, rejectList, bestPrev, prev, best, nxt; - Fixed bestVal, prevBestVal; - Fixed bot, top, vtop, vbot; - PClrVal newBst; - PClrSeg seg1, seg2; - colorList = rejectList = NULL; - prevBestVal = 0; - while (TRUE) { - vlist = valList; - prev = bestPrev = best = NULL; - while (vlist != NULL) { - if ((best == NULL || CompareValues(vlist, best, spcBonus, 0L)) && - ConsiderPicking(vlist->vSpc, vlist->vVal, colorList, prevBestVal)) { - best = vlist; - bestPrev = prev; - bestVal = vlist->vVal; - } - prev = vlist; - vlist = vlist->vNxt; - } - if (best != NULL) { - seg1 = best->vSeg1; - seg2 = best->vSeg2; - if (best->vGhst) { /* find real segments at same loc as best */ - FindRealVal(valList, best->vLoc2, best->vLoc1, &seg1, &seg2); - } - if (seg1->sType == sGHOST) { - /* newBst = FindBestValForSeg(seg2, FALSE, valList, - (PClrVal)NULL, 0L, (Fixed *)NIL, 0L, (Fixed *)NIL, TRUE);*/ - newBst = seg2->sLnk; - if (newBst != NULL && newBst != best && MembValList(newBst, valList)) { - best = newBst; - bestPrev = PrevVal(best, valList); - } - } else if (seg2->sType == sGHOST) { - /* newBst = FindBestValForSeg(seg1, TRUE, valList, - (PClrVal)NULL, 0L, (Fixed *)NIL, 0L, (Fixed *)NIL, TRUE); */ - newBst = seg2->sLnk; - if (newBst != NULL && newBst != best && MembValList(newBst, valList)) { - best = newBst; - bestPrev = PrevVal(best, valList); - } - } - } - if (best == NULL) goto noMore; - prevBestVal = bestVal; - if (bestPrev == NULL) - valList = best->vNxt; - else - bestPrev->vNxt = best->vNxt; - /* have now removed best from valList */ - best->vNxt = colorList; - colorList = best; /* add best to front of list */ - bot = best->vLoc1; - top = best->vLoc2; - /* The next if statement was added so that ghost bands are given - 0 width for doing the conflict tests for bands too close together. - This was a problem in Minion/DisplayItalic onequarter and onehalf. */ - if (best->vGhst) { /* collapse width */ - if (best->vSeg1->sType == sGHOST) - bot = top; - else - top = bot; - } - if (YgoesUp) { - bot -= bandMargin; - top += bandMargin; - } else { - bot += bandMargin; - top -= bandMargin; - } - /* remove segments from valList that overlap bot..top */ - vlist = valList; - prev = NULL; - while (vlist != NULL) { - vbot = vlist->vLoc1; - vtop = vlist->vLoc2; - /* The next if statement was added so that ghost bands are given - 0 width for doing the conflict tests for bands too close together. */ - if (vlist->vGhst) { /* collapse width */ - if (vlist->vSeg1->sType == sGHOST) - vbot = vtop; - else - vtop = vbot; - } - if ((YgoesUp && (vbot <= top) && (vtop >= bot)) || - ((!YgoesUp && (vbot >= top) && (vtop <= bot)))) { - nxt = vlist->vNxt; - vlist->vNxt = rejectList; - rejectList = vlist; - vlist = nxt; - if (prev == NULL) - valList = vlist; - else - prev->vNxt = vlist; - } else { - prev = vlist; - vlist = vlist->vNxt; - } - } - } -noMore: - vlist = valList; /* move rest of valList to rejectList */ - while (vlist != NULL) { - nxt = vlist->vNxt; - vlist->vNxt = rejectList; - rejectList = vlist; - vlist = nxt; - } - if (colorList == NULL) ClrHBnds(); - Hcoloring = colorList; - Hrejects = rejectList; -} - -private -procedure FindBestValForSegs(sList, seg1Flg, cList, rList, nb, b, ns, s, hFlg) - PClrSeg sList; -PClrVal cList, rList; -boolean seg1Flg, hFlg; -integer nb, ns; -Fixed *b, *s; -{ - PClrVal best; - while (sList != NULL) { - best = FindBestValForSeg(sList, seg1Flg, cList, rList, nb, b, ns, s, hFlg); - sList->sLnk = best; - sList = sList->sNxt; - } -} - -private -procedure SetPruned() { - register PClrVal vL = valList; - while (vL != NULL) { - vL->pruned = TRUE; - vL = vL->vNxt; - } -} - -public -procedure FindBestHVals() { - SetPruned(); - FindBestValForSegs(topList, FALSE, valList, NULL, - lenTopBands, topBands, 0L, (Fixed *)NULL, TRUE); - FindBestValForSegs(botList, TRUE, valList, NULL, - lenBotBands, botBands, 0L, (Fixed *)NULL, TRUE); - DoPrune(); -} - -public -procedure FindBestVVals() { - SetPruned(); - FindBestValForSegs(leftList, TRUE, valList, NULL, - 0L, (Fixed *)NULL, numSerifs, serifs, FALSE); - FindBestValForSegs(rightList, FALSE, valList, NULL, - 0L, (Fixed *)NULL, numSerifs, serifs, FALSE); - DoPrune(); -} diff --git a/c/autohint/autohintlib/source/ac/read.c b/c/autohint/autohintlib/source/ac/read.c deleted file mode 100644 index 350fc64db..000000000 --- a/c/autohint/autohintlib/source/ac/read.c +++ /dev/null @@ -1,866 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* read.c */ - -#include -#include "ac.h" -#include "bftoac.h" -#include "charpath.h" -#include "cryptdefs.h" -#include "fipublic.h" -#include "machinedep.h" -#include "opcodes.h" -#include "optable.h" -#define PRINT_READ (0) - -#ifdef IS_LIB -extern const char *bezstring; -#endif - -char bezGlyphName[64]; - -private -Fixed currentx, currenty; /* used to calculate absolute coordinates */ -private -Fixed tempx, tempy; /* used to calculate relative coordinates */ -#define STKMAX (20) -private -Fixed stk[STKMAX]; -private -integer stkindex; -private -boolean flex, startchar; -private -boolean forMultiMaster, includeHints; -/* Reading file for comparison of multiple master data and hint information. - Reads into PCharPathElt structure instead of PPathElt. */ - -private -real origEmSquare = 0.0; - -public -Fixed ScaleAbs(unscaled) Fixed unscaled; -{ - Fixed temp1; - if (!scalinghints) - return unscaled; - if (origEmSquare == 0.0) { - char *fistr; - SetFntInfoFileName(SCALEDHINTSINFO); - if ((fistr = GetFntInfo("OrigEmSqUnits", ACOPTIONAL)) == NULL) - origEmSquare = 1000.0; - else { - sscanf(fistr, "%g", &origEmSquare); -#if DOMEMCHECK - memck_free(fistr); -#else - ACFREEMEM(fistr); -#endif - } - ResetFntInfoFileName(); - } - temp1 = (Fixed)(1000.0 / origEmSquare * ((real)unscaled)); - return temp1; -} - -public -Fixed UnScaleAbs(scaled) Fixed scaled; -{ - Fixed temp1; - if (!scalinghints) - return scaled; - if (origEmSquare == 0.0) { - char *fistr; - SetFntInfoFileName(SCALEDHINTSINFO); - if ((fistr = GetFntInfo("OrigEmSqUnits", ACOPTIONAL)) == NULL) - origEmSquare = 1000.0; - else { - sscanf(fistr, "%g", &origEmSquare); -#if DOMEMCHECK - memck_free(fistr); -#else - ACFREEMEM(fistr); -#endif - } - ResetFntInfoFileName(); - } - temp1 = (Fixed)(origEmSquare / 1000.0 * ((real)scaled)); - temp1 = FRnd(temp1); - return (temp1); -} - -private -Fixed Pop() { - if (stkindex <= 0) { - FlushLogFiles(); - sprintf(globmsg, "Stack underflow while reading %s file.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - stkindex--; - return stk[stkindex]; -} - -private -procedure Push(r) Fixed r; -{ - if (stkindex >= STKMAX) { - FlushLogFiles(); - sprintf(globmsg, "Stack underflow while reading %s file.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - stk[stkindex] = r; - stkindex++; -} - -private -procedure Pop2() { - (void)Pop(); - (void)Pop(); -} - -private -procedure PopPCd(pcd) Cd *pcd; -{ - pcd->y = Pop(); - pcd->x = Pop(); -} - -#define DoDelta(dx, dy) \ - currentx += (dx); \ - currenty += (dy) - -private -PPathElt AppendElement(etype) integer etype; -{ - PPathElt e; - e = (PPathElt)Alloc(sizeof(PathElt)); - e->type = (short)etype; - if (pathEnd != NULL) { - pathEnd->next = e; - e->prev = pathEnd; - } else - pathStart = e; - pathEnd = e; - return e; -} - -private -procedure psDIV() { - Fixed x, y; - y = Pop(); - x = Pop(); - if (y == FixInt(100)) - x /= 100L; /* this will usually be the case */ - else - x = (x * FixOne) / y; - Push(x); -} - -private -procedure RDcurveto(c1, c2, c3) Cd c1, c2, c3; -{ - if (!forMultiMaster) { - PPathElt new; - new = AppendElement(CURVETO); - new->x1 = tfmx(ScaleAbs(c1.x)); - new->y1 = tfmy(ScaleAbs(c1.y)); - new->x2 = tfmx(ScaleAbs(c2.x)); - new->y2 = tfmy(ScaleAbs(c2.y)); - new->x3 = tfmx(ScaleAbs(c3.x)); - new->y3 = tfmy(ScaleAbs(c3.y)); - } else { - PCharPathElt new; - new = AppendCharPathElement(RCT); - new->x = tempx; - new->y = tempy; - new->x1 = c1.x; - new->y1 = c1.y; - new->x2 = c2.x; - new->y2 = c2.y; - new->x3 = c3.x; - new->y3 = c3.y; - new->rx1 = c1.x - tempx; - new->ry1 = c1.y - tempy; - new->rx2 = c2.x - c1.x; - new->ry2 = c2.y - c1.y; - new->rx3 = c3.x - c2.x; - new->ry3 = c3.y - c2.y; - if (flex) new->isFlex = TRUE; - } -} - -private -procedure RDmtlt(etype) integer etype; -{ - if (!forMultiMaster) { - PPathElt new; - new = AppendElement(etype); - new->x = tfmx(ScaleAbs(currentx)); - new->y = tfmy(ScaleAbs(currenty)); - return; - } else { - PCharPathElt new; - new = AppendCharPathElement(etype == LINETO ? RDT : RMT); - new->x = currentx; - new->y = currenty; - new->rx = tempx; - new->ry = tempy; - } -} - -#define RDlineto() RDmtlt(LINETO) -#define RDmoveto() RDmtlt(MOVETO) - -private -procedure psRDT() { - Cd c; - PopPCd(&c); - tempx = c.x; - tempy = c.y; - DoDelta(c.x, c.y); - RDlineto(); -} - -private -procedure psHDT() { - Fixed dx; - tempy = 0; - dx = tempx = Pop(); - currentx += dx; - RDlineto(); -} - -private -procedure psVDT() { - Fixed dy; - tempx = 0; - dy = tempy = Pop(); - currenty += dy; - RDlineto(); -} - -private -procedure psRMT() { - Cd c; - PopPCd(&c); - if (flex) return; - tempx = c.x; - tempy = c.y; - DoDelta(c.x, c.y); - RDmoveto(); -} - -private -procedure psHMT() { - Fixed dx; - tempy = 0; - dx = tempx = Pop(); - currentx += dx; - RDmoveto(); -} - -private -procedure psVMT() { - Fixed dy; - tempx = 0; - dy = tempy = Pop(); - currenty += dy; - RDmoveto(); -} - -private -procedure Rct(c1, c2, c3) Cd c1, c2, c3; -{ - tempx = currentx; - tempy = currenty; - DoDelta(c1.x, c1.y); - c1.x = currentx; - c1.y = currenty; - DoDelta(c2.x, c2.y); - c2.x = currentx; - c2.y = currenty; - DoDelta(c3.x, c3.y); - c3.x = currentx; - c3.y = currenty; - RDcurveto(c1, c2, c3); -} - -private -procedure psRCT() { - Cd c1, c2, c3; - PopPCd(&c3); - PopPCd(&c2); - PopPCd(&c1); - Rct(c1, c2, c3); -} - -private -procedure psVHCT() { - Cd c1, c2, c3; - c3.y = 0; - c3.x = Pop(); - PopPCd(&c2); - c1.y = Pop(); - c1.x = 0; - Rct(c1, c2, c3); -} - -private -procedure psHVCT() { - Cd c1, c2, c3; - c3.y = Pop(); - c3.x = 0; - PopPCd(&c2); - c1.y = 0; - c1.x = Pop(); - Rct(c1, c2, c3); -} - -private -procedure psCP() { - if (!forMultiMaster) - AppendElement(CLOSEPATH); - else - AppendCharPathElement(CP); -} - -private -procedure psMT() { - Cd c; - c.y = Pop(); - c.x = Pop(); - tempx = c.x - currentx; - tempy = c.y - currenty; - currenty = c.y; - currentx = c.x; - RDmoveto(); -} - -private -procedure psDT() { - Cd c; - c.y = Pop(); - c.x = Pop(); - tempx = c.x - currentx; - tempy = c.y - currenty; - currenty = c.y; - currentx = c.x; - RDlineto(); -} - -private -procedure psCT() { - Cd c1, c2, c3; - tempx = currentx; - tempy = currenty; - PopPCd(&c3); - PopPCd(&c2); - PopPCd(&c1); - RDcurveto(c1, c2, c3); -} - -private -procedure psFLX() { - Cd c0, c1, c2, c3, c4, c5; - integer i; - for (i = 0; i < 5; i++) (void)Pop(); - PopPCd(&c5); - PopPCd(&c4); - PopPCd(&c3); - PopPCd(&c2); - PopPCd(&c1); - PopPCd(&c0); - Rct(c0, c1, c2); - Rct(c3, c4, c5); - flex = FALSE; -} - -private -procedure ReadHintInfo(nm, str) char nm; -const char *str; -{ - Cd c0; - short hinttype = - nm == 'y' ? RY : nm == 'b' ? RB : nm == 'm' ? RM + ESCVAL : RV + ESCVAL; - long elt1, elt2; - PopPCd(&c0); - c0.y += c0.x; /* make absolute */ - /* Look for comment of path elements used to determine this band. */ - if (sscanf(str, " %% %ld %ld", &elt1, &elt2) != 2) { - FlushLogFiles(); - sprintf(globmsg, "Extra hint information required for blended fonts is not in\n character file: %s. Please re-hint using the latest software.\n Hints will not be included in this font.\n", fileName); - LogMsg(globmsg, WARNING, NONFATALERROR, TRUE); - SetNoHints(); - includeHints = FALSE; - } else - SetHintsElt(hinttype, &c0, elt1, elt2, (boolean)!startchar); -} - -private -integer StrLen(s) register char *s; -{ - register integer cnt = 0; - while (*s++ != 0) cnt++; - return cnt; -} - -/*Used instead of StringEqual to keep ac from cloberring source string*/ - -int isPrefix(const char *s, const char *pref) { - while (*pref) { - if (*pref != *s) - return 0; - pref++; - s++; - } - return 1; -} - -private -procedure DoName(nm, buff, len) const char *nm, *buff; -int len; -{ - switch (len) { - case 2: - switch (nm[0]) { - case 'c': /* ct, cp */ - switch (nm[1]) { - case 't': - psCT(); - break; - case 'p': - psCP(); - break; - default: - goto badFile; - } - break; - case 'm': /* mt */ - if (nm[1] != 't') goto badFile; - psMT(); - break; - case 'd': /* dt */ - if (nm[1] != 't') goto badFile; - psDT(); - break; - case 's': /* sc */ - if (nm[1] != 'c') goto badFile; - startchar = TRUE; - break; - case 'e': /* ed */ - if (nm[1] != 'd') goto badFile; - break; - case 'r': /* rm, rv, ry, rb */ - if (includeHints) - ReadHintInfo(nm[1], buff); - else - Pop2(); - break; - case 'i': /* id */ - if (nm[1] != 'd') goto badFile; - Pop(); - idInFile = TRUE; - break; - default: - goto badFile; - } - break; - case 3: - switch (nm[0]) { - case 'r': /* rdt, rmt, rct */ - if (nm[2] != 't') goto badFile; - switch (nm[1]) { - case 'd': - psRDT(); - break; - case 'm': - psRMT(); - break; - case 'c': - psRCT(); - break; - default: - goto badFile; - } - break; - case 'h': /* hdt, hmt */ - if (nm[2] != 't') goto badFile; - switch (nm[1]) { - case 'd': - psHDT(); - break; - case 'm': - psHMT(); - break; - default: - goto badFile; - } - break; - case 'v': /* vdt, vmt */ - if (nm[2] != 't') goto badFile; - switch (nm[1]) { - case 'd': - psVDT(); - break; - case 'm': - psVMT(); - break; - default: - goto badFile; - } - break; - case 's': /* sol, snc */ - case 'e': /* eol, enc */ - switch (nm[1]) { - case 'o': - if (nm[2] != 'l') goto badFile; - break; - case 'n': - if (nm[2] != 'c') goto badFile; - break; - default: - goto badFile; - } - break; - case 'f': /* flx */ - if (nm[1] == 'l' && nm[2] == 'x') - psFLX(); - else - goto badFile; - break; - case 'd': /* div */ - if (nm[1] == 'i' && nm[2] == 'v') - psDIV(); - else - goto badFile; - break; - default: - goto badFile; - } - break; - case 4: - if (nm[2] != 'c' || nm[3] != 't') goto badFile; - switch (nm[0]) { - case 'v': /* vhct */ - if (nm[1] != 'h') goto badFile; - psVHCT(); - break; - case 'h': /* hvct */ - if (nm[1] != 'v') goto badFile; - psHVCT(); - break; - default: - goto badFile; - } - break; - case 7: - switch (nm[6]) { - case '1': /* preflx1 */ - case '2': /* preflx2 */ - if (nm[0] != 'p' || nm[1] != 'r' || nm[2] != 'e' || - nm[3] != 'f' || nm[4] != 'l' || nm[5] != 'x') - goto badFile; - flex = TRUE; - break; - case 'r': /* endsubr */ - if (!isPrefix(nm, "endsubr")) goto badFile; - break; - default: - goto badFile; - } - break; - case 9: - switch (nm[0]) { - case 'b': /* beginsubr */ - if (!isPrefix(nm, "beginsubr")) goto badFile; - break; - case 'n': /* newcolors */ - if (!isPrefix(nm, "newcolors")) goto badFile; - break; - default: - goto badFile; - } - break; - default: - goto badFile; - } - return; -badFile : { - char op[80]; - if (len > 79) len = 79; - strncpy(op, nm, len); - op[len] = 0; - - FlushLogFiles(); - sprintf(globmsg, "Bad file format. Unknown operator: %s in %s character.\n", op, fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); -} -} - -private -procedure ParseString(s) const char *s; -{ - const char *s0; - char c; - char *c0; - boolean neg; - boolean isReal; - float rval; - integer val; - Fixed r; - pathStart = pathEnd = NULL; - bezGlyphName[0] = 0; - - while (TRUE) { - c = *s++; - nxtChar: - switch (c) { - case '-': /* negative number */ - neg = TRUE; - val = 0; - goto rdnum; - case '%': /* comment */ - if (bezGlyphName[0] == 0) { - unsigned int end = 0; - while (*s == ' ') - s++; - - while ((s[end] != ' ') && (s[end] != '\r') && (s[end] != '\n')) - end++; - - strncpy(bezGlyphName, s, end); - if (end < 64) - bezGlyphName[end] = 0; - else { - bezGlyphName[63] = 0; - sprintf(globmsg, - "Bad input file. Glyph name %s is greater than 32 chars.\n", - bezGlyphName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } - while ((*s != '\n') && (*s != '\r')) { - s++; - } - continue; - case ' ': - continue; - case '\t': - continue; - case '\n': - continue; - case '\r': - continue; - case 0: /* end of file */ - if (stkindex != 0) { - FlushLogFiles(); - sprintf(globmsg, - "Bad input file. Numbers left on stack at end of %s file.\n", - fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - return; - default: - if (c >= '0' && c <= '9') { - neg = FALSE; - val = c - '0'; - goto rdnum; - } - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { - s0 = s - 1; - while (TRUE) { - c = *s++; - if ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') || (c == '\0')) - break; - if (c == 0) - break; - } - DoName(s0, s, s - s0 - 1); - if (c == '\0') - s--; - continue; - } - FlushLogFiles(); - sprintf(globmsg, "Unexpected character in %s file.\n", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - rdnum: - isReal = false; - c0 = (char *)(s - 1); - while (TRUE) { - c = *s++; - if (c == '.') - isReal = true; - else if (c >= '0' && c <= '9') - val = val * 10 + (c - '0'); - else if ((c == ' ') || (c == '\t')) { - if (isReal) { - sscanf(c0, "%f", &rval); - rval = roundf(rval * 100) / 100; // Autohint can only support 2 digits of decimal precision. - /* do not need to use 'neg' to negate the value, as c0 string includes the minus sign.*/ - r = FixReal(rval); /* convert to Fixed */ - } else { - if (neg) - val = -val; - r = FixInt(val); /* convert to Fixed */ - } - /* Push(r); */ - if (stkindex >= STKMAX) { - FlushLogFiles(); - sprintf(globmsg, "Stack overflow while reading %s file.\n", - fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - return; - } - stk[stkindex] = r; - stkindex++; - goto nxtChar; - } else { - FlushLogFiles(); - sprintf(globmsg, - "Illegal number terminator while reading %s file.\n", - fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - return; - } - } /*end while true */ - } -} - -#define TESTING (FALSE) -#if TESTING -private -unsigned char ibuff[MAXBYTES + 2]; -private -integer inputlen; -#endif /*TESTING*/ - -public -procedure SetReadFileName(file_name) char *file_name; -{ - fileName = file_name; -} - -public -boolean ReadCharFile(normal, forBlendData, readHints, prependprefix) - boolean normal, - forBlendData, readHints, prependprefix; -{ - char infile[MAXPATHLEN]; - FILE *fd; - char *inputbuff; - integer cc; - unsigned long filelen; - currentx = currenty = tempx = tempy = stkindex = 0; - flex = idInFile = startchar = FALSE; - forMultiMaster = forBlendData; - includeHints = readHints; - if (prependprefix -#ifdef IS_LIB - && !featurefiledata -#endif - ) { - if (normal) - sprintf(infile, "%s%s", inPrefix, fileName); - else - sprintf(infile, "%s%s", outPrefix, fileName); - } else { - strcpy(infile, fileName); - } -#ifdef IS_LIB - if (bezstring) { - inputbuff = (char *)bezstring; - cc = (integer)strlen(inputbuff); - } else { -#endif - fd = ACOpenFile(infile, "rb", OPENWARN); - if (fd == NULL) return FALSE; - filelen = ACGetFileSize(infile); -#if DOMEMCHECK - inputbuff = (char *)memck_malloc(filelen + 5); -#else - inputbuff = (char *)ACNEWMEM(filelen + 5); -#endif - cc = ACReadFile((char *)inputbuff, fd, (char *)infile, filelen); - inputbuff[cc] = '\0'; -#ifdef IS_LIB - } -#endif - -#if PRINT_READ - fprintf(OUTPUTBUFF, "%s", inputbuff); -#endif - -#if TESTING - inputlen = cc; - for (i = 0; i <= cc; i++) ibuff[i] = inputbuff[i]; -#endif - ParseString(inputbuff); -#if !TESTING -#ifndef IS_LIB - { - char *s; - s = inputbuff; - for (i = 0; i < cc; i++) *s++ = 0; /* erase the plain text version */ - } -#endif -#endif -#ifndef IS_LIB - fclose(fd); -#if DOMEMCHECK - memck_free(inputbuff); -#else - ACFREEMEM(inputbuff); -#endif -#endif - -#if TESTING - if (normal) { - fd = ACOpenFile("file.old", "wb", OPENWARN); - if (fd == NULL) return FALSE; - fprintf(fd, "%s", ibuff); - fclose(fd); - } -#endif - return TRUE; -} - -public -procedure Test() { -#if TESTING - unsigned char buff[MAXBYTES + 2], *s; - char infile[MAXPATHLEN]; - FILE *fd; - integer cc, i; - - sprintf(infile, "%s%s", outPrefix, fileName); - fd = ACOpenFile(infile, "rb", OPENWARN); - if (fd == NULL) return; - cc = ReadDecFile( - fd, (char *)infile, (char *)buff, - TRUE, MAXBYTES, (unsigned long)MAXBYTES, OTHER); - fclose(fd); - if (cc >= MAXBYTES) { - cc--; - buff[cc] = 0; - goto mismatch; - } - buff[cc] = 0; - if (cc != inputlen) { - LogMsg("Test: file length different.\n", WARNING, OK, TRUE); - goto mismatch; - } - for (i = 0; i < cc; i++) - if (buff[i] != ibuff[i]) { - LogMsg("Test: file contents different.\n", WARNING, OK, TRUE); - goto mismatch; - } - /* return; */ -mismatch: - fd = ACOpenFile("file.new", "wb", OPENWARN); - if (fd == NULL) return; - fprintf(fd, "%s", buff); - fclose(fd); -#endif -} diff --git a/c/autohint/autohintlib/source/ac/report.c b/c/autohint/autohintlib/source/ac/report.c deleted file mode 100644 index 94a9eaa25..000000000 --- a/c/autohint/autohintlib/source/ac/report.c +++ /dev/null @@ -1,843 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* report.c */ - -#include "ac.h" -#include "machinedep.h" - -#define MAXFILENAME 32 - -#define YMINFILE "ymin.tmp" -#define YMAXFILE "ymax.tmp" -#define HORZFILE "horz.tmp" -#define VERTFILE "vert.tmp" - -#ifdef _WIN32 -#define L_cuserid 12 -#endif - -#if !IS_LIB -private -FILE *yminfile, *ymaxfile, *logfile, *vertfile, *horzfile; -#else -extern AC_REPORTFUNCPTR libReportCB; -#endif -private -char S0[512]; - -public -double FixToDbl(f) Fixed f; -{ - real r; - acfixtopflt(f, &r); - return r; -} - -#define VERSION "4.1" -public -procedure ACGetVersion(char *name, char *str) { - sprintf(str, "%s ac library version %s.\n", name, VERSION); -} - -public -procedure OpenLogFiles() { -#if !IS_LIB - char dir[MAXPATHLEN]; - char uid[L_cuserid]; - char host[50]; - logfile = ACOpenFile(TMPLOG, "w", OPENERROR); - GetInputDirName(dir, ""); -#ifdef SUN - cuserid(uid); - gethostname(host, 50); -#else - strcpy(host, "Local machine"); - strcpy(uid, "local"); -#endif - fprintf(logfile, "\n# %s -- %s\n# %s\n", uid, host, dir); - ACGetVersion("AC", globmsg); - fprintf(logfile, "# %s#\n\n", globmsg); - if (!logging) return; - yminfile = ACOpenFile(YMINFILE, "w", OPENERROR); - ymaxfile = ACOpenFile(YMAXFILE, "w", OPENERROR); - horzfile = ACOpenFile(HORZFILE, "w", OPENERROR); - vertfile = ACOpenFile(VERTFILE, "w", OPENERROR); -#endif -} - -public -procedure FlushLogFiles() { -#if !IS_LIB - fflush(logfile); - if (!logging) return; - fflush(yminfile); - fflush(ymaxfile); - fflush(horzfile); - fflush(vertfile); -#endif -} - -public -procedure CloseLogFiles() { -#if !IS_LIB - fclose(logfile); - if (!logging) return; - fclose(yminfile); - fclose(ymaxfile); - fclose(horzfile); - fclose(vertfile); -/* - (cd ..;sort -u ymin.tmp | sort -n > ymin.log; rm ymin.tmp) ! - (cd ..;sort -u ymax.tmp | sort -n > ymax.log; rm ymax.tmp) ! - (cd ..;sort -u horz.tmp | sort -n > horz.log; rm horz.tmp) ! - (cd ..;sort -u vert.tmp | sort -n > vert.log; rm vert.tmp) ! -*/ -#endif -} - -public -procedure LogYMinMax() { -#if !IS_LIB - PPathElt e = pathStart; - Fixed temp, y, ymax = FixInt(-10000), ymin = FixInt(10000); - if (!logging || e == NULL || e == pathEnd) return; - while (e != NULL) { - GetEndPoint(e, &temp, &y); - if (y < ymin) ymin = y; - if (y > ymax) ymax = y; - e = e->next; - } - /* The path element coordinates may have been transformed by -FixTwoMul - so check if ymin > ymax and switch values if true. - The untransformed coordinates will be written to the ymin and ymax - files. */ - if (ymin > ymax) { - temp = ymin; - ymin = ymax; - ymax = temp; - } - (void)fprintf(yminfile, "%g\t%s\n", FixToDbl(itfmy(ymin)), fileName); - (void)fprintf(ymaxfile, "%g\t%s\n", FixToDbl(itfmy(ymax)), fileName); -#endif -} - -#if IS_LIB -#define EndLine() -#else -private -procedure EndLine() { - if (!makehintslog) - return; - (void)fprintf(logfile, "\n"); -} -#endif - -#define PrinMsg(s) PrintMessage(s) - -public -procedure PrintMessage(s) char *s; -{ -#if !IS_LIB - if (!makehintslog) - return; - (void)fprintf(logfile, "%s: %s\n", fileName, s); -#else - char msgBuffer[512]; - if ((libReportCB != NULL) && (strlen(s) > 0)) { - sprintf(msgBuffer, "\t%s", s); - libReportCB(msgBuffer); - } -#endif -} - -public -procedure ReportError(s) char *s; -{ -#if !IS_LIB - if (reportErrors) PrintMessage(s); -#else - if (reportErrors && (libReportCB != NULL)) PrintMessage(s); -#endif -} - -public -procedure ReportSmoothError(x, y) Fixed x, y; -{ - (void)sprintf(S0, "Junction at %g %g may need smoothing.", - FixToDbl(itfmx(x)), FixToDbl(itfmy(y))); - ReportError(S0); -} - -public -procedure ReportAddFlex() { - if (hasFlex) return; - hasFlex = TRUE; - PrintMessage("FYI: added flex operators to this character."); -} - -public -procedure ReportClipSharpAngle(x, y) Fixed x, y; -{ - (void)sprintf(S0, "FYI: Too sharp angle at %g %g has been clipped.", - FixToDbl(itfmx(x)), FixToDbl(itfmy(y))); - PrintMessage(S0); -} - -public -procedure ReportSharpAngle(x, y) Fixed x, y; -{ - (void)sprintf(S0, "FYI: angle at %g %g is very sharp. Please check.", - FixToDbl(itfmx(x)), FixToDbl(itfmy(y))); - PrintMessage(S0); -} - -public -procedure ReportLinearCurve(e, x0, y0, x1, y1) - PPathElt e; -Fixed x0, y0, x1, y1; -{ - if (autoLinearCurveFix) { - e->type = LINETO; - e->x = e->x3; - e->y = e->y3; - (void)sprintf(S0, "Curve from %g %g to %g %g was changed to a line.", - FixToDbl(itfmx(x0)), FixToDbl(itfmy(y0)), - FixToDbl(itfmx(x1)), FixToDbl(itfmy(y1))); - } else - (void)sprintf(S0, "Curve from %g %g to %g %g should be changed to a line.", - FixToDbl(itfmx(x0)), FixToDbl(itfmy(y0)), - FixToDbl(itfmx(x1)), FixToDbl(itfmy(y1))); - PrintMessage(S0); -} - -private -procedure ReportNonHVError(x0, y0, x1, y1, s) - Fixed x0, - y0, x1, y1; -char *s; -{ - Fixed dx, dy; - x0 = itfmx(x0); - y0 = itfmy(y0); - x1 = itfmx(x1); - y1 = itfmy(y1); - dx = x0 - x1; - dy = y0 - y1; - if (abs(dx) > FixInt(10) || abs(dy) > FixInt(10) || - FTrunc(dx * dx) + FTrunc(dy * dy) > FixInt(100)) { - (void)sprintf(S0, "The line from %g %g to %g %g is not exactly %s.", - FixToDbl(x0), FixToDbl(y0), FixToDbl(x1), FixToDbl(y1), s); - ReportError(S0); - } -} - -public -procedure ReportNonHError(x0, y0, x1, y1) Fixed x0, y0, x1, y1; -{ - ReportNonHVError(x0, y0, x1, y1, "horizontal"); -} - -public -procedure ReportNonVError(x0, y0, x1, y1) Fixed x0, y0, x1, y1; -{ - ReportNonHVError(x0, y0, x1, y1, "vertical"); -} - -public -procedure ExpectedMoveTo(e) PPathElt e; -{ - char *s; - switch (e->type) { - case LINETO: - s = (char *)"lineto"; - break; - case CURVETO: - s = (char *)"curveto"; - break; - case CLOSEPATH: - s = (char *)"closepath"; - break; - default: - /* LogMsg("Malformed path list.\n", LOGERROR, NONFATALERROR, TRUE); */ - break; - } - FlushLogFiles(); - (void)sprintf(globmsg, "Path for %s character has a %s where a moveto was expected.\n The file is probably truncated.", fileName, s); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); -} - -public -procedure ReportMissingClosePath() { - FlushLogFiles(); - (void)sprintf(globmsg, "Missing closepath in %s character.\n The file is probably truncated.", fileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); -} - -public -procedure ReportTryFlexNearMiss(x0, y0, x2, y2) Fixed x0, y0, x2, y2; -{ - (void)sprintf(S0, "Curves from %g %g to %g %g near miss for adding flex.", - FixToDbl(itfmx(x0)), FixToDbl(itfmy(y0)), - FixToDbl(itfmx(x2)), FixToDbl(itfmy(y2))); - ReportError(S0); -} - -public -procedure ReportTryFlexError(CPflg, x, y) - boolean CPflg; -Fixed x, y; -{ - (void)sprintf(S0, - CPflg ? "Please move closepath from %g %g so can add flex." : "Please remove zero length element at %g %g so can add flex.", - FixToDbl(itfmx(x)), FixToDbl(itfmy(y))); - ReportError(S0); -} - -public -procedure ReportSplit(e) PPathElt e; -{ - Fixed x0, y0, x1, y1; - GetEndPoints(e, &x0, &y0, &x1, &y1); - (void)sprintf(S0, "FYI: the element that goes from %g %g to %g %g has been split.", - FixToDbl(itfmx(x0)), FixToDbl(itfmy(y0)), - FixToDbl(itfmx(x1)), FixToDbl(itfmy(y1))); - PrintMessage(S0); -} - -public -procedure AskForSplit(e) PPathElt e; -{ - Fixed x0, y0, x1, y1; - if (e->type == MOVETO) e = GetClosedBy(e); - GetEndPoints(e, &x0, &y0, &x1, &y1); - (void)sprintf(S0, "Please split the element that goes from %g %g to %g %g.", - FixToDbl(itfmx(x0)), FixToDbl(itfmy(y0)), - FixToDbl(itfmx(x1)), FixToDbl(itfmy(y1))); - ReportError(S0); -} - -public -procedure ReportPossibleLoop(e) PPathElt e; -{ - Fixed x0, y0, x1, y1; - if (e->type == MOVETO) e = GetClosedBy(e); - GetEndPoints(e, &x0, &y0, &x1, &y1); - (void)sprintf(S0, "Possible loop in element that goes from %g %g to %g %g. Please check.", - FixToDbl(itfmx(x0)), FixToDbl(itfmy(y0)), - FixToDbl(itfmx(x1)), FixToDbl(itfmy(y1))); - ReportError(S0); -} - -public -procedure ReportConflictCheck(e, conflict, cp) - PPathElt e, - conflict, cp; -{ - Fixed ex, ey, cx, cy, cpx, cpy; - GetEndPoint(e, &ex, &ey); - GetEndPoint(conflict, &cx, &cy); - GetEndPoint(cp, &cpx, &cpy); - (void)sprintf(S0, "Check e %g %g conflict %g %g cp %g %g.", - FixToDbl(itfmx(ex)), FixToDbl(itfmy(ey)), - FixToDbl(itfmx(cx)), FixToDbl(itfmy(cy)), - FixToDbl(itfmx(cpx)), FixToDbl(itfmy(cpy))); - ReportError(S0); -} - -public -procedure ReportConflictCnt(e, cnt) PPathElt e; -integer cnt; -{ - Fixed ex, ey; - GetEndPoint(e, &ex, &ey); - (void)sprintf(S0, "%g %g conflict count = %ld", - FixToDbl(itfmx(ex)), FixToDbl(itfmy(ey)), cnt); - ReportError(S0); -} - -public -procedure ReportRemFlare(e, e2, hFlg, i) - PPathElt e, - e2; -boolean hFlg; -integer i; -{ - Fixed ex1, ey1, ex2, ey2; - if (!showClrInfo) return; - GetEndPoint(e, &ex1, &ey1); - GetEndPoint(e2, &ex2, &ey2); - (void)sprintf(S0, "Removed %s flare at %g %g by %g %g : %ld.", - hFlg ? "horizontal" : "vertical", - FixToDbl(itfmx(ex1)), FixToDbl(itfmy(ey1)), - FixToDbl(itfmx(ex2)), FixToDbl(itfmy(ey2)), - i); - PrintMessage(S0); -} - -public -procedure ReportRemConflict(e) PPathElt e; -{ - Fixed ex, ey; - if (!showClrInfo) return; - GetEndPoint(e, &ex, &ey); - (void)sprintf(S0, "Removed conflicting hints at %g %g.", - FixToDbl(itfmx(ex)), FixToDbl(itfmy(ey))); - ReportError(S0); -} - -public -procedure ReportRotateSubpath(e) PPathElt e; -{ - Fixed ex, ey; - if (!showClrInfo) return; - GetEndPoint(e, &ex, &ey); - sprintf(S0, "FYI: changed closepath to %g %g.", - FixToDbl(itfmx(ex)), FixToDbl(itfmy(ey))); - PrintMessage(S0); -} - -public -procedure ReportRemShortColors(ex, ey) Fixed ex, ey; -{ - if (!showClrInfo) return; - sprintf(S0, "Removed hints from short element at %g %g.", - FixToDbl(itfmx(ex)), FixToDbl(itfmy(ey))); - PrintMessage(S0); -} - -private -procedure PrntVal(v) Fixed v; -{ - if (v >= FixInt(100000L)) - sprintf(S0, "%ld", FTrunc(v)); - else - sprintf(S0, "%g", FixToDbl(v)); - PrinMsg(S0); -} - -private -procedure ShwHV(val) PClrVal val; -{ - Fixed bot, top; - bot = itfmy(val->vLoc1); - top = itfmy(val->vLoc2); - sprintf(S0, "b %g t %g v ", FixToDbl(bot), FixToDbl(top)); - PrinMsg(S0); - PrntVal(val->vVal); - sprintf(S0, " s %g", FixToDbl(val->vSpc)); - PrinMsg(S0); - if (val->vGhst) - PrinMsg(" G"); -} - -public -procedure ShowHVal(val) PClrVal val; -{ - Fixed l, r; - PClrSeg seg; - ShwHV(val); - seg = val->vSeg1; - if (seg == NULL) return; - l = itfmx(seg->sMin); - r = itfmx(seg->sMax); - sprintf(S0, " l1 %g r1 %g ", FixToDbl(l), FixToDbl(r)); - PrinMsg(S0); - seg = val->vSeg2; - l = itfmx(seg->sMin); - r = itfmx(seg->sMax); - sprintf(S0, " l2 %g r2 %g", FixToDbl(l), FixToDbl(r)); - PrinMsg(S0); -} - -public -procedure ShowHVals(lst) PClrVal lst; -{ - while (lst != NULL) { - ShowHVal(lst); - EndLine(); - lst = lst->vNxt; - } -} - -public -procedure ReportAddHVal(val) PClrVal val; -{ - ShowHVal(val); - EndLine(); -} - -private -procedure ShwVV(val) PClrVal val; -{ - Fixed lft, rht; - lft = itfmx(val->vLoc1); - rht = itfmx(val->vLoc2); - sprintf(S0, "l %g r %g v ", FixToDbl(lft), FixToDbl(rht)); - PrinMsg(S0); - PrntVal(val->vVal); - sprintf(S0, " s %g", FixToDbl(val->vSpc)); - PrinMsg(S0); -} - -public -procedure ShowVVal(val) PClrVal val; -{ - Fixed b, t; - PClrSeg seg; - ShwVV(val); - seg = val->vSeg1; - if (seg == NULL) return; - b = itfmy(seg->sMin); - t = itfmy(seg->sMax); - sprintf(S0, " b1 %g t1 %g ", FixToDbl(b), FixToDbl(t)); - PrinMsg(S0); - seg = val->vSeg2; - b = itfmy(seg->sMin); - t = itfmy(seg->sMax); - sprintf(S0, " b2 %g t2 %g", FixToDbl(b), FixToDbl(t)); - PrinMsg(S0); -} - -public -procedure ShowVVals(lst) PClrVal lst; -{ - while (lst != NULL) { - ShowVVal(lst); - EndLine(); - lst = lst->vNxt; - } -} - -public -procedure ReportAddVVal(val) PClrVal val; -{ - ShowVVal(val); - EndLine(); -} - -public -procedure ReportFndBstVal(seg, val, hFlg) - PClrSeg seg; -PClrVal val; -boolean hFlg; -{ - if (hFlg) { - sprintf(S0, "FndBstVal: sLoc %g sLft %g sRght %g ", - FixToDbl(itfmy(seg->sLoc)), - FixToDbl(itfmx(seg->sMin)), - FixToDbl(itfmx(seg->sMax))); - PrinMsg(S0); - if (val) - ShwHV(val); - else - PrinMsg("NULL"); - } else { - sprintf(S0, "FndBstVal: sLoc %g sBot %g sTop %g ", - FixToDbl(itfmx(seg->sLoc)), - FixToDbl(itfmy(seg->sMin)), - FixToDbl(itfmy(seg->sMax))); - PrinMsg(S0); - if (val) - ShwVV(val); - else - PrinMsg("NULL"); - } - EndLine(); -} - -public -procedure ReportCarry(l0, l1, loc, clrs, vert) - Fixed l0, - l1, loc; -PClrVal clrs; -boolean vert; -{ - if (!showClrInfo) return; - if (vert) { - ShowVVal(clrs); - loc = itfmx(loc); - l0 = itfmx(l0); - l1 = itfmx(l1); - } else { - ShowHVal(clrs); - loc = itfmy(loc); - l0 = itfmy(l0); - l1 = itfmy(l1); - } - sprintf(S0, " carry to %g in [%g..%g]", - FixToDbl(loc), FixToDbl(l0), FixToDbl(l1)); - PrintMessage(S0); -} - -public -procedure ReportBestCP(e, cp) PPathElt e, cp; -{ - Fixed ex, ey, px, py; - GetEndPoint(e, &ex, &ey); - if (cp != NULL) { - GetEndPoint(cp, &px, &py); - sprintf(S0, "%g %g best cp at %g %g", - FixToDbl(itfmx(ex)), FixToDbl(itfmy(ey)), - FixToDbl(itfmx(px)), FixToDbl(itfmy(py))); - } else - sprintf(S0, "%g %g no best cp", - FixToDbl(itfmx(ex)), FixToDbl(itfmy(ey))); - PrintMessage(S0); -} - -public -procedure LogColorInfo(pl) PClrPoint pl; -{ - char c = pl->c; - Fixed lft, rht, top, bot, wdth; - if (c == 'y' || c == 'm') { /* vertical lines */ - lft = pl->x0; - rht = pl->x1; - (void)printf("%4g %-30s%5g%5g\n", FixToDbl(rht - lft), fileName, - FixToDbl(lft), FixToDbl(rht)); - } else { - bot = pl->y0; - top = pl->y1; - wdth = top - bot; - if (wdth == FixInt(-21) || wdth == FixInt(-20)) return; /* ghost pair */ - (void)printf("%4g %-30s%5g%5g\n", FixToDbl(wdth), fileName, - FixToDbl(bot), FixToDbl(top)); - } -} - -private -procedure LstHVal(val) PClrVal val; -{ - PrinMsg("\t"); - ShowHVal(val); - PrinMsg(" "); -} - -private -procedure LstVVal(val) PClrVal val; -{ - PrinMsg("\t"); - ShowVVal(val); - PrinMsg(" "); -} - -public -procedure ListClrInfo() { /* debugging routine */ - PPathElt e; - PSegLnkLst hLst, vLst; - PClrSeg seg; - Fixed x, y; - e = pathStart; - while (e != NULL) { - hLst = e->Hs; - vLst = e->Vs; - if ((hLst != NULL) || (vLst != NULL)) { - GetEndPoint(e, &x, &y); - x = itfmx(x); - y = itfmy(y); - sprintf(S0, "x %g y %g ", FixToDbl(x), FixToDbl(y)); - PrinMsg(S0); - while (hLst != NULL) { - seg = hLst->lnk->seg; - LstHVal(seg->sLnk); - hLst = hLst->next; - } - while (vLst != NULL) { - seg = vLst->lnk->seg; - LstVVal(seg->sLnk); - vLst = vLst->next; - } - EndLine(); - } - e = e->next; - } -} - -public -procedure ReportAddVSeg(from, to, loc, i) - Fixed from, - to, loc; -integer i; -{ - if (!showClrInfo || !showVs) return; - (void)sprintf(S0, "add vseg %g %g to %g %g %ld", - FixToDbl(itfmx(loc)), FixToDbl(itfmy(from)), - FixToDbl(itfmx(loc)), FixToDbl(itfmy(to)), i); - PrintMessage(S0); -} - -public -procedure ReportAddHSeg(from, to, loc, i) - Fixed from, - to, loc; -integer i; -{ - if (!showClrInfo || !showHs) return; - (void)sprintf(S0, "add hseg %g %g to %g %g %ld", - FixToDbl(itfmx(from)), FixToDbl(itfmy(loc)), - FixToDbl(itfmx(to)), FixToDbl(itfmy(loc)), i); - PrintMessage(S0); -} - -public -procedure ReportRemVSeg(from, to, loc) - Fixed from, - to, loc; -{ - if (!showClrInfo || !showVs) return; - (void)sprintf(S0, "rem vseg %g %g to %g %g", - FixToDbl(itfmx(loc)), FixToDbl(itfmy(from)), - FixToDbl(itfmx(loc)), FixToDbl(itfmy(to))); - PrintMessage(S0); -} - -public -procedure ReportRemHSeg(from, to, loc) - Fixed from, - to, loc; -{ - if (!showClrInfo || !showHs) return; - (void)sprintf(S0, "rem hseg %g %g to %g %g", - FixToDbl(itfmx(from)), FixToDbl(itfmy(loc)), - FixToDbl(itfmx(to)), FixToDbl(itfmy(loc))); - PrintMessage(S0); -} - -public -procedure ReportBandError(str, loc, blu) char *str; -Fixed loc, blu; -{ - (void)sprintf(S0, "Near miss %s horizontal zone at %g instead of %g.", - str, FixToDbl(loc), FixToDbl(blu)); - ReportError(S0); -} -public -procedure ReportBandNearMiss(str, loc, blu) char *str; -Fixed loc, blu; -{ - (void)sprintf(S0, "Near miss %s horizontal zone at %g instead of %g.", - str, FixToDbl(loc), FixToDbl(blu)); - ReportError(S0); -} - -public -procedure ReportStemNearMiss(vert, w, minW, b, t, curve) - boolean vert, - curve; -Fixed w, minW, b, t; -{ - (void)sprintf(S0, "%s %s stem near miss: %g instead of %g at %g to %g.", - vert ? "Vertical" : "Horizontal", curve ? "curve" : "linear", - FixToDbl(w), FixToDbl(minW), FixToDbl(MIN(b, t)), FixToDbl(MAX(b, t))); - ReportError(S0); -} - -public -procedure ReportColorConflict(x0, y0, x1, y1, ch) - Fixed x0, - y0, x1, y1; -char ch; -{ - unsigned char s[2]; - s[0] = ch; - s[1] = 0; - (void)sprintf(S0, " Conflicts with current hints: %g %g %g %g %s.", - FixToDbl(x0), FixToDbl(y0), FixToDbl(x1), FixToDbl(y1), s); - ReportError(S0); -} - -public -procedure ReportDuplicates(x, y) Fixed x, y; -{ - (void)sprintf(S0, "Check for duplicate subpath at %g %g.", - FixToDbl(x), FixToDbl(y)); - ReportError(S0); -} - -public -procedure ReportBBoxBogus(llx, lly, urx, ury) - Fixed llx, - lly, urx, ury; -{ - (void)sprintf(S0, "Character bounding box looks bogus: %g %g %g %g.", - FixToDbl(llx), FixToDbl(lly), FixToDbl(urx), FixToDbl(ury)); - ReportError(S0); -} - -public -procedure ReportMergeHVal(b0, t0, b1, t1, v0, s0, v1, s1) - Fixed b0, - t0, b1, t1, v0, s0, v1, s1; -{ - if (!showClrInfo) return; - sprintf(S0, "Replace H hints pair at %g %g by %g %g\n\told value ", - FixToDbl(itfmy(b0)), FixToDbl(itfmy(t0)), - FixToDbl(itfmy(b1)), FixToDbl(itfmy(t1))); - PrinMsg(S0); - PrntVal(v0); - sprintf(S0, " %g new value ", FixToDbl(s0)); - PrinMsg(S0); - PrntVal(v1); - sprintf(S0, " %g", FixToDbl(s1)); - PrintMessage(S0); -} - -public -procedure ReportMergeVVal(l0, r0, l1, r1, v0, s0, v1, s1) - Fixed l0, - r0, l1, r1, v0, s0, v1, s1; -{ - if (!showClrInfo) return; - sprintf(S0, "Replace V hints pair at %g %g by %g %g\n\told value ", - FixToDbl(itfmx(l0)), FixToDbl(itfmx(r0)), - FixToDbl(itfmx(l1)), FixToDbl(itfmx(r1))); - PrinMsg(S0); - PrntVal(v0); - sprintf(S0, " %g new value ", FixToDbl(s0)); - PrinMsg(S0); - PrntVal(v1); - sprintf(S0, " %g", FixToDbl(s1)); - PrintMessage(S0); -} - -public -procedure ReportPruneHVal(val, v, i) - PClrVal val, - v; -integer i; -{ - if (!showClrInfo) return; - sprintf(S0, "PruneHVal: %ld\n\t", i); - PrinMsg(S0); - ShowHVal(val); - PrinMsg("\n\t"); - ShowHVal(v); - EndLine(); -} - -public -procedure ReportPruneVVal(val, v, i) - PClrVal val, - v; -integer i; -{ - if (!showClrInfo) return; - sprintf(S0, "PruneVVal: %ld\n\t", i); - PrinMsg(S0); - ShowVVal(val); - PrinMsg("\n\t"); - ShowVVal(v); - EndLine(); -} - -public -procedure ReportMoveSubpath(e, s) PPathElt e; -char *s; -{ - Fixed x, y; - GetEndPoint(e, &x, &y); - sprintf(S0, "FYI: Moving subpath %g %g to %s.", - FixToDbl(itfmx(x)), FixToDbl(itfmy(y)), s); - PrintMessage(S0); -} diff --git a/c/autohint/autohintlib/source/ac/shuffle.c b/c/autohint/autohintlib/source/ac/shuffle.c deleted file mode 100644 index 5e34410ab..000000000 --- a/c/autohint/autohintlib/source/ac/shuffle.c +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* shuffle.c */ - -#include "ac.h" -#define MAXCNT (100) - -private -unsigned char *links; -private -integer rowcnt; - -public -procedure InitShuffleSubpaths() { - register integer cnt = -1; - register PPathElt e = pathStart; - while (e != NULL) { /* every element is marked with its subpath count */ - if (e->type == MOVETO) cnt++; - if (DEBUG) { - if (e->type == MOVETO) { /* DEBUG */ - sprintf(globmsg, "subpath %ld starts at %g %g\n", cnt, - FixToDbl(itfmx(e->x)), FixToDbl(itfmy(e->y))); - PrintMessage(globmsg); - } - } - e->count = (short)cnt; - e = e->next; - } - cnt++; - rowcnt = cnt; - links = (cnt < 4 || cnt >= MAXCNT) ? NULL : (unsigned char *)Alloc(cnt * cnt); -} - -private -procedure PrintLinks() { - integer i, j; - PrintMessage("Links "); - for (i = 0; i < rowcnt; i++) { - sprintf(globmsg, "%ld ", i); - PrintMessage(globmsg); - if (i < 10) PrintMessage(" "); - } - PrintMessage("\n"); - for (i = 0; i < rowcnt; i++) { - sprintf(globmsg, " %ld ", i); - PrintMessage(globmsg); - if (i < 10) PrintMessage(" "); - for (j = 0; j < rowcnt; j++) { - sprintf(globmsg, "%d ", links[rowcnt * i + j]); - PrintMessage(globmsg); - } - PrintMessage("\n"); - } -} - -private -procedure PrintSumLinks(sumlinks) char *sumlinks; -{ - integer i; - PrintMessage("Sumlinks "); - for (i = 0; i < rowcnt; i++) { - sprintf(globmsg, "%ld ", i); - PrintMessage(globmsg); - if (i < 10) PrintMessage(" "); - } - PrintMessage("\n"); - PrintMessage(" "); - for (i = 0; i < rowcnt; i++) { - sprintf(globmsg, "%d ", sumlinks[i]); - PrintMessage(globmsg); - } - PrintMessage("\n"); -} - -private -procedure PrintOutLinks(unsigned char *outlinks) { - integer i; - PrintMessage("Outlinks "); - for (i = 0; i < rowcnt; i++) { - sprintf(globmsg, "%ld ", i); - PrintMessage(globmsg); - if (i < 10) PrintMessage(" "); - } - PrintMessage("\n"); - PrintMessage(" "); - for (i = 0; i < rowcnt; i++) { - sprintf(globmsg, "%d ", outlinks[i]); - PrintMessage(globmsg); - } - PrintMessage("\n"); -} - -public -procedure MarkLinks(vL, hFlg) PClrVal vL; -boolean hFlg; -{ - register integer i, j; - register PClrSeg seg; - register PPathElt e; - if (links == NULL) return; - for (; vL != NULL; vL = vL->vNxt) { - if (vL == NULL) continue; - seg = vL->vSeg1; - if (seg == NULL) continue; - e = seg->sElt; - if (e == NULL) continue; - i = e->count; - seg = vL->vSeg2; - if (seg == NULL) continue; - e = seg->sElt; - if (e == NULL) continue; - j = e->count; - if (i == j) continue; - if (DEBUG) { - if (hFlg) - ShowHVal(vL); - else - ShowVVal(vL); - sprintf(globmsg, " : %ld <-> %ld\n", i, j); - PrintMessage(globmsg); - } - links[rowcnt * i + j] = 1; - links[rowcnt * j + i] = 1; - } -} - -private -procedure Outpath(links, outlinks, output, bst) unsigned char *links, *outlinks, *output; -integer bst; -{ - register unsigned char *lnks, *outlnks; - register integer i = bst; - register PPathElt e = pathStart; - while (e != NULL) { - if (e->count == i) break; - e = e->next; - } - MoveSubpathToEnd(e); - if (DEBUG) { - sprintf(globmsg, "move subpath %ld to end\n", bst); /* DEBUG */ - PrintMessage(globmsg); - } - output[bst] = 1; - lnks = &links[bst * rowcnt]; - outlnks = outlinks; - for (i = 0; i < rowcnt; i++) - *outlnks++ += *lnks++; - if (DEBUG) - PrintOutLinks(outlinks); -} - -/* The intent of this code is to order the subpaths so that - the hints will not need to change constantly because it - is jumping from one subpath to another. Kanji characters - had the most problems with this which caused huge files - to be created. */ -public -procedure DoShuffleSubpaths() { - unsigned char sumlinks[MAXCNT], output[MAXCNT], outlinks[MAXCNT]; - register unsigned char *lnks; - register integer i, j, bst, bstsum, bstlnks; - if (links == NULL) return; - if (DEBUG) - PrintLinks(); - for (i = 0; i < rowcnt; i++) - output[i] = sumlinks[i] = outlinks[i] = 0; - lnks = links; - for (i = 0; i < rowcnt; i++) { - for (j = 0; j < rowcnt; j++) { - if (*lnks++ != 0) sumlinks[i]++; - } - } - if (DEBUG) - PrintSumLinks((char *)sumlinks); - while (TRUE) { - bst = -1; - bstsum = 0; - for (i = 0; i < rowcnt; i++) { - if (output[i] == 0 && (bst == -1 || sumlinks[i] > bstsum)) { - bstsum = sumlinks[i]; - bst = i; - } - } - if (bst == -1) break; - Outpath(links, outlinks, output, bst); - while (TRUE) { - bst = -1; - bstsum = 0; - bstlnks = 0; - for (i = 0; i < rowcnt; i++) { - if (output[i] == 0 && outlinks[i] >= bstlnks) { - if (outlinks[i] > 0 && - (bst == -1 || outlinks[i] > bstlnks || - (outlinks[i] == bstlnks && sumlinks[i] > bstsum))) { - bstlnks = outlinks[i]; - bst = i; - bstsum = sumlinks[i]; - } - } - } - if (bst == -1) break; - Outpath(links, outlinks, output, bst); - } - } -} diff --git a/c/autohint/autohintlib/source/ac/stub.c b/c/autohint/autohintlib/source/ac/stub.c deleted file mode 100644 index 2d69681e2..000000000 --- a/c/autohint/autohintlib/source/ac/stub.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* stub.c - to resolve otherwise unresolved external references. */ -#include "ac.h" - -/* Procedures defined in stems/stemreport.c - StemHist */ -public -procedure AddVStem(top, bottom, curved) - Fixed top; -Fixed bottom; -boolean curved; -{ - if (curved && !allstems) - return; - - if (addVStemCB != NULL) { - addVStemCB(top, bottom, bezGlyphName); - } -} - -public -procedure AddHStem(right, left, curved) - Fixed right; -Fixed left; -boolean curved; -{ - if (curved && !allstems) - return; - - if (addHStemCB != NULL) { - addHStemCB(right, left, bezGlyphName); - } -} - -public -procedure AddCharExtremes(bot, top) - Fixed bot, - top; -{ - if (addCharExtremesCB != NULL) { - addCharExtremesCB(top, bot, bezGlyphName); - } -} - -public -procedure AddStemExtremes(bot, top) - Fixed bot, - top; -{ - if (addStemExtremesCB != NULL) { - addStemExtremesCB(top, bot, bezGlyphName); - } -} diff --git a/c/autohint/autohintlib/source/ac/timecheck.c b/c/autohint/autohintlib/source/ac/timecheck.c deleted file mode 100644 index 99db2493d..000000000 --- a/c/autohint/autohintlib/source/ac/timecheck.c +++ /dev/null @@ -1,1326 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* timecheck.c */ - -/* File modification time recording and cross-checking module. This - * module maintains the files .ACtimes and .Converttimes. The format - * of these files has been completely changed from binary to ASCII - * because of porting problems of an alignment and byte ordering - * nature. However, the old format files, version 10 and 11, are - * still read and silently updated to the new ASCII format. - * - * Jerry Hall - 22 Apr 1991 - * Judy Lee 17 Sep 1991 - call standard FileExists in machinedep.c - */ - -#include "ac.h" -#include "bftoac.h" -#include "fipublic.h" -#include "machinedep.h" -#include "buildfont.h" - -#ifdef __MWERKS__ -/*#include "types.h"*/ -/*#include */ -/*#include */ -#else -#include -#if WIN32 -#include -#include -#else -#include -#include -#endif -#endif - -#if !IS_LIB -#include -#endif - -/*#include */ -#include -/*#include */ - -#define VERSION10 1010 /* Mon Jan 9 10:25:53 1989 */ -/* version 11 includes the ability to specify {h,v}counter hinting - characters. It also includes a conversion time if starting - from pschars or ill. */ -#define VERSION11 1011 /* Wed Mar 29 1989 */ -#define VERSION_1_0 "1.0" /* JAH, 04/22/91 */ -#define AC_NAME ".ACtimes" -#define CVT_NAME ".Converttimes" - -/* The counter list is COUNTERLISTSIZE = 20 entries long. It turns out - * that this means that it actually accomodates 19 entries plus a - * terminating NULL. - */ -#define COUNTER_EXTRA_ENTRIES (COUNTERLISTSIZE - COUNTERDEFAULTENTRIES - 1) - -/* The longest line that can appear in a timestamp file is for the - * H or V counter chars and is calculated as: - * 14 + (MAXCHARNAME * COUNTER_EXTRA_ENTRIES - 1) + 1 + 1 = 570. - * The following constant can comfortably accomodate this. - */ -#define MAX_TEXT_LINE 768 - -/* Modification time struct from each file */ -typedef struct { - time_t modTime; - short nameIndx; -} fileTime; - -int newFileCnt = 0; /* Number of files and their ... */ -fileTime* newFileTimes; /* ... timestamps read from charset or directory */ - -int oldFileCnt = 0; /* Number of files and their ... */ -fileTime* oldFileTimes; /* ... timestamps read from the timestamp file */ - -/* Lists of character names/filenames are accumulated in the buffer below - * which is allocated dynamically and grown if it becomes too small. The - * buffer is managed by the routine storeName. A slot of MAXCHARNAME - * characters is reserved at index 0 and is used by the binary name search - * routine to store the search name. The initial buffer size is easily big - * enough to hold 2 name lists for an ISO Adobe character set. These require - * 1095 characters each, including terminating NULLs. - */ -char* nameBuf = 0; /* Character name/filename buffer */ -int bufSize = 0; /* Name buffer size */ -char* nextFree = (char*)MAXCHARNAME; /* Pointer to next free char in buffer */ -#define BUF_INCR 4096 /* Buffer allocation increment */ -#define INDX_PTR(i) ((i) + nameBuf) /* Converts name index to a char pointer */ - -/*char* bsearch();*/ -time_t time(); - -private -char* allocate(); -private -unsigned short calcChksum(); -private -void newTimesFile(const char*, boolean); -private -void readInputDir(const char*, boolean); -private -short storeName(); -private -void formatTime(); -private -void writeTimesFile(boolean convert, float scale); -private -void printArray(); -private -void printCounterList(); -private -void sortFileTimes(); -private -fileTime* findName(); -private -void copyTimes(); -private -void updateTime(); -private -fileTime* checkFile(); -private -void readCharList(); -private -boolean readTimesFile(boolean convert, float scale); -private -boolean readCharSet(); -private -boolean readOldTimesFile(FILE* fp, boolean convert, float scale); -private -int get16(); -private -int get32(); -private -boolean compareData(); -private -boolean readFileTimesData(); -private -boolean compareCounterListData(); -private -boolean compareArrays(); -private -boolean readFileTimes(); -private -boolean compareCounterLists(); -private -boolean compareLists(); -private -boolean compareTimes(boolean, boolean, boolean*, boolean); -private -boolean compareCvtTimes(char* inputDir, boolean release, tConvertfunc convertFunc); - -/* Free up space used for storing file times and filenames. - */ -private -void freeFileTimes(void) { -#if DOMEMCHECK - memck_free(oldFileTimes); - memck_free(newFileTimes); - memck_free(nameBuf); -#else - ACFREEMEM(oldFileTimes); - ACFREEMEM(newFileTimes); - ACFREEMEM(nameBuf); -#endif - oldFileTimes = newFileTimes = NULL; - oldFileCnt = newFileCnt = bufSize = 0; - nextFree = (char*)MAXCHARNAME; - nameBuf = NULL; -} - -/* Creates a new .ACtimes file. A .Converttimes file is also - * created using the current timestamps if a pschars or ill - * directory exists. Called by the -t option to BuildFont. - */ -public -boolean CreateTimesFile(void) { -#if !IS_LIB - if (DirExists(ILLDIR, FALSE, FALSE, FALSE)) - newTimesFile(ILLDIR, TRUE); - else if (DirExists(RAWPSDIR, FALSE, FALSE, FALSE)) - newTimesFile(RAWPSDIR, TRUE); - - newTimesFile(BEZDIR, FALSE); - - freeFileTimes(); -#endif - return TRUE; /* This maintains compatibility with the old version */ -} - -/* Warns about and renames any existing .ACtimes or .Converttimes files - * then creates a new .ACtimes or .Converttimes file using the character - * files' current timestamps. - */ -private -void newTimesFile(const char* dirName, - boolean convert) /* Flags converting from ill/ or pschars/ directory */ -{ -#if IS_LIB -#pragma unused(dirName) -#pragma unused(convert) -#else - float scale; - char* timesFileName = (convert) ? CVT_NAME : AC_NAME; - - readInputDir(dirName, TRUE); - - if (CFileExists(timesFileName, FALSE)) { - /* Rename the old timestamp file */ - char newName[50]; - - sprintf(globmsg, "Renaming existing %s file to %s.old.\n", - timesFileName, timesFileName); - LogMsg(globmsg, WARNING, OK, TRUE); - sprintf(newName, "%s.old", timesFileName); - RenameFile(timesFileName, newName); - } - - set_scale(&scale); - writeTimesFile(convert, scale); -#endif -} - -/* Reads in file names from input directory instead of - * character set. Ignores .BAK files. - */ -private -void readInputDir(const char* dirName, - boolean creating) /* Flags creation (not updating) of timestamp file */ -{ -#if IS_LIB -#pragma unused(dirName) -#pragma unused(creating) -#else - - extern int scandir(); - extern int bf_alphasort(); - int fileCnt; - struct direct** nameList; - - fileCnt = BFscandir(dirName, &nameList, IncludeFile, bf_alphasort); - if (fileCnt == -1) { - sprintf(globmsg, "Can't read the %s directory.\n", dirName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } else { - int i; - fileTime* p; - char charFile[MAXPATHLEN]; - struct stat s; - - /* explicitly look for .notdef bez file */ -#ifdef __MWERKS__ - sprintf(charFile, ":%s:.notdef", dirName); -#else - sprintf(charFile, "%s\\.notdef", dirName); -#endif - if (FileExists(charFile, FALSE) && - !stat(charFile, &s)) { - newFileTimes = (fileTime*)allocate(fileCnt + 1, sizeof(fileTime)); - } else { - newFileTimes = (fileTime*)allocate(fileCnt, sizeof(fileTime)); - } - - p = newFileTimes; - - for (i = 0; i < fileCnt; i++) { -#ifdef __MWERKS__ - sprintf(charFile, ":%s:%s", dirName, nameList[i]->d_name); -#else - sprintf(charFile, "%s\\%s", dirName, nameList[i]->d_name); -#endif - if (FileExists(charFile, FALSE) && - !stat(charFile, &s)) { - p->nameIndx = storeName(nameList[i]->d_name); - p->modTime = (creating) ? s.st_mtime : 0; - p++; - } - } - - /* explicitly handle for .notdef bez file */ -#ifdef __MWERKS__ - sprintf(charFile, ":%s:.notdef", dirName); -#else - sprintf(charFile, "%s\\.notdef", dirName); -#endif - - if (FileExists(charFile, FALSE) && - !stat(charFile, &s)) { - p->nameIndx = storeName(".notdef"); - p->modTime = (creating) ? s.st_mtime : 0; - p++; - } - - newFileCnt = p - newFileTimes; /* Actual number of valid files */ -#if DOMEMCHECK - memck_free(nameList); -#else - ACFREEMEM(nameList); -#endif - } -#endif -} - -/* Dynamic space allocator. - */ -private -char* allocate(int n, int size) { -#if IS_LIB -#if DOMEMCHECK - char* p = (char*)memck_calloc(n, size); -#else - char* p = (char*)ACNEWMEM(n * size); - if (NULL != p) - memset((void*)p, 0x0, n * size); -#endif -#else - char* p = (char*)calloc(n, size); -#endif - if (!p) { - sprintf(globmsg, "Can't allocate space for file times.\n"); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - - return p; -} - -/* Store a name in the name buffer. Return the index to the - * name, not a pointer. This is so the buffer can be moved (by - * realloc) without screwing up all the references that have - * already been made to it. - */ -private -short storeName(const char* name) { - short tmp = nextFree - nameBuf; - - if (strlen(name) + 1 + nextFree - nameBuf > bufSize) { - /* Not enough space so (re)allocate it */ - - bufSize += BUF_INCR; -#if DOMEMCHECK - if (nameBuf) - nameBuf = memck_realloc(nameBuf, bufSize); - else - nameBuf = memck_malloc(bufSize); -#else - if (nameBuf) - nameBuf = ACREALLOCMEM(nameBuf, bufSize); - else - nameBuf = ACNEWMEM(bufSize); -#endif - if (!nameBuf) { - sprintf(globmsg, "Can't allocate space for file names.\n"); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - - nextFree = tmp + nameBuf; /* Realloc can move the block */ - } - - /* Copy name */ - while (*nextFree++ = *name++) - ; - - return tmp; -} - -/* Write out the timestamp file. - */ -private -void writeTimesFile(boolean convert, /* Flags if writing .Converttimes */ - float scale) /* Coversion scale factor */ -{ -#if IS_LIB -#pragma unused(convert) -#pragma unused(scale) -#else - - int i; - char s[25]; - unsigned short chksum; - char* timesFileName = (convert) ? CVT_NAME : AC_NAME; - int lines = 4 + 1 + ((convert) ? 1 : 7) + 1 + newFileCnt; - FILE* fp = ACOpenFile(timesFileName, "w+", OPENWARN); /* Valid for Mac? */ - - if (fp == NULL) - return; - - fprintf(fp, "%%%% File %s\n", timesFileName); - fprintf(fp, "%%%% Version %s\n", VERSION_1_0); - formatTime(time((time_t*)0), s); - fprintf(fp, "%%%% Created %s\n", s); - fprintf(fp, "%%%% Length %d\n", lines); - fprintf(fp, "%%%% Header:\n"); - - if (convert) - /* .Converttimes header */ - fprintf(fp, "Scale %d.%d\n", (int)scale, - (int)((scale - (int)scale) * 1000.0)); - else { - /* .ACtimes header */ - fprintf(fp, "FlexOK %s\n", (flexOK) ? "true" : "false"); - printArray(fp, "HStems", NumHStems, HStems); - printArray(fp, "VStems", NumVStems, VStems); - printArray(fp, "BotBands", lenBotBands, botBands); - printArray(fp, "TopBands", lenTopBands, topBands); - printCounterList(fp, "HCounterChars", NumHColors, - &HColorList[COUNTERDEFAULTENTRIES]); - printCounterList(fp, "VCounterChars", NumVColors, - &VColorList[COUNTERDEFAULTENTRIES]); - } - - fprintf(fp, "%%%% File Timestamps:\n"); - for (i = 0; i < newFileCnt; i++) { - formatTime(newFileTimes[i].modTime, s); - fprintf(fp, "(%s) %s\n", s, INDX_PTR(newFileTimes[i].nameIndx)); - } - - chksum = calcChksum(fp, lines); - - /* Must do this when changing from read to write on a file opened - * for update, see fopen(3S). - */ - fseek(fp, 0L, L_XTND); - - fprintf(fp, "%%%% Checksum %04x\n", chksum); - - if (ferror(fp)) { - sprintf(globmsg, "Error writing the %s file.\n", timesFileName); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - fclose(fp); -#endif - return; -} - -/* Format string with date and time. - */ -private -void formatTime(time_t t, char* s) { - struct tm* tmp; - - tmp = localtime(&t); - sprintf(s, "%02d/%02d/%02d %02d:%02d:%02d", - tmp->tm_mon + 1, tmp->tm_mday, tmp->tm_year, - tmp->tm_hour, tmp->tm_min, tmp->tm_sec); -} - -/* Prints an array of numbers inside square brackets. - */ -private -void printArray( - FILE* fp, /* Timestamp file pointer */ - char* name, /* Array name */ - long len, /* Array length */ - Fixed* a /* Array */) { - int i; - - fprintf(fp, "%s [", name); - for (i = 0; i < len; i++) - if (i + 1 == len) - fprintf(fp, "%d", FTrunc(a[i])); /* Last in array, no space */ - else - fprintf(fp, "%d ", FTrunc(a[i])); - fprintf(fp, "]\n"); -} - -/* Prints a list of strings inside round brackets. - */ -private -void printCounterList( - FILE* fp, /* Timestamp file pointer */ - char* name, /* List name */ - long len, /* List length */ - char** list /* The list */) { - int i; - - fprintf(fp, "%s (", name); - for (i = 0; i < len; i++) - if (i + 1 == len) - fprintf(fp, "%s", list[i]); /* Last in list, no separating space */ - else - fprintf(fp, "%s ", list[i]); - fprintf(fp, ")\n"); -} - -/* Computes the timestamp file checksum by reading the specified - * number of lines from the beginning of the file and accumulating - * checksum as a 16-bit rotated shifted exor. - */ -private -unsigned short calcChksum(FILE* fp, int lines) { - char buf[MAX_TEXT_LINE]; - register unsigned short chksum = 0; - - rewind(fp); - while (lines-- && fgets(buf, MAX_TEXT_LINE, fp)) { - register char* p = buf; - - while (*p) - chksum = ((chksum << 1) + ((chksum & 0x8000) ? 1 : 0)) ^ *p++; - } - - return chksum; -} - -/* Hint the specified files and update their time entries in the - * timestamp file. Called by AC only when hinting a list of characters. - */ -public -boolean DoArgs( - int cnt, /* Number of characters to process */ - char* names[], /* Names of characters to process */ - boolean extraColor, - boolean* renameLog, - boolean release /* Flags release version */) { -#ifdef IS_GGL - return FALSE; -#else - int i; - boolean result = TRUE; - -#ifdef IS_LIB - if (!featurefiledata) { -#endif - - if (release) { - if (!readCharSet()) { - freeFileTimes(); - return FALSE; - } - } else - readInputDir(BEZDIR, FALSE); - - if (readTimesFile(FALSE, 0.0)) - copyTimes(); - -#ifdef IS_LIB - } -#endif - - for (i = 0; i < cnt; i++) { - if (!DoFile(names[i], extraColor)) { - result = FALSE; - continue; - } else - *renameLog = TRUE; -#if !IS_LIB - updateTime(findName(names[i], newFileCnt, newFileTimes), BEZDIR); -#endif - } - -#if !IS_LIB - writeTimesFile(FALSE, 0.0); - - freeFileTimes(); -#endif - - return result; -#endif -} - -/* Reads through the charset file and builds - * a list of character names/filenames. - */ -private -boolean readCharSet() { -#if !IS_LIB - FILE* fp; - char cName[MAXCHARNAME + 4]; - char csFileName[MAXPATHLEN]; - char fName[MAXFILENAME + 4]; - int i; - long masters, hintDir; - short nextName = nextFree - nameBuf; /* Remember first name position */ - - getcharsetname(csFileName); - fp = ACOpenFile(csFileName, "r", OPENWARN); - if (fp == NULL) - return FALSE; - - for (newFileCnt = 0; ReadNames(cName, fName, &masters, &hintDir, fp); newFileCnt++) - (void)storeName(fName); - fclose(fp); - - newFileTimes = (fileTime*)allocate(newFileCnt, sizeof(fileTime)); - - for (i = 0; i < newFileCnt; i++) { - newFileTimes[i].nameIndx = nextName; - nextName += strlen(INDX_PTR(nextName)) + 1; - } - - sortFileTimes(newFileCnt, newFileTimes); -#endif - return TRUE; -} - -/* Compare function for qsort and bsearch */ -private -int cmpNames(const void* va, const void* vb) - -{ - fileTime* a = (fileTime*)va; - fileTime* b = (fileTime*)vb; - return strcmp(INDX_PTR(a->nameIndx), INDX_PTR(b->nameIndx)); -} -/* Sorts a file times list by name into alphabetical order. - */ -private -void sortFileTimes( - int len, /* Length of table */ - fileTime* table /* Table to be sorted */) { - qsort((char*)table, len, sizeof(fileTime), cmpNames); -} - -/* Reads timestamp file. Checks checksum. Compares values read - * with values read from the fontinfo file (in memory). If any - * header values are different then the file times are discarded - * and all the characters will be rehinted. - */ -private -boolean readTimesFile( - boolean convert, /* Flags if reading .Converttimes */ - float scale /* Conversion scale */) { -#if IS_LIB -#pragma unused(scale) -#pragma unused(convert) - return TRUE; -#else - char tmp[MAXFILENAME]; - int lines; - unsigned short chksum; - int linesRead = 0; - char HCounterLine[MAX_TEXT_LINE]; - char VCounterLine[MAX_TEXT_LINE]; - char* timesFileName = (convert) ? CVT_NAME : AC_NAME; - FILE* fp = ACOpenFile(timesFileName, "r", OPENOK); - - if (fp == NULL) - return FALSE; - - /* Read and check the file preamble */ - if (fscanf(fp, "%%%% File %s\n", tmp) != 1) { - /* Try to read in old format */ - if (!readOldTimesFile(fp, convert, scale)) - goto error; - fclose(fp); - return TRUE; - } - - if (strcmp(tmp, timesFileName) || - fscanf(fp, "%%%% Version %s\n", tmp) != 1 || - strcmp(tmp, VERSION_1_0) || - fscanf(fp, "%%%% Created %*s %*s\n") != 0 || - fscanf(fp, "%%%% Length %d\n", &lines) != 1 || - fscanf(fp, "%%%% Header:\n") != 0) - goto error; - linesRead += 5; - - if (convert) { - /* Read and check .Converttimes header */ - int whole; - int frac; - - if (fscanf(fp, "Scale %d.%d\n", &whole, &frac) != 2 || - whole != (int)scale || - frac != (int)((scale - (int)scale) * 1000.0)) - goto error; - linesRead += 1; - } else { /* Read and check .ACtimes header */ - if (fscanf(fp, "FlexOK %s\n", tmp) != 1 || - strcmp(tmp, (flexOK) ? "true" : "false") || - !compareArrays(fp, "HStems", NumHStems, HStems) || - !compareArrays(fp, "VStems", NumVStems, VStems) || - !compareArrays(fp, "BotBands", lenBotBands, botBands) || - !compareArrays(fp, "TopBands", lenTopBands, topBands) || - !fgets(HCounterLine, MAX_TEXT_LINE, fp) || - !fgets(VCounterLine, MAX_TEXT_LINE, fp)) - goto error; - linesRead += 7; - } - - if (fscanf(fp, "%%%% File Timestamps:\n") != 0) - goto error; - linesRead += 1; - - /* Read all of the file times */ - if (!readFileTimes(fp, lines - linesRead)) - goto error; - - /* Now check the checksum */ - if (fscanf(fp, "%%%% Checksum %hx\n", &chksum) != 1 || - chksum != calcChksum(fp, lines)) - goto error; - - if (!convert && - (!compareCounterLists("HCounterChars", HCounterLine, NumHColors, - &HColorList[COUNTERDEFAULTENTRIES]) || - !compareCounterLists("VCounterChars", VCounterLine, NumVColors, - &VColorList[COUNTERDEFAULTENTRIES]))) - goto error; - - fclose(fp); - return TRUE; - -error: /* Just tidy up and return. Yes I've used a goto! I think this is */ - /* one of the few legitimate uses. */ - fclose(fp); -#if DOMEMCHECK - memck_free(oldFileTimes); -#else - UnallocateMem(oldFileTimes); -#endif - oldFileCnt = 0; - return FALSE; -#endif -} - -/* Try to read old format, version 10 or 11, timestamp file. This - * function is very careful about how the numbers in the old file - * are read so as not to introduce byte swapping errors since we - * may not be running on a 680X0 machine. It does assume that - * the file was generated on a 680X0 processor and that the - * objects are therefore 2-byte aligned. This is not an unreasonable - * assumption since BuildFont has not be available on any other - * platform previously and this ASCII timestamp version will be - * the first ported version. - */ -private -boolean readOldTimesFile( - FILE* fp, /* Timestamp file pointer */ - boolean convert, /* Flags if reading .Converttimes */ - float scale /* Conversion scale */) { -#if IS_LIB -#pragma unused(fp) -#pragma unused(convert) -#pragma unused(scale) -#else - - long version; - char buf[MAX_TEXT_LINE]; - long offset; - int counterListLen; - int HCounterCnt; - int VCounterCnt; - float s = (float)scale; - - rewind(fp); - - version = get32(fp); - if (version != VERSION10 && version != VERSION11) - return FALSE; /* Not a valid file */ - - offset = get16(fp); /* File times offset */ - - if (convert) - /* Read and check .Converttimes file */ - return version == VERSION11 && get32(fp) == acpflttofix(&s) && - readFileTimesData(fp, offset); - - /* Read and check .ACtimes file */ - if (get32(fp) != flexOK || - get16(fp) != NumHStems || get16(fp) != NumVStems || - get16(fp) != lenBotBands || get16(fp) != lenTopBands) - return FALSE; - if (version == VERSION11) { - VCounterCnt = get16(fp); /* V before H for some reason */ - HCounterCnt = get16(fp); - } - if (!compareData(fp, NumHStems, HStems) || - !compareData(fp, NumVStems, VStems) || - !compareData(fp, lenBotBands, botBands) || - !compareData(fp, lenTopBands, topBands)) - return FALSE; - - counterListLen = offset - ftell(fp); - if (version == VERSION11 && counterListLen) - if (fread(buf, counterListLen, 1, fp) != 1) - return FALSE; - - if (!readFileTimesData(fp, offset)) - return FALSE; - - if (version == VERSION11) { - char* cp = buf; - - return compareCounterListData(VCounterCnt, &cp, NumVColors, - &VColorList[COUNTERDEFAULTENTRIES]) && - compareCounterListData(HCounterCnt, &cp, NumHColors, - &HColorList[COUNTERDEFAULTENTRIES]); - } else -#endif - return TRUE; -} - -/* Get 16-bit number from stream, assumes hi-byte lo-address ordering. - */ -private -int get16(FILE* fp) { - int hi = getc(fp) & 0xff; - int lo = getc(fp) & 0xff; - - return (hi << 8) | lo; -} - -/* Get 32-bit number from stream, assumes hi-byte lo-address ordering. - */ -private -int get32(FILE* fp) { - int b3 = getc(fp) & 0xff; - int b2 = getc(fp) & 0xff; - int b1 = getc(fp) & 0xff; - int b0 = getc(fp) & 0xff; - - return (b3 << 24) | (b2 << 16) | (b1 << 8) | b0; -} - -/* Reads an array of numbers in old format from the timestamp file - * and compares them with an array derived from the fontinfo file (in memory). - */ -private -boolean compareData( - FILE* fp, /* Timestamp file pointer */ - long len, /* Array length */ - Fixed a[] /* Array */) { - int i; - - for (i = 0; i < len; i++) - if (get32(fp) != a[i]) - return FALSE; - - return TRUE; -} - -/* Read the old format file times data. - */ -private -boolean readFileTimesData( - FILE* fp, /* Timestamp file pointer */ - long offset /* File times offset */) { -#if IS_LIB -#pragma unused(fp) -#pragma unused(offset) -#else - int i; - int len; - short nextName = nextFree - nameBuf; /* Remember first name position */ - - fseek(fp, offset, L_SET); /* Seek to file times */ - for (oldFileCnt = 0; (len = get16(fp)) && !feof(fp); oldFileCnt++) { - int nameLen; - char name[MAXCHARNAME]; - char* p = name; - - (void)get32(fp); /* Discard modification time */ - - while (*p++ = getc(fp)) /* Read the name */ - ; - - nameLen = p - name; - if (nameLen & 1) { - (void)getc(fp); /* Read the odd byte */ - nameLen++; - } - - if (len != 2 + 4 + nameLen) - return FALSE; /* Format error */ - - (void)storeName(name); - } - - oldFileTimes = (fileTime*)allocate(oldFileCnt, sizeof(fileTime)); - - fseek(fp, offset, L_SET); /* Re-seek to file times */ - for (i = 0; i < oldFileCnt; i++) { - len = get16(fp); - - oldFileTimes[i].modTime = get32(fp); - oldFileTimes[i].nameIndx = nextName; - nextName += strlen(INDX_PTR(nextName)) + 1; - - fseek(fp, len - (2 + 4), L_INCR); /* Skip over name */ - } -#endif - return TRUE; -} - -/* Scans the old format counter list input data (which was read earlier) - * and marks the character names. These are then compared with a list - * derived from the fontinfo file (in memory). Names not in the - * intersection of these lists are marked for rehinting. - */ -private -boolean compareCounterListData( - int nameCnt, /* Number of names in the counter list */ - char** cp, /* Counter list */ - long len, /* List length */ - char* list[] /* The list */) { - char* names[COUNTER_EXTRA_ENTRIES]; - int i; - - for (i = 0; i < nameCnt; i++) { - names[i] = *cp; - *cp += strlen(*cp) + 1; - } - - return compareLists(nameCnt, names, len, list); -} - -/* Reads an array of numbers inside square brackets from the - * timestamp file and compares them with an array derived from - * the fontinfo file (in memory). - */ -private -boolean compareArrays( - FILE* fp, /* Timestamp file pointer */ - char* name, /* Array name */ - long len, /* Array length */ - Fixed a[] /* Array */) { - char fmt[MAX_TEXT_LINE]; - int i; - - sprintf(fmt, "%s [", name); /* Make format string with array name */ - if (fscanf(fp, fmt)) /* Read the beginning of the line */ - return FALSE; - - for (i = 0; i < len; i++) { - int val; - - if (fscanf(fp, "%d ", &val) != 1 || FixInt(val) != a[i]) - return FALSE; - } - - return !fscanf(fp, "]\n"); /* Read the rest of the line */ -} - -/* Reads the file times from the timestamp file. - */ -private -boolean readFileTimes( - FILE* fp, /* Timestamp file pointer */ - int timeCnt /* Number of times to read */) { - int i; - - oldFileTimes = (fileTime*)allocate(timeCnt, sizeof(fileTime)); - - for (i = 0; i < timeCnt; i++) { - char name[MAXFILENAME]; - struct tm tm; - - if (fscanf(fp, "(%d/%d/%d %d:%d:%d) %s\n", - &tm.tm_mon, &tm.tm_mday, &tm.tm_year, - &tm.tm_hour, &tm.tm_min, &tm.tm_sec, name) != 7) - return FALSE; - - tm.tm_mon--; /* Because it's stored 0-11!, see ctime(3) */ - oldFileTimes[i].nameIndx = storeName(name); - oldFileTimes[i].modTime = mktime(&tm); - } - - oldFileCnt = timeCnt; - - return TRUE; -} - -/* Scans the counter list input line (which was read earlier) and marks - * and counts the character names. These are then compared with a list - * derived from the fontinfo file (in memory). Names not in the - * intersection of these lists are marked for rehinting. - */ -private -boolean compareCounterLists( - char* listName, /* List name */ - char line[], /* Input line */ - long len, /* List length */ - char* list[] /* The list */) { - char label[64]; - char* names[COUNTER_EXTRA_ENTRIES]; - char* startp; - int nameCnt; - int labelLen; - - sprintf(label, "%s (", listName); /* Make label string with list name */ - labelLen = strlen(label); - if (strncmp(line, label, labelLen)) - return FALSE; - - /* Locate all the names */ - startp = line + labelLen; - for (nameCnt = 0; nameCnt < COUNTER_EXTRA_ENTRIES; - nameCnt++, startp = NULL) - if (!(names[nameCnt] = (char*)strtok(startp, " )\n"))) - break; - - return compareLists(nameCnt, names, len, list); -} - -/* Actually does the work of comparing the counter lists together. - */ -private -boolean compareLists( - int nameCnt, /* Items in names */ - char* names[], /* Name list */ - long len, /* List length */ - char* list[] /* The list */) { - int i; - - if (nameCnt == 0 && len == 0) - return TRUE; /* Nothing to do */ - - for (i = nameCnt; i < COUNTER_EXTRA_ENTRIES; i++) - names[i] = NULL; /* Clear unused entries */ - - for (i = 0; i < len; i++) { - int j; - - for (j = 0; j < nameCnt; j++) - if (!names[j]) - continue; - else if (!strcmp(names[j], list[i])) { - /* Character name in both lists so remove it */ - - names[j] = NULL; - break; - } - - if (j == nameCnt) { - /* Character name not found so force rehinting */ - fileTime* p = findName(list[i], oldFileCnt, oldFileTimes); - - if (p) - p->modTime = 0; - else { - sprintf(globmsg, "Cannot find counter hints character \"%s\" in current %s file.\n", - list[i], AC_NAME); - LogMsg(globmsg, WARNING, OK, TRUE); - } - } - } - - /* Force remaining characters to be rehinted */ - for (i = 0; i < nameCnt; i++) - if (names[i]) { - fileTime* p = findName(names[i], oldFileCnt, oldFileTimes); - - if (p) - p->modTime = 0; - /* OK if character not found in this situation */ - } - - return TRUE; -} - -/* Copies old times list (read from timestamp file) to new - * times list if the name can be found in the new list. - */ -private -void copyTimes() { - int i; - fileTime* op = oldFileTimes; - - for (i = 0; i < oldFileCnt; i++, op++) { - fileTime* np = findName(INDX_PTR(op->nameIndx), - newFileCnt, newFileTimes); - if (np) - np->modTime = op->modTime; - } -} - -/* Searches the specified table for the specified name. - */ -private -fileTime* findName( - char* name, /* Search name */ - int cnt, /* Number of names in table */ - fileTime* table /* Table to search */) { - fileTime ft; - - if (!cnt) - return NULL; - - /* Copy the string to reserved area */ - ft.nameIndx = 0; - strncpy(INDX_PTR(ft.nameIndx), name, MAXCHARNAME - 1); - - return (fileTime*)bsearch((char*)&ft, (char*)table, cnt, - sizeof(fileTime), cmpNames); -} - -/* Updates a file's time by reading the new time from - * the file on disk. - */ -private -void updateTime( - fileTime* p, /* Record to update */ - const char* dirName /* Directory name */) { -#if IS_LIB -#pragma unused(p) -#pragma unused(dirName) -#else - if (p) { - char charFile[MAXPATHLEN]; - struct stat s; -#ifdef __MWERKS__ - sprintf(charFile, ":%s:%s", dirName, INDX_PTR(p->nameIndx)); -#else - sprintf(charFile, "%s\\%s", dirName, INDX_PTR(p->nameIndx)); -#endif - if (!stat(charFile, &s)) - p->modTime = s.st_mtime; - } -#endif -} - -/* Scan all the files and hints the bez files that have changed. - * Called by AC and BuildFont for rehinting whole font. - */ -public -boolean DoAll( - boolean extraColor, - boolean release, /* Flags release version */ - boolean* renameLog, - boolean quiet) { -#ifdef IS_GGL - return FALSE; -#else - boolean result = TRUE; - - if (release) { - if (!readCharSet()) { - freeFileTimes(); - return FALSE; - } - } else - readInputDir(BEZDIR, FALSE); - - readTimesFile(FALSE, 0.0); - result = compareTimes(extraColor, release, renameLog, quiet); - writeTimesFile(FALSE, 0.0); - - freeFileTimes(); - - return result; -#endif -} - -/* Converts characters that have changed since the last run - * of BuildFont in the bez directory. - */ -private -boolean compareTimes( - boolean extraColor, - boolean release, /* Flags release version */ - boolean* renameLog, - boolean quiet) { - boolean result = TRUE; - boolean printStatus = TRUE; - int charCnt = 0; - fileTime* newp; - - for (newp = newFileTimes; newp - newFileTimes < newFileCnt; newp++) { - fileTime* oldp; - - newp = checkFile(&oldp, newp, BEZDIR); - if (newp == NULL) - break; - else if (release) { - sprintf(globmsg, "The %s character has out of date hints.\n Add hints again before creating a release version.\n", INDX_PTR(newp->nameIndx)); - LogMsg(globmsg, LOGERROR, OK, TRUE); - - if (oldp) - newp->modTime = oldp->modTime; - - result = FALSE; - } else if (DoFile(INDX_PTR(newp->nameIndx), extraColor)) { - if (printStatus) { - if (!quiet) { - sprintf(globmsg, "Adding hints %s... ", - (extraColor) ? "" : "(single layer) "); - LogMsg(globmsg, INFO, OK, FALSE); - } - printStatus = FALSE; - } - *renameLog = TRUE; - charCnt++; - updateTime(newp, BEZDIR); - } - } - - if (!quiet && !release && charCnt > 0) { - LogMsg(globmsg, INFO, OK, FALSE); - } - - return result; -} - -/* The character names/filenames in the name list are checked. If - * the circumstances have changed since the last timestamp file was - * generated the function returns so that the character can be rehinted. - * If the circumstances have stayed the same the file time is simply copied - * and the scan continues. Returns NULL when the list is exhausted. - */ -private -fileTime* checkFile( - fileTime** oldp, /* Old file time */ - fileTime* newp, /* File time to check from */ - const char* inputDir /* Conversion input directory */) { -#if IS_LIB -#pragma unused(oldp) -#pragma unused(newp) -#pragma unused(inputDir) -#else - for (; newp - newFileTimes < newFileCnt; newp++) { - char inFile[MAXPATHLEN]; - char* name = INDX_PTR(newp->nameIndx); - struct stat s; -#ifdef __MWERKS__ - sprintf(inFile, ":%s:%s", inputDir, name); -#else - sprintf(inFile, "%s\\%s", inputDir, name); -#endif - if (!stat(inFile, &s)) { - char bezFile[MAXPATHLEN]; - time_t newTime = s.st_mtime; - - *oldp = findName(name, oldFileCnt, oldFileTimes); - -#ifdef __MWERKS__ - sprintf(bezFile, ":%s:%s", BEZDIR, name); -#else - sprintf(bezFile, "%s\\%s", BEZDIR, name); -#endif - if ((*oldp == NULL) || - ((newTime != (*oldp)->modTime) && (strcmp(name, ".notdef") != 0)) || - !FileExists(bezFile, FALSE)) - /* The name wasn't in the old timestamp file or the - * file time has changed or the bez file doesn't - * exist or has the wrong permissions. - */ - return newp; - else - newp->modTime = (*oldp)->modTime; - } - } -#endif - return NULL; -} - -/* Converts characters that have changed since the last run of - * BuildFont from the specified input directory using - * the specified conversion function. Called by BuildFont -o when - * ill/ or pschars/ characters exist and may need converting. - */ -public -boolean ConvertCharFiles(char* inputDir, /* Coversion input directory */ - boolean release, /* Flags release version */ - float scale, /* Conversion scale */ - tConvertfunc convertFunc /* Conversion function */ -) { - boolean result = FALSE; - - if (release) - readCharList(); - else - readInputDir(inputDir, TRUE); - - readTimesFile(TRUE, scale); - result = compareCvtTimes(inputDir, release, convertFunc); - writeTimesFile(TRUE, scale); - - freeFileTimes(); - - return result; -} - -/* Reads through the charset file and builds a list of character/filenames. - */ -private -void readCharList() { - char fName[MAXFILENAME + 4]; - int i; - boolean start = TRUE; - short nextName = nextFree - nameBuf; /* Remember first name position */ - - for (newFileCnt = 0; ReadCharFileNames(fName, &start); newFileCnt++) - (void)storeName(fName); - - newFileTimes = (fileTime*)allocate(newFileCnt, sizeof(fileTime)); - - for (i = 0; i < newFileCnt; i++) { - newFileTimes[i].nameIndx = nextName; - nextName += strlen(INDX_PTR(nextName)) + 1; - } - - sortFileTimes(newFileCnt, newFileTimes); -} - -/* Converts characters that have changed since the last run - * of BuildFont from the input to the bez directory. - */ -private -boolean compareCvtTimes(char* inputDir, boolean release, tConvertfunc convertFunc) { - boolean result = TRUE; - fileTime* newp; - fileTime* oldp; - - for (newp = newFileTimes; newp - newFileTimes < newFileCnt; newp++) { - newp = checkFile(&oldp, newp, inputDir); - if (!newp) - break; - else if (release) { - sprintf(globmsg, "The %s character needs to be converted.\n Convert before creating a release version.\n", INDX_PTR(newp->nameIndx)); - LogMsg(globmsg, LOGERROR, OK, TRUE); - - if (oldp) - newp->modTime = oldp->modTime; - - result = FALSE; - } else { - (*convertFunc)(INDX_PTR(newp->nameIndx), INDX_PTR(newp->nameIndx)); - updateTime(newp, inputDir); - } - } - return result; -} diff --git a/c/autohint/autohintlib/source/ac/write.c b/c/autohint/autohintlib/source/ac/write.c deleted file mode 100644 index a2226dec1..000000000 --- a/c/autohint/autohintlib/source/ac/write.c +++ /dev/null @@ -1,671 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* write.c */ - -#include "ac.h" -#include "cryptdefs.h" -#include "fipublic.h" -#include "machinedep.h" -#include - -#define WRTABS_COMMENT (0) - -FILE *outputfile; -Fixed currentx, currenty; -boolean firstFlex, wrtColorInfo; -char S0[128]; -PClrPoint bst; -PClrPoint prv_bst; -char bch; -Fixed bx, by; -boolean bstB; -short subpathcount; -extern char *bezoutput; -extern int bezoutputalloc; -extern int bezoutputactual; - -#define ws(str) WriteString(str) -public -int writeAbsolute = 1; - -public -long int FRnd(long int x) { - /* This is meant to work on Fixed 24.8 values, not the elt path (x,y) which are 25.7 */ - long int r; - r = x; - if (roundToInt) { - r = r + (1 << 7); - r = r & ~0xFFL; - } - return r; -} - -/* returns the number of characters written and possibly encrypted*/ -static long WriteString(char *str) { - if (bezoutput) { - if ((bezoutputactual + (int)strlen(str)) >= bezoutputalloc) { - int desiredsize = MAX(bezoutputalloc * 2, (bezoutputalloc + (int)strlen(str))); -#if DOMEMCHECK - bezoutput = (char *)memck_realloc(bezoutput, desiredsize); -#else - bezoutput = (char *)ACREALLOCMEM(bezoutput, desiredsize); -#endif - if (bezoutput) { - bezoutputalloc = desiredsize; - } else { - return (-1); /*FATAL ERROR*/ - } - } - strcat(bezoutput, str); - bezoutputactual += (int)strlen(str); - return (long)strlen(str); - } else { - return DoContEncrypt((char *)str, outputfile, FALSE, (unsigned long)INLEN); - } -} - -/* Note: The 8 bit fixed fraction cannot support more than 2 decimal p;laces. */ -#define WRTNUM(i) \ - { \ - sprintf(S0, "%ld ", (long int)(i)); \ - ws(S0); \ - } - -#define WRTRNUM(i) \ - { \ - sprintf(S0, "%0.2f ", roundf((float)(i)*100) / 100); \ - ws(S0); \ - } - -static void wrtfx(Fixed f) { - if ((roundToInt) || (FracPart(f) == 0)) { - Fixed i = FRnd(f); - WRTNUM(FTrunc(i)); - } else { - float r = (float)FIXED2FLOAT(f); - WRTRNUM(r); - } -} - -static void wrtx(Fixed x) { - Fixed i; - Fixed dx; - if ((roundToInt) || (FracPart(x) == 0)) { - i = FRnd(x); - dx = i - currentx; - WRTNUM(FTrunc(dx)); - currentx = i; - } else { - float r; - i = x - currentx; - currentx = x; - r = (float)FIXED2FLOAT(i); - WRTRNUM(r); - } -} - -static void wrtxa(Fixed x) { - Fixed i; - if ((roundToInt) || (FracPart(x) == 0)) { - i = FRnd(x); - WRTNUM(FTrunc(i)); - currentx = i; - } else { - float r; - currentx = x; - r = (float)FIXED2FLOAT(x); - WRTRNUM(r); - } -} - -static void wrty(Fixed y) { - Fixed i; - Fixed dy; - if ((roundToInt) || (FracPart(y) == 0)) { - i = FRnd(y); - dy = i - currenty; - WRTNUM(FTrunc(dy)); - currenty = i; - } else { - float r; - i = y - currenty; - currenty = y; - r = (float)FIXED2FLOAT(i); - WRTRNUM(r); - } -} - -static void wrtya(Fixed y) { - Fixed i; - if ((roundToInt) || (FracPart(y) == 0)) { - i = FRnd(y); - WRTNUM(FTrunc(i)); - currenty = i; - } else { - float r; - currenty = y; - r = (float)FIXED2FLOAT(y); - WRTRNUM(r); - } -} - -#define wrtcd(c) \ - wrtx(c.x); \ - wrty(c.y) - -#define wrtcda(c) \ - wrtxa(c.x); \ - wrtya(c.y) - -/*To avoid pointless hint subs*/ -#define HINTMAXSTR 2048 -static char hintmaskstr[HINTMAXSTR]; -static char prevhintmaskstr[HINTMAXSTR]; - -void safestrcat(char *s1, char *s2) { - if (strlen(s1) + strlen(s2) + 1 > HINTMAXSTR) { - sprintf(S0, "ERROR: Hint information overflowing buffer: %s\n", fileName); - LogMsg(S0, LOGERROR, FATALERROR, TRUE); - } else { - strcat(s1, s2); - } -} - -#define sws(str) safestrcat(hintmaskstr, (char *)str) - -#define SWRTNUM(i) \ - { \ - sprintf(S0, "%ld ", (long int)(i)); \ - sws(S0); \ - } - -#define SWRTNUMA(i) \ - { \ - sprintf(S0, "%0.2f ", roundf((float)(i)*100) / 100); \ - sws(S0); \ - } - -static void NewBest(PClrPoint lst) { - Fixed x0, x1, y0, y1; - bst = lst; - bch = lst->c; - if (bch == 'y' || bch == 'm') { - bstB = TRUE; - x0 = lst->x0; - x1 = lst->x1; - bx = MIN(x0, x1); - } else { - bstB = FALSE; - y0 = lst->y0; - y1 = lst->y1; - by = MIN(y0, y1); - } -} - -static void WriteOne(Fixed s) { /* write s to output file */ - Fixed r = UnScaleAbs(s); - if (scalinghints) { - r = FRnd(r); - } - if (FracPart(r) == 0) { - SWRTNUM(FTrunc(r)) - } else { - float d = (float)FIXED2FLOAT(r); - if (writeAbsolute) { - SWRTNUMA(d); - } else { - d = (float)((d + 0.005) * 100); - SWRTNUM(d); - sws("100 div "); - } - } -} - -static void WritePointItem(PClrPoint lst) { - switch (lst->c) { - case 'b': - case 'v': - WriteOne(lst->y0); - WriteOne(lst->y1 - lst->y0); - sws(((lst->c == 'b') ? "rb" : "rv")); - break; - case 'y': - case 'm': - WriteOne(lst->x0); - WriteOne(lst->x1 - lst->x0); - sws(((lst->c == 'y') ? "ry" : "rm")); - break; - default: { - sprintf(S0, "Illegal point list data for file: %s.\n", - fileName); - LogMsg(S0, LOGERROR, NONFATALERROR, TRUE); - } - } - sws(" % "); - SWRTNUM(lst->p0 != NULL ? lst->p0->count : 0); - SWRTNUM(lst->p1 != NULL ? lst->p1->count : 0); - sws("\n"); -} - -static void WrtPntLst(PClrPoint lst) { - PClrPoint ptLst; - char ch; - Fixed x0, x1, y0, y1; - ptLst = lst; - - while (lst != NULL) { /* mark all as not yet done */ - lst->done = FALSE; - lst = lst->next; - } - while (TRUE) { /* write in sort order */ - lst = ptLst; - bst = NULL; - while (lst != NULL) { /* find first not yet done as init best */ - if (!lst->done) { - NewBest(lst); - break; - } - lst = lst->next; - } - if (bst == NULL) { - break; /* finished with entire list */ - } - lst = bst->next; - while (lst != NULL) { /* search for best */ - if (!lst->done) { - ch = lst->c; - if (ch > bch) { - NewBest(lst); - } else if (ch == bch) { - if (bstB) { - x0 = lst->x0; - x1 = lst->x1; - if (MIN(x0, x1) < bx) { - NewBest(lst); - } - } else { - y0 = lst->y0; - y1 = lst->y1; - if (MIN(y0, y1) < by) { - NewBest(lst); - } - } - } - } - lst = lst->next; - } - bst->done = TRUE; /* mark as having been done */ - WritePointItem(bst); - } -} - -static void wrtnewclrs(PPathElt e) { - if (!wrtColorInfo) { - return; - } - hintmaskstr[0] = '\0'; - WrtPntLst(ptLstArray[e->newcolors]); - if (strcmp(prevhintmaskstr, hintmaskstr)) { - ws("beginsubr snc\n"); - ws(hintmaskstr); - ws("endsubr enc\nnewcolors\n"); - strcpy(prevhintmaskstr, hintmaskstr); - } -} - -boolean IsFlex(PPathElt e) { - PPathElt e0, e1; - if (firstFlex) { - e0 = e; - e1 = e->next; - } else { - e0 = e->prev; - e1 = e; - } - return (e0 != NULL && e0->isFlex && e1 != NULL && e1->isFlex); -} - -static void mt(Cd c, PPathElt e) { - if (e->newcolors != 0) { - wrtnewclrs(e); - } - if (writeAbsolute) { - wrtcda(c); - ws("mt\n"); - } else { - if (FRnd(c.y) == currenty) { - wrtx(c.x); - ws("hmt\n"); - } else if (FRnd(c.x) == currentx) { - wrty(c.y); - ws("vmt\n"); - } else { - wrtcd(c); - ws("rmt\n"); - } - } - if (e->eol) { - ws("eol\n"); - } - if (e->sol) { - ws("sol\n"); - } -} - -static void dt(Cd c, PPathElt e) { - if (e->newcolors != 0) { - wrtnewclrs(e); - } - if (writeAbsolute) { - wrtcda(c); - ws("dt\n"); - } else { - if (FRnd(c.y) == currenty) { - wrtx(c.x); - ws("hdt\n"); - } else if (FRnd(c.x) == currentx) { - wrty(c.y); - ws("vdt\n"); - } else { - wrtcd(c); - ws("rdt\n"); - } - } - if (e->eol) { - ws("eol\n"); - } - if (e->sol) { - ws("sol\n"); - } -} - -Fixed flX, flY; -Cd fc1, fc2, fc3; - -#define wrtpreflx2(c) \ - wrtcd(c); \ - ws("rmt\npreflx2\n") - -#define wrtpreflx2a(c) \ - wrtcda(c); \ - ws("rmt\npreflx2a\n") - -static void wrtflex(Cd c1, Cd c2, Cd c3, PPathElt e) { - integer dmin, delta; - boolean yflag; - Cd c13; - real shrink, r1, r2; - if (firstFlex) { - flX = currentx; - flY = currenty; - fc1 = c1; - fc2 = c2; - fc3 = c3; - firstFlex = FALSE; - return; - } - yflag = e->yFlex; - dmin = DMIN; - delta = DELTA; - ws("preflx1\n"); - if (yflag) { - if (fc3.y == c3.y) { - c13.y = c3.y; - } else { - acfixtopflt(fc3.y - c3.y, &shrink); - shrink = (real)delta / shrink; - if (shrink < 0.0) { - shrink = -shrink; - } - acfixtopflt(fc3.y - c3.y, &r1); - r1 *= shrink; - acfixtopflt(c3.y, &r2); - r1 += r2; - c13.y = acpflttofix(&r1); - } - c13.x = fc3.x; - } else { - if (fc3.x == c3.x) { - c13.x = c3.x; - } else { - acfixtopflt(fc3.x - c3.x, &shrink); - shrink = (real)delta / shrink; - if (shrink < 0.0) { - shrink = -shrink; - } - acfixtopflt(fc3.x - c3.x, &r1); - r1 *= shrink; - acfixtopflt(c3.x, &r2); - r1 += r2; - c13.x = acpflttofix(&r1); - } - c13.y = fc3.y; - } - - if (writeAbsolute) { - wrtpreflx2a(c13); - wrtpreflx2a(fc1); - wrtpreflx2a(fc2); - wrtpreflx2a(fc3); - wrtpreflx2a(c1); - wrtpreflx2a(c2); - wrtpreflx2a(c3); - currentx = flX; - currenty = flY; - wrtcda(fc1); - wrtcda(fc2); - wrtcda(fc3); - wrtcda(c1); - wrtcda(c2); - wrtcda(c3); - WRTNUM(dmin); - WRTNUM(delta); - WRTNUM(yflag); - WRTNUM(FTrunc(FRnd(currentx))); - WRTNUM(FTrunc(FRnd(currenty))); - ws("flxa\n"); - } else { - wrtpreflx2(c13); - wrtpreflx2(fc1); - wrtpreflx2(fc2); - wrtpreflx2(fc3); - wrtpreflx2(c1); - wrtpreflx2(c2); - wrtpreflx2(c3); - currentx = flX; - currenty = flY; - wrtcd(fc1); - wrtcd(fc2); - wrtcd(fc3); - wrtcd(c1); - wrtcd(c2); - wrtcd(c3); - WRTNUM(dmin); - WRTNUM(delta); - WRTNUM(yflag); - WRTNUM(FTrunc(FRnd(currentx))); - WRTNUM(FTrunc(FRnd(currenty))); - ws("flx\n"); - } - firstFlex = TRUE; -} - -static void ct(Cd c1, Cd c2, Cd c3, PPathElt e) { - if (e->newcolors != 0) { - wrtnewclrs(e); - } - if (e->isFlex && IsFlex(e)) { - wrtflex(c1, c2, c3, e); - } else if (writeAbsolute) { - wrtcda(c1); - wrtcda(c2); - wrtcda(c3); - ws("ct\n"); - } else { - if ((FRnd(c1.x) == currentx) && (c2.y == c3.y)) { - wrty(c1.y); - wrtcd(c2); - wrtx(c3.x); - ws("vhct\n"); - } else if ((FRnd(c1.y) == currenty) && (c2.x == c3.x)) { - wrtx(c1.x); - wrtcd(c2); - wrty(c3.y); - ws("hvct\n"); - } else { - wrtcd(c1); - wrtcd(c2); - wrtcd(c3); - ws("rct\n"); - } - } - if (e->eol) { - ws("eol\n"); - } - if (e->sol) { - ws("sol\n"); - } -} - -static void cp(PPathElt e) { - if (e->newcolors != 0) { - wrtnewclrs(e); - } - if (idInFile) { - WRTNUM(subpathcount++); - ws("id\n"); - } - ws("cp\n"); - if (e->eol) { - ws("eol\n"); - } - if (e->sol) { - ws("sol\n"); - } -} - -static void NumberPath() { - register short int cnt; - register PPathElt e; - e = pathStart; - cnt = 1; - while (e != NULL) { - e->count = cnt++; - e = e->next; - } -} - -void SaveFile() { - register PPathElt e = pathStart; - Cd c1, c2, c3; - char outfile[MAXPATHLEN], tempfilename[MAXPATHLEN]; -/* AddSolEol(); */ -#ifdef IS_LIB - if (bezoutput) { - outputfile = NULL; - } else { -#endif - sprintf(tempfilename, "%s%s", outPrefix, TEMPFILE); - outputfile = ACOpenFile(tempfilename, "wb", OPENWARN); - if (outputfile == NULL) { - return; - } - subpathcount = 1; -#ifdef IS_LIB - } -#endif -#ifdef ENCRYPTOUTPUT - DoInitEncrypt(outputfile, OTHER, HEX, 64L, FALSE); -#endif - sprintf(S0, "%% %s\n", fileName); - ws(S0); - wrtColorInfo = (pathStart != NULL && pathStart != pathEnd); - NumberPath(); - prevhintmaskstr[0] = '\0'; - if (wrtColorInfo && (!e->newcolors)) { - hintmaskstr[0] = '\0'; - WrtPntLst(ptLstArray[0]); - ws(hintmaskstr); - strcpy(prevhintmaskstr, hintmaskstr); - } - - ws("sc\n"); - firstFlex = TRUE; - currentx = currenty = 0L; - while (e != NULL) { - switch (e->type) { - case CURVETO: - c1.x = UnScaleAbs(itfmx(e->x1)); - c1.y = UnScaleAbs(itfmy(e->y1)); - c2.x = UnScaleAbs(itfmx(e->x2)); - c2.y = UnScaleAbs(itfmy(e->y2)); - c3.x = UnScaleAbs(itfmx(e->x3)); - c3.y = UnScaleAbs(itfmy(e->y3)); - ct(c1, c2, c3, e); - break; - case LINETO: - c1.x = UnScaleAbs(itfmx(e->x)); - c1.y = UnScaleAbs(itfmy(e->y)); - dt(c1, e); - break; - case MOVETO: - c1.x = UnScaleAbs(itfmx(e->x)); - c1.y = UnScaleAbs(itfmy(e->y)); - mt(c1, e); - break; - case CLOSEPATH: - cp(e); - break; - default: { - sprintf(S0, "Illegal path list for file: %s.\n", fileName); - LogMsg(S0, LOGERROR, NONFATALERROR, TRUE); - } - } -#if WRTABS_COMMENT - ws(" % "); - WRTNUM(e->count) - switch (e->type) { - case CURVETO: - wrtfx(c1.x); - wrtfx(c1.y); - wrtfx(c2.x); - wrtfx(c2.y); - wrtfx(c3.x); - wrtfx(c3.y); - ws("ct"); - break; - case LINETO: - wrtfx(c1.x); - wrtfx(c1.y); - ws("dt"); - break; - case MOVETO: - wrtfx(c1.x); - wrtfx(c1.y); - ws("mt"); - break; - case CLOSEPATH: - ws("cp"); - break; - } - ws("\n"); -#endif - e = e->next; - } - ws("ed\n"); -#ifdef ISLIB - fclose(outputfile); -#endif - -#ifndef IS_LIB - if (featurefiledata) { - sprintf(outfile, "%s", fileName); - } else { -#endif - sprintf(outfile, "%s%s", outPrefix, fileName); -#ifndef IS_LIB - } - RenameFile(tempfilename, outfile); -#endif -} diff --git a/c/autohint/autohintlib/source/actest/AC_C_libtest.c b/c/autohint/autohintlib/source/actest/AC_C_libtest.c deleted file mode 100644 index 597c6b279..000000000 --- a/c/autohint/autohintlib/source/actest/AC_C_libtest.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/* AC_C_libtest.c */ - -#include -#include -#include -#include "ac_C_lib.h" - -int main(int argc, char *argv[]) { - int result, i, actualsize, allocsize = 9096; - char returnvalue[9096], *current, source[9048], fontinfo[2048]; - FILE *file; - int c; - - file = fopen(argv[argc - 2], "r"); - if (!file) { - fprintf(stderr, "Couldn't open %s\n", argv[argc - 2]); - return 0; - } - current = source; - while ((c = fgetc(file)) != EOF) { - *current++ = (char)c; - } - *current = '\0'; - - fclose(file); - - file = fopen(argv[argc - 1], "r"); - if (!file) { - fprintf(stderr, "Couldn't open %s\n", argv[argc - 2]); - return 0; - } - current = fontinfo; - while ((c = fgetc(file)) != EOF) { - *current++ = (char)c; - } - *current = '\0'; - - fclose(file); - - actualsize = allocsize; - result = AutoColorString(NULL, fontinfo, returnvalue, &actualsize, 0); - printf("AutoColorString with NULL source returned %d and size %d\n", result, actualsize); - - actualsize = allocsize; - result = AutoColorString(source, NULL, returnvalue, &actualsize, 0); - printf("AutoColorString with NULL fontinfo returned %d and size %d\n", result, actualsize); - - actualsize = allocsize; - result = AutoColorString(NULL, NULL, returnvalue, &actualsize, 0); - printf("AutoColorString with NULL source and fontinfo returned %d and size %d\n", result, actualsize); - - actualsize = allocsize; - result = AutoColorString("", fontinfo, returnvalue, &actualsize, 0); - printf("AutoColorString with empty source returned %d and size %d\n", result, actualsize); - - actualsize = allocsize; - result = AutoColorString(source, "", returnvalue, &actualsize, 0); - printf("AutoColorString with empty fontinfo returned %d and size %d\n", result, actualsize); - - actualsize = allocsize; - result = AutoColorString("", "", returnvalue, &actualsize, 0); - printf("AutoColorString with empty source and fontinfo returned %d and size %d\n", result, actualsize); - - for (i = 0; i < 0; i++) { - actualsize = allocsize; - printf("Source size %d\n", strlen(source)); - result = AutoColorString(source, fontinfo, returnvalue, &actualsize, 0); - printf("AutoColorString returned %d and size %d\n", result, actualsize); - } - actualsize = allocsize; - printf("Source size %d\n", strlen(source)); - result = AutoColorString(source, fontinfo, returnvalue, &actualsize, 0); - printf("AutoColorString returned %d and size %d\n", result, actualsize); - if (!result) { - FILE *outfile = fopen("AC_test.bez", "w"); - fprintf(outfile, "%s", returnvalue); - fclose(outfile); - } - return 0; -} diff --git a/c/autohint/autohintlib/source/bf/afmcharsetdefs.h b/c/autohint/autohintlib/source/bf/afmcharsetdefs.h deleted file mode 100644 index cba981deb..000000000 --- a/c/autohint/autohintlib/source/bf/afmcharsetdefs.h +++ /dev/null @@ -1,24 +0,0 @@ - -#ifndef AFMCHARSETDEFS_H -#define AFMCHARSETDEFS_H - -#include - -#define AFMCHARSETTABLE "AFMcharset.tbl" - -struct FItoAFMCharSetMap { - struct FItoAFMCharSetMap *next; - char *fiName; - char *afmName; -}; - -struct AFMCharSetTbl { - char *defaultCSVal; - struct FItoAFMCharSetMap *charSetMap; -}; - -extern struct AFMCharSetTbl *AFMCharSet_Parse(FILE *file); -extern void FreeAFMCharSetTbl(); -extern char *GetFItoAFMCharSetName(void); - -#endif diff --git a/c/autohint/autohintlib/source/bf/basic.h b/c/autohint/autohintlib/source/bf/basic.h deleted file mode 100644 index 36cf5c491..000000000 --- a/c/autohint/autohintlib/source/bf/basic.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* basic.h */ - -#ifndef BASIC_H -#define BASIC_H -#include -#include -#include "pubtypes.h" - -#if __MWERKS__ - -#ifndef __dead2 -#define __dead2 -#define __pure2 -#define __unused -#endif -#include - -#include -#include - -/*#include */ - -#else -#include -#include -#include -#include -#if OSX -#include -#else -#include -#endif -#include -typedef unsigned char boolean; -#endif - -#ifndef FALSE -#define FALSE 0 -#define TRUE 1 -#endif - -/* macro definitions */ -#define NUMMIN(a, b) ((a) <= (b) ? (a) : (b)) -#define NUMMAX(a, b) ((a) >= (b) ? (a) : (b)) -#ifdef ABS -#undef ABS -#endif -#define ABS(a) ((a) >= 0 ? (a) : -(a)) -/* Round the same way as PS. i.e. -6.5 ==> -6.0 */ -#define LROUND(a) ((a > 0) ? (long)(a + 0.5) : ((a + (long)(-a)) == -0.5) ? (long)a : (long)(a - 0.5)) -#define SCALEDRTOL(a, s) (a < 0 ? (long)((a * s) - 0.5) : (long)((a * s) + 0.5)) - -typedef int indx; /* for indexes that could be either short or */ - /* long - let the compiler decide */ - -#define RAWPSDIR "pschars" -#define ILLDIR "ill" -#define BEZDIR "bez" -#define UNSCALEDBEZ "bez.unscaled" -#define TMPDIR "._tmp" -#ifdef MAXPATHLEN -#undef MAXPATHLEN -#endif -#define MAXPATHLEN 1024 /* max path name len for a dir or folder */ - /* (includes 1 byte for null terminator) */ - -/* defines for LogMsg code param */ -#define OK 0 -#define NONFATALERROR 1 -#define FATALERROR 2 - -/* defines for LogMsg level param */ -#define INFO 0 -#define WARNING 1 -#define LOGERROR 2 - -#define MAXMSGLEN 500 /* maximum message length */ -extern char globmsg[MAXMSGLEN + 1]; /* used to format the string passed to LogMsg */ - -extern void LogMsg( - char *, short, short, boolean); - -extern short WarnCount( - void); - -extern void ResetWarnCount( - void); - -#endif /*BASIC_H*/ diff --git a/c/autohint/autohintlib/source/bf/bftoac.h b/c/autohint/autohintlib/source/bf/bftoac.h deleted file mode 100644 index 8dd30cc85..000000000 --- a/c/autohint/autohintlib/source/bf/bftoac.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* bftoac.h */ - -/* procedures in AC called from buildfont */ - -#ifndef BFTOAC_H -#define BFTOAC_H - -#include "memcheck.h" - -extern boolean AutoColor(boolean, boolean, boolean, boolean, boolean, short, char *[], boolean, boolean, boolean, boolean); - -extern boolean CreateACTimes(void); -typedef void (*tConvertfunc)(const char *, const char *); -extern boolean ConvertCharFiles(char *, boolean, float, tConvertfunc); - -extern void FindCurveBBox(Fixed, Fixed, Fixed, Fixed, Fixed, Fixed, Fixed, Fixed, Fixed *, Fixed *, Fixed *, Fixed *); - -extern boolean GetInflectionPoint(Fixed, Fixed, Fixed, Fixed, Fixed, Fixed, Fixed, Fixed, Fixed *); - -extern boolean ReadCharFileNames(char *, boolean *); - -extern void setPrefix(char *); - -extern void SetReadFileName(char *); - -#endif /*BFTOAC_H*/ diff --git a/c/autohint/autohintlib/source/bf/buildfont.h b/c/autohint/autohintlib/source/bf/buildfont.h deleted file mode 100644 index 1c4835cc0..000000000 --- a/c/autohint/autohintlib/source/bf/buildfont.h +++ /dev/null @@ -1,423 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -#include "basic.h" - -#ifndef BUILDFONT_H -#define BUILDFONT_H - -#ifdef EXECUTABLE -#define OUTPUTBUFF stdout -#else -#define OUTPUTBUFF stderr -#endif - -#define ASCIIFONTNAME "font.ps" -#define CHARSTRINGSFILENAME ".bfees.bin" -#define COMPAFMFILE ".bfcomposites.afm" -#define COMPFILE "composites.ps" -#define COMPOSITESFILENAME ".bfees2.bin" -#define DEFAULTWIDTH 500 -#define ENCFILENAME ".bfencodingfile" -#define FONTBBOXFILENAME ".bffontbbox" -#define FONTSTKLIMIT 22 -/*****************************************/ -/* font interpreter stack limit - Note */ -/* that the actual limit is 24, but */ -/* because the # of parameters and */ -/* callothersubr # are also pushed on */ -/* the stack, the effective value is 22. */ -/*****************************************/ -#define INTEGER 0 -#define KERNAFMFILE "kerning.afm" -#define MAXBYTES 13000 -/*****************************************/ -/* max number of bytes in a decrypted */ -/* bez file or encoded charstring */ -/*****************************************/ -#define MAXCHARNAME 37 -/*****************************************/ -/* max character name length (including */ -/* byte for null terminator) - a bug in */ -/* early LW ROMs limits PS names to */ -/* 36 bytes */ -/*****************************************/ -#define MAXCHARS 400 -/*****************************************/ -/* max characters in a font (including */ -/* composites) */ -/*****************************************/ -#define MAXENCLINE 65000L -/*****************************************/ -/* linelength used when encrypting */ -/*****************************************/ -#define MAXFILENAME 32 -/*****************************************/ -/* max relative file name length */ -/* (including byte for null terminator) */ -/* - limit imposed by max Mac filename */ -/* length - note that max Mac foldername */ -/* would be 34 chars because of colons */ -/* and that for root is 29 chars */ -/*****************************************/ -#ifndef MAXINT -#define MAXINT 32767L -#endif -#define MAXLINE 1000 -/*****************************************/ -/* maximum length of a line */ -/*****************************************/ -#ifndef MININT -#define MININT -32768L -#endif -#define MULTIFONTBBOXFILENAME ".bfmultifontbbox" -#define SCALEDHINTSINFO "scaledhintsinfo" -#define SUBRSFILENAME ".bfsubrs.bin" -#define TEMPFILE ".bftempfile" -#define UNINITWIDTH -1 -/*****************************************/ -/* width value if no width seen yet */ -/*****************************************/ -#define UNSCALEDASCIIFONT "font.unscaled" -#define WIDTHSFILENAME "widths.ps" -#define diskfontmax 65000L - -/*****************************************************************************/ -/* the following are for scanning "PostScript format" input file lines */ -/*****************************************************************************/ - -#define COMMENT(s) s[strspn(s, " \n\r\t\v\f")] == '%' -#define BLANK(s) sscanf(s, "%*s") == EOF -#define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp((a), (b)) == 0)) -#define STRNEQ(a, b) (((a)[0] != (b)[0]) || (strcmp((a), (b)) != 0)) - -#define NL '\012' -/*****************************************/ -/* Since the Mac treats both '\n' and */ -/* '\r' as ASCII 13 (i.e. carr. return) */ -/* need to define this. */ -/*****************************************/ - -/*****************************************************************************/ -/* Defines character bounding box. */ -/*****************************************************************************/ -typedef struct Bbox { - long int llx, lly, urx, ury; -} Bbox, *BboxPtr; - -/*****************************************************************************/ -/* Defines character point coordinates. */ -/*****************************************************************************/ -typedef struct -{ - long int x, y; -} Cd, *CdPtr; - -/*****************************************************************************/ -/* Defines parsing method based on fontinfo key CharacterSetFileType */ -/*****************************************************************************/ -typedef enum { - bf_CHARSET_STANDARD, - bf_CHARSET_CID -} CharsetParser; - -#define BF_LAYOUTS "layouts" -#define BF_SUBSETS "subsets" -#define BF_STD_LAYOUT "standard" - -#define OPENERROR 2 -#define OPENWARN 1 -#define OPENOK 0 - -extern char bezdir[MAXPATHLEN]; -extern boolean scalinghints; - -/*****************************************************************************/ -/* Tries to open the given file with the access attribute specified. If it */ -/* fails an error message is printed and the program exits. */ -/*****************************************************************************/ -extern FILE * -ACOpenFile(char *, char *, short); - -/*****************************************************************************/ -/* Deletes the specified file from the bez directory. */ -/*****************************************************************************/ -extern void -DeleteBezFile(char *, char *); - -/*****************************************************************************/ -/* Reads successive character and file names from character set file. */ -/*****************************************************************************/ -extern char * -ReadNames(char *, char *, long *, long *, FILE *); - -/*****************************************************************************/ -/* Reads a token from the data buffer. */ -/*****************************************************************************/ -extern char * -ReadToken(char *, char *, char *, char *); - -/*****************************************************************************/ -/* Returns whether file has .BAK suffix. */ -/*****************************************************************************/ -extern boolean -BAKFile(char *); - -/*****************************************************************************/ -/* Reads the file composites.ps, if it exists, and attempts to create */ -/* composite chars. for those listed. */ -/*****************************************************************************/ -extern long -make_composites(boolean, boolean, long *, char *, boolean, char **); - -/*****************************************************************************/ -/* Returns the max number of composites for the font. */ -/*****************************************************************************/ -extern int - readcomposite(boolean, indx); - -/*****************************************************************************/ -/* Computes the character bounding box. */ -/*****************************************************************************/ -extern int -computesbandbbx(char *, char *, long, BboxPtr, boolean, long, long); - -extern long -GetMaxBytes(void); - -extern void -SetMaxBytes(long); - -extern CharsetParser -GetCharsetParser(); - -extern void -SetCharsetLayout(char *fontinfoString); - -extern char * -GetCharsetLayout(); - -/*****************************************************************************/ -/* Sets the global variable charsetDir. */ -/*****************************************************************************/ -extern void -set_charsetdir(char *); - -/*****************************************************************************/ -/* Sets the global variable matrix. */ -/*****************************************************************************/ -extern int -set_matrix(char *); - -/*****************************************************************************/ -/* Sets the global variable uniqueIDFile. */ -/*****************************************************************************/ -extern void -set_uniqueIDFile(char *); - -/*****************************************************************************/ -/* Transforms a point using the global variable, matrix. */ -/*****************************************************************************/ -extern int -TransformPoint(long *, long *, boolean); - -/*****************************************************************************/ -/* Returns the name of the character set file. */ -/*****************************************************************************/ -extern void -getcharsetname(char *); - -/*****************************************************************************/ -/* Returns the name of the character set file. */ -/*****************************************************************************/ -extern void -setcharsetname(boolean, char *, char *); - -/*****************************************************************************/ -/* Returns the name of the encoding file. */ -/*****************************************************************************/ -extern void -get_encodingfilename(char *, boolean, int); - -/*****************************************************************************/ -/* Make an Adobe PS font or a release font. */ -/*****************************************************************************/ -extern int -makePSfont(char *, boolean, boolean, boolean, long, long, long); - -/*****************************************************************************/ -/* Make a Macintosh printer font. */ -/*****************************************************************************/ -extern int -makelwfn(char *, char *, char); - -/*****************************************************************************/ -/* Make an IBM printer font. */ -/*****************************************************************************/ -extern int -makeibmfont(char *, char *, char); - -extern void -GetFontMatrix(char *, char *); - -/*****************************************************************************/ -/* Returns the total number of input directories. */ -/*****************************************************************************/ -extern short -GetTotalInputDirs(void); - -extern void -SetTotalInputDirs(short); - -/*****************************************************************************/ -/* Parse the private dict portion of an ASCII format font. */ -/*****************************************************************************/ -extern void -ParseFont(FILE *, FILE *, long, long *, long *, long *, long *, boolean); - -/*****************************************************************************/ -/* Program to derive printer font file name for the mac from the PostScript */ -/* printer font name. */ -/*****************************************************************************/ -extern char * -printer_filename(char *); - -extern int -convert_PScharfile(const char *, const char *); - -/*****************************************************************************/ -/* Converts raw PS files to relativized bez format. */ -/*****************************************************************************/ -extern int - convert_rawPSfiles(boolean); - -extern void -convert_illcharfile(const char *, const char *); - -extern void - convert_illfiles(boolean); - -extern long -process_chars(boolean, boolean, boolean, long *, long *, boolean, boolean); - -extern void -set_scale(float *); - -extern short -strindex(char *, char *); - -extern boolean ConvertCharFiles(char *inputDir, - boolean release, - float scale, - void (*convertFunc)(const char *, const char *)); - -/*****************************************************************************/ -/* Creates an Adobe Font Metrics (AFM) file. */ -/*****************************************************************************/ -extern int - make_afm(boolean); - -extern int -ReadWriteFile(FILE *, char *); - -/*****************************************************************************/ -/* Looks up a keyword in the fontinfo file and writes the value to the */ -/* given output file. */ -/*****************************************************************************/ -extern int -WriteEntry(FILE *, char *, char *, boolean, boolean); - -/*****************************************************************************/ -/* Returns whether given character is in StandardEncoding. */ -/*****************************************************************************/ -extern boolean -InStandardEncoding(char *, long *); - -/*****************************************************************************/ -/* Writes copyright notice and trademark information. */ -/*****************************************************************************/ -extern int -WriteCopyrightsAndTrademark(FILE *, char); - -/*****************************************************************************/ -/* Frees composite table. */ -/*****************************************************************************/ -extern void -FreeCompTab(void); - -/*****************************************************************************/ -/* Deallocates memory and deletes temporary files. */ -/*****************************************************************************/ -extern int -cleanup(short); - -extern char * - GetBaseFontPath(boolean); - -extern void -FileNameLenOK(char *); - -extern void -CharNameLenOK(char *); - -extern void -PathNameLenOK(char *); - -extern char * -AllocateMem(unsigned int, unsigned int, const char *); - -extern char * -ReallocateMem(char *, unsigned int, const char *); - -extern void -UnallocateMem(void *ptr); - -extern unsigned long -CheckFileBufferLen(char **, char *); - -extern void -WriteBlendEntry(FILE *, char *, char *, boolean); - -extern int -WriteStart(FILE *, const char *); - -/*****************************************************************************/ -/* Gets the name of the file containing the current uniqueID. */ -/*****************************************************************************/ -extern void -getidfilename(char *); - -extern long -ACReadFile(char *, FILE *, char *, long); - -extern long -getmaxcomps(void); - -extern long -getrealcomps(void); - -extern void -get_working_dir(char *); - -extern void -init_working_dir(void); - -extern void -set_working_dir(void); - -extern void -LoadSubsetData(void); - -extern void -SetSubsetName(char *name); - -extern char * -GetSubsetName(void); - -extern char * -GetSubsetPath(void); - -extern boolean -UsesSubset(void); - -#endif /*BUILDFONT_H*/ diff --git a/c/autohint/autohintlib/source/bf/charlist.c b/c/autohint/autohintlib/source/bf/charlist.c deleted file mode 100644 index fd7df49b5..000000000 --- a/c/autohint/autohintlib/source/bf/charlist.c +++ /dev/null @@ -1,618 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -/*****************************************************************************/ -/* This module implements the character list, which is built prior to */ -/* filling in the character table. */ -/*****************************************************************************/ - -#include "buildfont.h" -#include "charlistpriv.h" -#include "charlist.h" -#include "charpath.h" -#include "chartable.h" -#include "derivedchars.h" -#include "transitionalchars.h" -#include "machinedep.h" - -#define MAXCLIST 800 - -static boolean charsetexists; -static int maxclist = 0; - -static void readcharset(boolean); -indx FindCharListEntry(char *); -static indx DumbFindCharListEntry(char *); -static indx FileInCharList(char *); -static void checkduplicates(void); -static void checkfiledups(void); -static void checkcharlist(boolean, boolean, char *, indx); -static void swap(struct cl_elem *, struct cl_elem *); - -static void -readcharset(boolean release) -/*****************************************************************************/ -/* Put entry for each character into charlist. */ -/*****************************************************************************/ -{ - FILE *filelist = NULL; - char cname[MAXCHARNAME]; - char filename[MAXFILENAME]; - char charsetfilename[MAXPATHLEN]; - boolean foundone = FALSE; - long masters; - long hintDir; - - getcharsetname(charsetfilename); - charsetexists = (strlen(charsetfilename) > 0); - if (!charsetexists) return; - -#if 0 /*DEBUG*/ - { - char wd[MAXPATHLEN]; - getwd(wd); - fprintf(OUTPUTBUFF, "open wd:%s\nfile: %s\n", wd, charsetfilename); - } -#endif /*0*/ - -#if OLD - filelist = ACOpenFile(charsetfilename, "r", (release ? OPENERROR : OPENWARN)); - if (filelist == NULL) return; -#else - - filelist = ACOpenFile(charsetfilename, "r", OPENOK); - if (filelist == NULL) { - char charsetdotdot[MAXPATHLEN]; - - sprintf(charsetdotdot, "../%s", charsetfilename); - filelist = ACOpenFile(charsetdotdot, "r", OPENOK); - - if (filelist == NULL) { - /* output warning on original name */ - filelist = ACOpenFile(charsetfilename, "r", - (release ? OPENERROR : OPENWARN)); - return; - } - } -#endif - - while ((ReadNames(cname, filename, &masters, &hintDir, filelist)) != NULL) { - AddCharListEntry(cname, filename, masters, hintDir, - FALSE, FALSE, FALSE, FALSE); - foundone = TRUE; - } - - fclose(filelist); - - if (!foundone) { - sprintf(globmsg, - "There are no character names in the character set file: %s.\n", - charsetfilename); - - if (release) - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - else - LogMsg(globmsg, WARNING, OK, TRUE); - } -} - -extern indx -FindCharListEntry(char *cname) { - indx low = 0; - indx high = clsize - 1; - indx mid; - indx cond; - - while (low <= high) { - mid = (low + high) / 2; - cond = strcmp(cname, charlist[mid].charname); - - if (cond < 0) - high = mid - 1; - else if (cond > 0) - low = mid + 1; - else - return mid; - } - - return -1; -} - -static indx -DumbFindCharListEntry(char *cname) { - int i; - for (i = 0; i < clsize; i++) { - if (STREQ(cname, charlist[i].charname)) - return (i); - } - - return -1; -} - -static indx -FileInCharList(char *fname) { - indx low = 0; - indx high = clsize - 1; - indx mid; - indx cond; - - while (low <= high) { - mid = (low + high) / 2; - cond = strcmp(fname, charlist[mid].filename); - - if (cond < 0) - high = mid - 1; - else if (cond > 0) - low = mid + 1; - else - return mid; - } - - return -1; -} - -static void -checkduplicates() { - indx i = 0; - indx j; - boolean duplicate = FALSE; - - while (i < clsize) { - for (j = i + 1; j < clsize; j++) { - if (STRNEQ(charlist[i].charname, charlist[j].charname)) break; - /* Not a duplicate. */ - - sprintf(globmsg, - "Duplicate character name: %s in the character set.\n", - charlist[i].charname); - LogMsg(globmsg, LOGERROR, OK, TRUE); - duplicate = TRUE; - } - - i = j; - } - - if (duplicate) - LogMsg( - "BuildFont cannot continue with duplication(s) " - "in character set.\n", - LOGERROR, NONFATALERROR, TRUE); -} - -static void -checkfiledups() { - indx i = 0; - indx j; - boolean duplicate = FALSE; - - while (i < clsize) { - for (j = i + 1; j < clsize; j++) { - if (STRNEQ(charlist[i].filename, charlist[j].filename)) break; - /* Not a duplicate. */ - - sprintf(globmsg, "Duplicate file name: %s in the character set.\n", - charlist[i].filename); - LogMsg(globmsg, LOGERROR, OK, TRUE); - duplicate = TRUE; - } - - i = j; - } - - if (duplicate) - LogMsg( - "BuildFont cannot continue with duplicate file name(s) in\n" - " character set.\n", - LOGERROR, NONFATALERROR, TRUE); -} - -static void -checkcharlist(boolean release, boolean quiet, char *indir, indx dirix) -/*****************************************************************************/ -/* If any non-derived, non-composite file is not found, a warning or error */ -/* is given. */ -/*****************************************************************************/ -{ - indx i = 0; - char inname[MAXPATHLEN]; - boolean filemissing = FALSE; - - while (i < clsize) { - if (!charlist[i].composite && - !charlist[i].derived && - (dirix < charlist[i].masters)) /* for cube */ - { - if (!charlist[i].transitional) { - get_filename(inname, indir, charlist[i].filename); - - if (!FileExists(inname, FALSE)) { - if (!quiet) { - sprintf(globmsg, - "The %s file does not exist or" - " is not accessible,\n" - " but is in the character set.\n", - inname); - LogMsg(globmsg, (release ? LOGERROR : WARNING), OK, TRUE); - } - - filemissing = TRUE; - } - } - } - i++; - } - - if (release && filemissing) - LogMsg("BuildFont cannot continue with missing input file(s).\n", LOGERROR, - NONFATALERROR, TRUE); -} - -extern void -AddCharListEntry(char *cname, char *fname, - long masters, /* number of masters, 1-16 */ - long hintDir, /* index of hint directory for this */ - /* character in dir list */ - boolean derived, boolean composite, boolean inBez, boolean transitional) { - indx fnlen; - indx i; - - if (maxclist == 0) { - charlist = (struct cl_elem *)AllocateMem(MAXCLIST, - sizeof(struct cl_elem), "character list"); - maxclist = MAXCLIST; - - for (i = 0; i < maxclist; i++) - charlist[i].inCharTable = charlist[i].inBezDir = FALSE; - - clsize = 0; - } - - if (clsize >= maxclist) { - maxclist += 100; - charlist = (struct cl_elem *)ReallocateMem((char *)charlist, - (unsigned)(maxclist * sizeof(struct cl_elem)), "character list"); - - for (i = clsize; i < maxclist; i++) - charlist[i].inCharTable = charlist[i].inBezDir = FALSE; - } - - if (DumbFindCharListEntry(cname) >= 0) - return; /* already in table, probably as a */ - /* transitional character */ - - charlist[clsize].charname = AllocateMem((unsigned)(strlen(cname) + 1), - sizeof(char), "character name"); - strcpy(charlist[clsize].charname, cname); - - if ((fname != NULL) && ((fnlen = strlen(fname)) > 0)) { - charlist[clsize].filename = AllocateMem((unsigned)(fnlen + 1), - sizeof(char), "file name"); - strcpy(charlist[clsize].filename, fname); - } else - charlist[clsize].filename = charlist[clsize].charname; - - charlist[clsize].derived = derived; - charlist[clsize].composite = composite; - charlist[clsize].inCharTable = FALSE; - charlist[clsize].inBezDir = inBez; - charlist[clsize].masters = masters; - charlist[clsize].hintDir = hintDir; - charlist[clsize].transitional = transitional; - clsize++; -} - -extern boolean -CheckCharListEntry(char *cname, char *fname, boolean derived, - boolean composite, boolean transitional, boolean release, indx dirIx) { - boolean error = FALSE; - indx cli = FindCharListEntry(cname); - - if (cli < 0) { - if (release && derived) { - sprintf(globmsg, - "Derived character: %s is not found" - " in the character set.\n", - cname); - LogMsg(globmsg, LOGERROR, OK, TRUE); - error = TRUE; - } else if (release && transitional) { - sprintf(globmsg, - "Transitional character: %s is not found" - " in the character set.\n", - cname); - LogMsg(globmsg, LOGERROR, OK, TRUE); - error = TRUE; - } else if (charsetexists) { - if (transitional) - sprintf(globmsg, - "Transitional character: %s is not found" - " in the character set.\n", - cname); - if (derived) - sprintf(globmsg, - "Derived character: %s is not found" - " in the character set.\n", - cname); - if (composite) - sprintf(globmsg, - "Composite character: %s is not found" - " in the character set.\n", - cname); - - LogMsg(globmsg, WARNING, OK, TRUE); - } - - return error; - } - - if (charlist[cli].transitional && transitional && (dirIx == 0)) { - sprintf(globmsg, "%s is a duplicate transitional character name.\n", - charlist[cli].charname); - LogMsg(globmsg, LOGERROR, OK, TRUE); - error = TRUE; - } - - if (charlist[cli].derived && derived && (dirIx == 0)) { - sprintf(globmsg, "%s is a duplicate derived character name.\n", - charlist[cli].charname); - LogMsg(globmsg, LOGERROR, OK, TRUE); - error = TRUE; - } - - if (charlist[cli].composite && composite && (dirIx == 0)) { - sprintf(globmsg, "%s is a duplicate composite character name.\n", - charlist[cli].charname); - LogMsg(globmsg, LOGERROR, OK, TRUE); - error = TRUE; - } - - charlist[cli].derived = charlist[cli].derived || derived; - charlist[cli].transitional = charlist[cli].transitional || transitional; - charlist[cli].composite = charlist[cli].composite || composite; - - if (charlist[cli].derived && charlist[cli].composite) { - sprintf(globmsg, - "Character name %s was defined more than once as" - " a derived or composite character .\n", - charlist[cli].charname); - LogMsg(globmsg, LOGERROR, OK, TRUE); - error = TRUE; - } - - if ((strlen(fname) > 0) && STRNEQ(charlist[cli].filename, fname)) { - sprintf(globmsg, - "%s character has filename %s in character set and \n" - " filename %s in %s file.\n", - charlist[cli].charname, - charlist[cli].filename, fname, - charlist[cli].derived ? DERIVEDCHARFILENAME : COMPFILE); - LogMsg(globmsg, LOGERROR, OK, TRUE); - error = TRUE; - } - - return error; -} - -static void -swap(struct cl_elem *c1, struct cl_elem *c2) { - struct cl_elem temp; - - temp = *c1; - *c1 = *c2; - *c2 = temp; -} - -extern void -sortcharlist(boolean byfilename) -/*****************************************************************************/ -/* sort the charlist by character name */ -/*****************************************************************************/ -{ - indx gap, i, j; - - for (gap = clsize / 2; gap > 0; gap = gap / 2) - for (i = gap; i < clsize; i++) - for (j = i - gap; j >= 0; j = j - gap) { - if (!byfilename) { - if (strcmp(charlist[j].charname, charlist[j + gap].charname) < 0) - break; - } else if (strcmp(charlist[j].filename, charlist[j + gap].filename) < 0) - break; - - swap(&charlist[j], &charlist[j + gap]); - } -} - -/*****************************************************************************/ -/* Put entry for each character into charlist. */ -/*****************************************************************************/ -/*extern void -makecharlist(boolean release, boolean quiet, char *indir, indx dirix) - { - indx i; - - if (dirix == 0) - { - if (maxclist == 0) - { - charlist = (struct cl_elem *) AllocateMem(MAXCLIST, - sizeof(struct cl_elem), "character list"); - maxclist = MAXCLIST; - - for (i = 0; i < maxclist; i++) - charlist[i].inCharTable = charlist[i].inBezDir = FALSE; - - clsize = 0; - } - - readcharset(release); - } - - sortcharlist(FALSE); - if (dirix == 0) checkduplicates(); - readderived(release, dirix); - readcomposite(release, dirix); - checkcharlist(release, quiet, indir, dirix); - sortcharlist(TRUE); - checkfiledups(); - } - - -*/ -extern boolean -NameInCharList(char *fname) { - return (FileInCharList(fname) >= 0); -} - -/* -extern void -CopyCharListToTable() - { - indx i; - - for (i = 0; i < clsize; i++) - if ( !charlist[i].composite && - !charlist[i].derived && - !charlist[i].transitional && - charlist[i].inCharTable) - create_entry(charlist[i].charname, charlist[i].filename, UNINITWIDTH, - FALSE, 0, charlist[i].masters, charlist[i].hintDir); - } - -*/ - -extern void -CheckAllListInTable(boolean release) { - indx i; - boolean onemissing = FALSE; - - for (i = 0; i < clsize; i++) { - if (charlist[i].derived || charlist[i].composite || charlist[i].transitional || charlist[i].inBezDir) continue; - - sprintf(globmsg, - "Character: %s is in character set," - " but was not found in the\n %s directory.\n", - charlist[i].charname, bezdir); - LogMsg(globmsg, (release ? LOGERROR : WARNING), OK, TRUE); - onemissing = TRUE; - } - - if (release && onemissing) - LogMsg("BuildFont cannot continue with missing character(s).\n", - LOGERROR, NONFATALERROR, TRUE); -} - -extern boolean IsInFullCharset(char *bezName); - -extern boolean -CompareCharListToBez(char *fname, boolean release, indx dirix, boolean quiet) { - indx i = FileInCharList(fname); - char filename[MAXPATHLEN]; - - get_filename(filename, bezdir, fname); - if (i < 0) /* fname not found in charlist */ - { - if (release) { - if (!UsesSubset() || !IsInFullCharset(fname)) { - sprintf(globmsg, - "File name: %s in %s directory will not\n" - " be included in the font because it is not" - " in the character set.\n", - fname, bezdir); - - LogMsg(globmsg, WARNING, OK, TRUE); - } - } else { - /********************************************************************/ - /* Check if this is a directory since we already know it exists in */ - /* the bez directory. */ - /********************************************************************/ - if (FileExists(filename, TRUE)) { - if (dirix == 0) { - if (charsetexists) { - /* if subset: if charname "fname" is in layouts, - then do not issue this message. */ - if (!UsesSubset() || !IsInFullCharset(fname)) { - if (!quiet) { - sprintf(globmsg, - "Extra character file: %s in %s directory will\n" - " be included in the font.\n", - fname, bezdir); - LogMsg(globmsg, WARNING, OK, TRUE); - } - } - } - - AddCharListEntry(fname, fname, GetTotalInputDirs(), - GetHintsDir(), FALSE, FALSE, TRUE, FALSE); - sortcharlist(TRUE); - } - } - } - - return FALSE; - } - - if (charlist[i].composite) return FALSE; - - if (charlist[i].derived) { - sprintf(globmsg, - "File name: %s in %s directory\n" - " is the same as a derived file name.\n", - fname, bezdir); - LogMsg(globmsg, LOGERROR, OK, TRUE); - return TRUE; - } - - /**************************************************************************/ - /* don't worry about transitional */ - /**************************************************************************/ - if (!FileExists(filename, FALSE)) - return FALSE; /* Error msg will be issued in */ - /* CheckAllListInTable or checkcharlist. */ - charlist[i].inBezDir = TRUE; - return FALSE; -} - -extern void -ResetCharListBools(boolean firstTime, indx dirix) -/*****************************************************************************/ -/* This proc is called to compare the inBezDir and inCharTable booleans. */ -/* Its purpose is to ensure that only characters in every input directory */ -/* are put into the chartable. If a character is in the bez directory and */ -/* this is the first time thru then inCharTable will be set to true. */ -/* Subsequent calls must have both inBezDir and inCharTable true for */ -/* inCharTable to stay true. */ -/*****************************************************************************/ -{ - indx i; - - for (i = 0; i < clsize; i++) { - if (charlist[i].masters <= dirix) continue; - /* added for cube */ - if (charlist[i].inBezDir) { - if (!charlist[i].inCharTable && firstTime) - charlist[i].inCharTable = TRUE; - } else - charlist[i].inCharTable = FALSE; - - charlist[i].inBezDir = FALSE; - } -} - -extern void -FreeCharList() { - indx i; - for (i = 0; i < clsize; i++) { - if (charlist[i].filename != charlist[i].charname) { - if (charlist[i].charname) - UnallocateMem(charlist[i].charname); - } - - if (charlist[i].filename) - UnallocateMem(charlist[i].filename); - } - - UnallocateMem(charlist); - clsize = 0; -} diff --git a/c/autohint/autohintlib/source/bf/charlist.h b/c/autohint/autohintlib/source/bf/charlist.h deleted file mode 100644 index bc3d1214a..000000000 --- a/c/autohint/autohintlib/source/bf/charlist.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ - -extern void AddCharListEntry( - char *, char *, long, long, boolean, boolean, boolean, boolean); - -extern boolean CheckCharListEntry( - char *, char *, boolean, boolean, boolean, boolean, indx); - -extern boolean NameInCharList( - char *); - -extern indx FindCharListEntry( - char *); - -/* -extern void makecharlist( -boolean, boolean, char *, indx -);*/ - -extern void sortcharlist( - boolean); - -extern boolean CompareCharListToBez( - char *, boolean, indx, boolean); -/* -extern void CopyCharListToTable ( -void -);*/ - -extern void CheckAllListInTable( - boolean); - -extern void FreeCharList( - void); - -extern void ResetCharListBools( - boolean, indx); diff --git a/c/autohint/autohintlib/source/bf/charlistpriv.c b/c/autohint/autohintlib/source/bf/charlistpriv.c deleted file mode 100644 index f0a6e5fbf..000000000 --- a/c/autohint/autohintlib/source/bf/charlistpriv.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* This source file should contain any procedure(s) that are called - from AC. It should not contain calls to procedures implemented - in object files that are not bound into AC. */ - -#include "basic.h" -#include "bftoac.h" -#include "charlistpriv.h" - -long clsize = 0; -struct cl_elem *charlist = NULL; - -extern boolean ReadCharFileNames(fname, start) char *fname; -boolean *start; -{ - static indx i; - if (*start) { - i = 0; - *start = FALSE; - } - while (i < clsize) { - if (charlist[i].derived || charlist[i].composite) { - i++; - continue; - } - strcpy(fname, charlist[i].filename); - i++; - return TRUE; - } - return FALSE; -} diff --git a/c/autohint/autohintlib/source/bf/charlistpriv.h b/c/autohint/autohintlib/source/bf/charlistpriv.h deleted file mode 100644 index 745667ddd..000000000 --- a/c/autohint/autohintlib/source/bf/charlistpriv.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* The sole purpose of this interface is to define the types that are - needed by the two charlist*.c source files, but should not be - used outside them. The two source files were split so that just - the procedure(s) needed for AC were in one of them. */ - -typedef struct cl_elem { - char *charname; - char *filename; - boolean composite : 1, derived : 1, transitional : 1, - inCharTable : 1, inBezDir : 1; - short masters; /* number of masters for this char */ - short hintDir; /* which of the master dirs will be used for hints */ -} CL_ELEM; - -extern long clsize; -extern struct cl_elem *charlist; diff --git a/c/autohint/autohintlib/source/bf/charpath.c b/c/autohint/autohintlib/source/bf/charpath.c deleted file mode 100644 index 4e6c8d9fb..000000000 --- a/c/autohint/autohintlib/source/bf/charpath.c +++ /dev/null @@ -1,2341 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* charpath.c */ - -#include "machinedep.h" -#include "buildfont.h" -#include "bftoac.h" -#include "charpath.h" -#include "chartable.h" -#include "masterfont.h" -#include "opcodes.h" -#include "optable.h" -#include "hintfile.h" -#include "transitionalchars.h" - -extern double atan2(double, double); - -#define DEBUG_PCP 0 /* debug point closepath */ - -#define DMIN 50 /* device minimum (one-half of a device pixel) */ -#define MAINHINTS -1 -#define GROWBUFF 2048 /* Amount to grow output buffer, if necessary. */ -/* The following definitions are used when determining - if a hinting operator used the start, end, average or - flattened coordinate values. */ -/* Segments are numbered starting with 1. The "ghost" segment is 0. */ -#define STARTPT 0 -#define ENDPT 1 -#define AVERAGE 2 -#define CURVEBBOX 3 -#define FLATTEN 4 -#define GHOST 5 - -boolean flexexists; -extern boolean multiplemaster; -boolean cubeLibrary; -boolean bereallyQuiet = 1; -char *currentChar; /* name of the current char for error messages */ -extern boolean ReadCharFile(); - -#if !AC_C_LIB -static boolean firstMT; -#endif -static char *startbuff, **outbuff; -static short dirCount, byteCount, buffSize; -static PPathList pathlist = NULL; -static Cd *refPtArray = NULL; -static indx hintsdirIx; -static char outstr[100]; - -/* Prototypes */ -static void AddLine(indx, indx); -static boolean CheckFlexOK(indx); -static boolean ChangetoCurve(indx, indx); -static void CheckFlexValues(short *, indx, indx, boolean *, boolean *); -static void CheckForZeroLengthCP(void); -static void CheckHandVStem3(void); -static void CombinePaths(void); -static boolean CompareCharPaths(char *, boolean); -static void Ct(Cd, Cd, Cd, indx, short); -static boolean CurveBBox(indx, short, long, Fixed *); -static void FindHandVStem3(PHintElt *, indx, boolean *); -static void FreePathElements(indx, indx); -static void GetCoordFromType(short, CdPtr, indx, indx); -static long GetCPIx(indx, long); -static void GetEndPoint(indx, long, Fixed *, Fixed *); -static void GetEndPoints(indx, long, CdPtr, CdPtr); -static void GetFlexCoord(indx, indx, indx, CdPtr); -static void GetPathType(short, char *); -static short GetPointType(short, Fixed, long *); -static void GetRelPos(long, short, Fixed, CdPtr, CdPtr, Fixed *); -static void GetRelativePosition(Fixed, Fixed, Fixed, Fixed, Fixed, Fixed *); -static void Hvct(Cd, Cd, Cd, indx, short); -static void InconsistentPathType(char *, indx, short, short, indx); -static void InconsistentPointCount(char *, indx, int, int); -static void InsertHint(PHintElt, indx, short, short); -static void MtorDt(Cd, indx, short); -static void OptimizeCT(indx); -static void OptimizeMtorDt(indx, short *, boolean *, boolean *); -static void ReadHints(PHintElt, indx); -static int ReadandAssignHints(void); -static void ReadHorVStem3Values(indx, short, short, boolean *); -static void SetSbandWidth(char *, boolean, Transitions *, int); -static void Vhct(Cd, Cd, Cd, indx, short); -static void WriteFlex(indx); -static void WriteHints(indx); -static void WritePathElt(indx, indx, short, indx, short); -static void WriteSbandWidth(void); -static void WriteX(Fixed); -static void WriteY(Fixed); -static void WriteToBuffer(void); -static boolean ZeroLengthCP(indx, indx); - -#if AC_C_LIB -void GetMasterDirName(char *dirname, indx ix) { - if (dirname) - dirname[0] = '\0'; -} -#endif - -/* macros */ -#define FixShift (8) -#define IntToFix(i) ((long int)(i) << FixShift) -#define FRnd(x) ((long int)(((x) + (1 << 7)) & ~0xFFL)) -#define FTrunc8(x) ((long int)((x) >> 8)) -#define FIXED2FLOAT(x) ((float)((x) / 256.0)) -#define FixedToDouble(x) ((double)((x) / 256.0)) -#define Frac(x) ((x)&0xFFL) -#define FixOne (0x100L) -#define FixHalf (0x80L) -#define FixHalfMul(f) ((f) >> 1) -#define FixTwoMul(f) ((f) << 1) -#define TFMX(x) ((x)) -#define TFMY(y) (-(y)) -#define ITFMX(x) ((x)) -#define ITFMY(y) (-(y)) -#define WRTNUM(i) \ - { \ - sprintf(outstr, "%d ", (int)(i)); \ - WriteToBuffer(); \ - } -#define WriteStr(str) \ - { \ - sprintf(outstr, "%s ", (char *)str); \ - WriteToBuffer(); \ - } -#define WriteSubr(val) \ - { \ - sprintf(outstr, "%d subr ", val); \ - WriteToBuffer(); \ - } - -/* Checks if buffer needs to grow before writing out string. */ -static void WriteToBuffer() { - int len = (int)strlen(outstr); - - if ((byteCount + len) > buffSize) { - buffSize += GROWBUFF; -#if DOMEMCHECK - startbuff = (char *)memck_realloc(*outbuff, (buffSize * sizeof(char))); -#else - startbuff = (char *)ReallocateMem(*outbuff, - (unsigned)(buffSize * sizeof(char)), "file buffer"); -#endif - SetMaxBytes(buffSize); - *outbuff = startbuff; - startbuff += byteCount; - memset(startbuff, 0, GROWBUFF); - while (*startbuff == '\0') startbuff--; - startbuff++; - } - byteCount += len; - sprintf(startbuff, "%s", outstr); - startbuff += len; -} - -static void WriteX(x) - Fixed x; -{ - Fixed i = FRnd(x); - WRTNUM(FTrunc8(i)); -} - -static void WriteY(y) - Fixed y; -{ - Fixed i = FRnd(y); - WRTNUM(FTrunc8(i)); -} - -#define WriteCd(c) \ - { \ - WriteX(c.x); \ - WriteY(c.y); \ - } - -static void WriteOneHintVal(val) - Fixed val; -{ - if (Frac(val) == 0) - WRTNUM(FTrunc8(val)) - else { - WRTNUM(FTrunc8(FRnd(val * 100L))) - WriteStr("100 div "); - } -} - -/* Locates the first CP following the given path element. */ -static long GetCPIx(dirIx, pathIx) - indx dirIx; -long pathIx; -{ - indx ix; - - for (ix = pathIx; ix < path_entries; ix++) - if (pathlist[dirIx].path[ix].type == CP) - return ix; - sprintf(globmsg, "No closepath in character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - return (-1); -} - -/* Locates the first MT preceding the given path element. */ -static int GetMTIx(indx dirIx, indx pathIx) { - indx ix; - - for (ix = pathIx; ix >= 0; ix--) - if (pathlist[dirIx].path[ix].type == RMT) - return ix; - sprintf(globmsg, "No moveto in character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - return (-1); -} - -/* Locates the first MT SUCCEEDING the given path element. */ -static int GetNextMTIx(indx dirIx, indx pathIx) { - indx ix; - - for (ix = pathIx; ix < path_entries; ix++) - if (pathlist[dirIx].path[ix].type == RMT) - return ix; - return (-1); -} - -static void GetEndPoint(dirIx, pathIx, ptX, ptY) - indx dirIx; -long pathIx; -Fixed *ptX, *ptY; -{ - PCharPathElt pathElt = &pathlist[dirIx].path[pathIx]; - -retry: - switch (pathElt->type) { - case RMT: - case RDT: - *ptX = pathElt->x; - *ptY = pathElt->y; - break; - case RCT: - *ptX = pathElt->x3; - *ptY = pathElt->y3; - break; - case CP: - while (--pathIx >= 0) { - pathElt = &pathlist[dirIx].path[pathIx]; - if (pathElt->type == RMT) - goto retry; - } - sprintf(globmsg, "Bad character description file: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - default: - sprintf(globmsg, "Illegal operator in character file: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } -} - -static void GetEndPoints(dirIx, pathIx, start, end) - indx dirIx; -long pathIx; -Cd *start, *end; -{ - if (pathlist[dirIx].path[pathIx].type == RMT) { - long cpIx; - - GetEndPoint(dirIx, pathIx, &start->x, &start->y); - /* Get index for closepath associated with this moveto. */ - cpIx = GetCPIx(dirIx, pathIx + 1); - GetEndPoint(dirIx, cpIx - 1, &end->x, &end->y); - } else { - GetEndPoint(dirIx, pathIx - 1, &start->x, &start->y); - GetEndPoint(dirIx, pathIx, &end->x, &end->y); - } -} - -static void GetCoordFromType(short pathtype, CdPtr coord, - indx dirix, indx eltno) { - switch (pathtype) { - case RMT: - case RDT: - (*coord).x = FTrunc8(FRnd(pathlist[dirix].path[eltno].x)); - (*coord).y = FTrunc8(FRnd(pathlist[dirix].path[eltno].y)); - break; - case RCT: - (*coord).x = FTrunc8(FRnd(pathlist[dirix].path[eltno].x3)); - (*coord).y = FTrunc8(FRnd(pathlist[dirix].path[eltno].y3)); - break; - case CP: - GetCoordFromType(pathlist[dirix].path[eltno - 1].type, coord, dirix, eltno - 1); - break; - }; -} - -static void GetPathType(short pathtype, char *str) { - switch (pathtype) { - case RMT: - strcpy(str, "moveto"); - break; - case RDT: - strcpy(str, "lineto"); - break; - case RCT: - strcpy(str, "curveto"); - break; - case CP: - strcpy(str, "closepath"); - break; - default: - sprintf(globmsg, "Illegal path type: %d in character: %s.\n", pathtype, currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } -} - -static void FreePathElements(startix, stopix) - indx startix, - stopix; -{ - indx i, j; - - for (j = startix; j < stopix; j++) { - i = 0; -#if 0 - PHintElt hintElt, next; - if (pathlist[j].path != NULL) - { - /* Before we can free hint elements will need to know path_entries - value for char in each directory because this proc can be - called when characters are inconsistent. - */ - for (i = 0; i < path_entries; i++) - { - hintElt = pathlist[j].path[i].hints; - while (hintElt != NULL) - { - next = hintElt->next; -#if DOMEMCHECK - memck_free(hintElt); -#else - UnallocateMem(hintElt); -#endif - hintElt = next; - } - } - } -#endif -#if DOMEMCHECK - memck_free(pathlist[j].mainhints); - memck_free(pathlist[j].path); -#else - UnallocateMem(pathlist[j].mainhints); - UnallocateMem(pathlist[j].path); -#endif - } -} - -static void InconsistentPointCount(char *filename, indx ix, - int entries1, int entries2) { - char pathdir1[MAXPATHLEN], pathdir2[MAXPATHLEN]; - - GetMasterDirName(pathdir1, 0); - GetMasterDirName(pathdir2, ix); - sprintf(globmsg, "The character: %s will not be included in the font\n because the version in %s has a total of %d elements and\n the one in %s has %d elements.\n", filename, pathdir1, (int)entries1, pathdir2, (int)entries2); - LogMsg(globmsg, WARNING, OK, TRUE); -} - -static void InconsistentPathType(char *filename, indx ix, short type1, - short type2, indx eltno) { - char pathdir1[MAXPATHLEN], pathdir2[MAXPATHLEN]; - char typestr1[10], typestr2[10]; - Cd coord1, coord2; - - GetPathType(type1, typestr1); - GetPathType(type2, typestr2); - GetCoordFromType(type1, &coord1, 0, eltno); - GetCoordFromType(type2, &coord2, ix, eltno); - GetMasterDirName(pathdir1, 0); - GetMasterDirName(pathdir2, ix); - sprintf(globmsg, "The character: %s will not be included in the font\n because the version in %s has path type %s at coord: %d %d\n and the one in %s has type %s at coord %d %d.\n", - filename, pathdir1, typestr1, (int)coord1.x, (int)coord1.y, pathdir2, - typestr2, (int)coord2.x, (int)coord2.y); - LogMsg(globmsg, WARNING, OK, TRUE); -} - -/* Returns whether changing the line to a curve is successful. */ -static boolean ChangetoCurve(dirIx, pathIx) - indx dirIx, - pathIx; -{ - Cd start, end, ctl1, ctl2; - PCharPathElt pathElt = &pathlist[dirIx].path[pathIx]; - - if (pathElt->type == RCT) - return TRUE; - /* Use the 1/3 rule to convert a line to a curve, i.e. put the control points - 1/3 of the total distance from each end point. */ - GetEndPoints(dirIx, pathIx, &start, &end); - ctl1.x = FRnd((start.x * 2 + end.x + FixHalf) / 3); - ctl1.y = FRnd((start.y * 2 + end.y + FixHalf) / 3); - ctl2.x = FRnd((end.x * 2 + start.x + FixHalf) / 3); - ctl2.y = FRnd((end.y * 2 + start.y + FixHalf) / 3); - pathElt->type = RCT; - pathElt->x1 = ctl1.x; - pathElt->y1 = ctl1.y; - pathElt->x2 = ctl2.x; - pathElt->y2 = ctl2.y; - pathElt->x3 = end.x; - pathElt->y3 = end.y; - pathElt->rx1 = ctl1.x - start.x; - pathElt->ry1 = ctl1.y - start.y; - pathElt->rx2 = pathElt->x2 - pathElt->x1; - pathElt->ry2 = pathElt->y2 - pathElt->y1; - pathElt->rx3 = pathElt->x3 - pathElt->x2; - pathElt->ry3 = pathElt->y3 - pathElt->y2; - return TRUE; -} - -static boolean ZeroLengthCP(dirIx, pathIx) - indx dirIx, - pathIx; -{ - Cd startPt, endPt; - - GetEndPoints(dirIx, pathIx, &startPt, &endPt); - return (startPt.x == endPt.x && startPt.y == endPt.y); -} - -/* Subtracts or adds one unit from the segment at pathIx. */ -static void AddLine(dirIx, pathIx) - indx dirIx, - pathIx; -{ - Fixed fixTwo = IntToFix(2); - Fixed xoffset = 0, yoffset = 0; - Fixed xoffsetr = 0, yoffsetr = 0; - PCharPathElt start, end, thisone, nxtone; - char dirname[MAXPATHLEN]; - indx i, n; - - if (pathlist[dirIx].path[pathIx].type != RCT) { - if (!bereallyQuiet) { - GetMasterDirName(dirname, dirIx); - sprintf(globmsg, - "Please convert the point closepath in directory: %s, character: %s to a line closepath.\n", dirname, currentChar); - LogMsg(globmsg, WARNING, OK, TRUE); - } - return; - } - i = GetMTIx(dirIx, pathIx) + 1; - start = &pathlist[dirIx].path[i]; - end = &pathlist[dirIx].path[pathIx]; - /* Check control points to find out if x or y value should be adjusted - in order to get a smooth curve. */ - switch (start->type) { - case RDT: - if (!bereallyQuiet) { - GetMasterDirName(dirname, dirIx); - sprintf(globmsg, "Please convert the point closepath to a line closepath in directory: %s, character: %s.\n", dirname, currentChar); - LogMsg(globmsg, WARNING, OK, TRUE); - } - return; - break; - case RCT: - if ((ABS(start->x1 - end->x2) < fixTwo) && (ABS(start->x1 - pathlist[dirIx].path[i - 1].x) < fixTwo)) - yoffset = - (start->y1 < end->y2 && end->y2 > 0) || (start->y1 > end->y2 && end->y2 < 0) ? FixOne : -FixOne; - else if ((ABS(start->y1 - end->y2) < fixTwo) && (ABS(start->y1 - pathlist[dirIx].path[i - 1].y) < fixTwo)) - xoffset = - (start->x1 < end->x2 && end->x2 > 0) || (start->x1 > end->x2 && end->x2 < 0) ? FixOne : -FixOne; - else { - if (!bereallyQuiet) { - GetMasterDirName(dirname, dirIx); - sprintf(globmsg, "Could not modify point closepath in directory '%s', character: %s near (%ld, %ld).\n", dirname, currentChar, FTrunc8(end->x), FTrunc8(end->y)); - LogMsg(globmsg, WARNING, OK, TRUE); - } - return; - } - break; - default: - GetMasterDirName(dirname, dirIx); - sprintf(globmsg, "Bad character description file: %s/%s.\n", dirname, currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - - thisone = &(pathlist[dirIx].path[pathIx]); - thisone->x3 += xoffset; - xoffsetr = (xoffset == 0) ? 0 : ((thisone->rx3 < 0) ? FixOne : -FixOne); - thisone->rx3 += xoffsetr; - - thisone->y3 += yoffset; - yoffsetr = (yoffset == 0) ? 0 : ((thisone->ry3 < 0) ? FixOne : -FixOne); - thisone->ry3 += yoffsetr; - - /* Now, fix up the following MT's rx1, ry1 values - This fixes a LOOOONG-standing bug. renner Wed Jul 16 09:33:50 1997*/ - if ((n = GetNextMTIx(dirIx, pathIx)) > 0) { - nxtone = &(pathlist[dirIx].path[n]); - nxtone->rx += (-xoffsetr); - nxtone->ry += (-yoffsetr); - } -} - -#define PI 3.1415926535 -static void BestLine(PCharPathElt start, PCharPathElt end, Fixed *dx, Fixed *dy) { - double angle; - /* control point differences */ - double cx = FixedToDouble(end->x2 - end->x3); - double cy = FixedToDouble(end->y2 - end->y3); - - *dx = *dy = 0; - - if (cy == 0.0 && cx == 0.0) { -#if DEBUG_PCP - fprintf(OUTPUTBUFF, " cx=%f cy=%f ***\n", cx, cy); -#endif /*DEBUG_PCP*/ - sprintf(globmsg, "Unexpected tangent in character path: %s.\n", currentChar); - LogMsg(globmsg, WARNING, OK, TRUE); - return; - } - - angle = atan2(cy, cx); -#if DEBUG_PCP - fprintf(OUTPUTBUFF, " cx=%f cy=%f theta=%f %.0f deg\n", cx, cy, angle, angle / PI * 180.); -#endif /*DEBUG_PCP*/ - -#if FOUR_WAY - /* Judy's non-Cube code only moves vertically or horizontally. */ - /* This code produces similar results. */ - if (angle < (-PI * 0.75)) { - *dx = -FixOne; - } else if (angle < (-PI * 0.25)) { - *dy = -FixOne; - } else if (angle < (PI * 0.25)) { - *dx = FixOne; - } else if (angle < (PI * 0.75)) { - *dy = FixOne; - } else { - *dx = -FixOne; - } -#else /*FOUR_WAY*/ - - if (angle < (-PI * 0.875)) { - *dx = -FixOne; - } else if (angle < (-PI * 0.625)) { - *dy = -FixOne; - *dx = -FixOne; - } else if (angle < (-PI * 0.375)) { - *dy = -FixOne; - } else if (angle < (-PI * 0.125)) { - *dy = -FixOne; - *dx = FixOne; - } else if (angle < (PI * 0.125)) { - *dx = FixOne; - } else if (angle < (PI * 0.375)) { - *dx = FixOne; - *dy = FixOne; - } else if (angle < (PI * 0.625)) { - *dy = FixOne; - } else if (angle < (PI * 0.875)) { - *dy = FixOne; - *dx = -FixOne; - } else { - *dx = -FixOne; - } -#endif /*FOUR_WAY*/ -} - -/* CUBE VERSION 17-Apr-94 jvz */ -/* Curves: subtracts or adds one unit from the segment at pathIx. */ -/* Lines: flags the segment at pathIx to be removed later; CP follows it. */ -static void AddLineCube(indx dirIx, indx pathIx) { - /* Path element types have already been coordinated by ChangeToCurve. */ - /* Hints are only present in the hintsdirIx. */ - - if (pathlist[dirIx].path[pathIx].type == RDT) { - pathlist[dirIx].path[pathIx].remove = TRUE; - if (pathlist[dirIx].path[pathIx + 1].type != CP) { - sprintf(globmsg, "Expected CP in path: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - - /* If there's another path in the character, we need to compensate */ - /* because CP does not update currentpoint. */ - - if (pathIx + 2 < path_entries) { - if (pathlist[dirIx].path[pathIx + 2].type == RMT) { - pathlist[dirIx].path[pathIx + 2].rx += pathlist[dirIx].path[pathIx].rx; - pathlist[dirIx].path[pathIx + 2].ry += pathlist[dirIx].path[pathIx].ry; - } else { - sprintf(globmsg, "Expected second RMT in path: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } - -#if DEBUG_PCP - if (dirIx == 0) - fprintf(OUTPUTBUFF, " RDT\n"); -#endif /*DEBUG_PCP*/ - - } else if (pathlist[dirIx].path[pathIx].type == RCT) { - Fixed dx = 0; - Fixed dy = 0; - PCharPathElt start; - PCharPathElt end; - indx mt; /* index of the moveto preceding this path */ - -#if DEBUG_PCP - if (dirIx == 0) - fprintf(OUTPUTBUFF, " RCT\n"); -#endif /*DEBUG_PCP*/ - - mt = GetMTIx(dirIx, pathIx); - start = &pathlist[dirIx].path[mt + 1]; - end = &pathlist[dirIx].path[pathIx]; - - /* find nearest grid point we can move to */ - BestLine(start, end, &dx, &dy); - -#if DEBUG_PCP - fprintf(OUTPUTBUFF, " dx %d dy %d\n", FTrunc8(dx), FTrunc8(dy)); -#endif /*DEBUG_PCP*/ - - /* note that moving rx2, ry2 will also move rx3, ry3 */ - pathlist[dirIx].path[pathIx].x2 += dx; - pathlist[dirIx].path[pathIx].x3 += dx; - pathlist[dirIx].path[pathIx].rx2 += dx; - - pathlist[dirIx].path[pathIx].y2 += dy; - pathlist[dirIx].path[pathIx].y3 += dy; - pathlist[dirIx].path[pathIx].ry2 += dy; - } else { - /* Not a RCT or RDT - error - unexpected path element type. */ - sprintf(globmsg, "Bad character description file: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } -} - -/* - Look for zero length closepaths. If true then add a small - one unit line to each design. Because blending can cause - small arithmetic errors at each point in the path the - accumulation of such errors might cause the path to not end - up at the same point where it started. This can cause a sharp - angle segment that may cause spike problems in old rasterizers, - and in the qreducer (used for filling very large size characters). - The one unit line, which is drawn by the closepath, takes up the - slack for the arithmetic errors and avoids the spike problem. - */ -static void CheckForZeroLengthCP() { - indx ix, pathIx; - - for (ix = 0; ix < dirCount; ix++) { - for (pathIx = 0; pathIx < path_entries; pathIx++) { - if (pathlist[ix].path[pathIx].type == CP && ZeroLengthCP(ix, pathIx)) { - if (cubeLibrary) - AddLineCube(ix, pathIx - 1); - else - AddLine(ix, pathIx - 1); - } - } - } -} - -typedef struct path_names_ { - char dirnam[MAXPATHLEN]; - char fullfilepath[MAXPATHLEN]; -} Path_Name_; - -#if !IS_LIB -static Path_Name_ Path_Names[MAXDESIGNS]; -#else -static Path_Name_ Path_Names[1]; -#endif - -/* Checks that character paths for multiple masters have the same - number of points and in the same path order. If this isn't the - case the character is not included in the font. */ -static boolean CompareCharPaths(char *filename, boolean fortransitionals) { - indx dirix, ix, i; - long totalPathElt, minPathLen; - boolean ok = TRUE; - short type1, type2; - - totalPathElt = minPathLen = MAXINT; - if (pathlist == NULL) { -#if DOMEMCHECK - pathlist = (PPathList)memck_malloc(MAXDESIGNS * sizeof(PathList)); -#else - pathlist = (PPathList)AllocateMem( - (unsigned int)MAXDESIGNS /*dirCount*/, - sizeof(PathList), - "character path list"); -#endif - } - - for (dirix = 0; dirix < dirCount; dirix++) { -#if OLD - SetMasterDir(dirix); - SetReadFileName(filename); - setPrefix(bezdir); -#else - SetReadFileName(Path_Names[dirix].fullfilepath); -#endif - ResetMaxPathEntries(); - SetCurrPathList(&pathlist[dirix]); - path_entries = 0; - - /* read hints from special file if it exists */ - if (hintsdirIx == dirix) { - char hintFileName[MAXPATHLEN]; - sprintf(hintFileName, "%s/hints/%s", Path_Names[dirix].dirnam, filename); - if (FileExists(hintFileName, FALSE)) { - if (!ReadCharFile(TRUE, TRUE, FALSE, FALSE)) - return FALSE; -#if !AC_C_LIB - if (!ReadHintsFile(hintFileName, &pathlist[dirix])) -#endif - return FALSE; - - } else { - /* read char data and hints from bez file */ - if (!ReadCharFile(TRUE, TRUE, addHints, FALSE)) - return FALSE; - } - } else { - /* read char data only */ - if (!ReadCharFile(TRUE, TRUE, FALSE, FALSE)) - return FALSE; - } - - if (dirix == 0) - totalPathElt = path_entries; - else if (path_entries != totalPathElt) { - InconsistentPointCount(filename, dirix, totalPathElt, path_entries); - ok = FALSE; - } - minPathLen = NUMMIN(NUMMIN(path_entries, totalPathElt), minPathLen); - } - - for (dirix = 1; dirix < dirCount; dirix++) { - for (i = 0; i < minPathLen; i++) { - if ((type1 = pathlist[0].path[i].type) != (type2 = pathlist[dirix].path[i].type)) { - if ((type1 == RDT) && (type2 == RCT)) { /* Change this element in all previous directories to a curve. */ - ix = dirix - 1; - do { - ok = ok && ChangetoCurve(ix, i); - ix--; - } while (ix >= 0); - } else if ((type1 == RCT) && (type2 == RDT)) - ok = ok && ChangetoCurve(dirix, i); - else { - InconsistentPathType(filename, dirix, - pathlist[0].path[i].type, pathlist[dirix].path[i].type, i); - ok = FALSE; - /* skip to next subpath */ - while (++i < minPathLen && (pathlist[0].path[i].type != CP)) - ; - } - } - } - } - return ok; -} - -static void SetSbandWidth(char *charname, boolean fortransit, Transitions *trptr, int trgroupnum) { -#if !AC_C_LIB - short width; - Bbox bbox; -#endif - indx dirix; - - for (dirix = 0; dirix < dirCount; dirix++) { - if (fortransit) { - pathlist[dirix].sb = trptr->transitgrouparray[trgroupnum].assembled_sb[dirix]; - pathlist[dirix].width = trptr->transitgrouparray[trgroupnum].assembled_width[dirix]; - } else { -#if AC_C_LIB - pathlist[dirix].sb = 0; - pathlist[dirix].width = 1000; - -#else - GetWidthandBbox(charname, &width, &bbox, FALSE, dirix); - pathlist[dirix].sb = bbox.llx; - pathlist[dirix].width = width; -#endif - } - } -} - -static void WriteSbandWidth() { - short subrix, length, opcount = GetOperandCount(SBX); - indx ix, j, startix = 0; - boolean writeSubrOnce, sbsame = TRUE, wsame = TRUE; - - for (ix = 1; ix < dirCount; ix++) { - sbsame = sbsame && (pathlist[ix].sb == pathlist[ix - 1].sb); - wsame = wsame && (pathlist[ix].width == pathlist[ix - 1].width); - } - if (sbsame && wsame) { - sprintf(outstr, "%ld %d ", pathlist[0].sb, pathlist[0].width); - WriteToBuffer(); - } else if (sbsame) { - sprintf(outstr, "%ld ", pathlist[0].sb); - WriteToBuffer(); - for (j = 0; j < dirCount; j++) { - sprintf(outstr, "%d ", - (j == 0) ? pathlist[j].width : pathlist[j].width - pathlist[0].width); - WriteToBuffer(); - } - GetLengthandSubrIx(1, &length, &subrix); - WriteSubr(subrix); - } else if (wsame) { - for (j = 0; j < dirCount; j++) { - sprintf(outstr, "%ld ", - (j == 0) ? pathlist[j].sb : pathlist[j].sb - pathlist[0].sb); - WriteToBuffer(); - } - GetLengthandSubrIx(1, &length, &subrix); - WriteSubr(subrix); - sprintf(outstr, "%d ", pathlist[0].width); - WriteToBuffer(); - } else { - GetLengthandSubrIx(opcount, &length, &subrix); - if ((writeSubrOnce = (length == opcount))) { - sprintf(outstr, "%ld %d ", pathlist[0].sb, pathlist[0].width); - WriteToBuffer(); - length = startix = 1; - } - for (ix = 0; ix < opcount; ix += length) { - for (j = startix; j < dirCount; j++) { - sprintf(outstr, "%ld ", (ix == 0) ? (j == 0) ? pathlist[j].sb : pathlist[j].sb - pathlist[0].sb : (j == 0) ? (long int)pathlist[j].width : (long int)(pathlist[j].width - pathlist[0].width)); - WriteToBuffer(); - } - if (!writeSubrOnce || (ix == (opcount - 1))) - WriteSubr(subrix); - } - } - WriteStr("sbx\n"); -} - -static boolean CurveBBox(indx dirIx, short hinttype, long pathIx, Fixed *value) { - Cd startPt, endPt; - Fixed llx, lly, urx, ury, minval, maxval; - Fixed p1, p2, *minbx, *maxbx; - CharPathElt pathElt; - - *value = IntToFix(10000); - pathElt = pathlist[dirIx].path[pathIx]; - GetEndPoints(dirIx, pathIx, &startPt, &endPt); - switch (hinttype) { - case RB: - case RV + ESCVAL: - minval = TFMY(NUMMIN(startPt.y, endPt.y)); - maxval = TFMY(NUMMAX(startPt.y, endPt.y)); - p1 = TFMY(pathElt.y1); - p2 = TFMY(pathElt.y2); - minbx = &lly; - maxbx = &ury; - break; - case RY: - case RM + ESCVAL: - minval = TFMX(NUMMIN(startPt.x, endPt.x)); - maxval = TFMX(NUMMAX(startPt.x, endPt.x)); - p1 = TFMX(pathElt.x1); - p2 = TFMX(pathElt.x2); - minbx = &llx; - maxbx = &urx; - break; - default: - sprintf(globmsg, "Illegal hint type in character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if (p1 - maxval >= FixOne || p2 - maxval >= FixOne || - p1 - minval <= FixOne || p2 - minval <= FixOne) { - /* Transform coordinates so I get the same value that AC would give. */ - FindCurveBBox(TFMX(startPt.x), TFMY(startPt.y), TFMX(pathElt.x1), TFMY(pathElt.y1), - TFMX(pathElt.x2), TFMY(pathElt.y2), TFMX(endPt.x), TFMY(endPt.y), - &llx, &lly, &urx, &ury); - if (*maxbx > maxval || minval > *minbx) { - if (minval - *minbx > *maxbx - maxval) - *value = (hinttype == RB || hinttype == RV + ESCVAL) ? ITFMY(*minbx) : ITFMX(*minbx); - else - *value = (hinttype == RB || hinttype == RV + ESCVAL) ? ITFMY(*maxbx) : ITFMX(*maxbx); - return TRUE; - } - } - return FALSE; -} -#if __CENTERLINE__ -static char *_HintType_(int typ) { - switch (typ) { - case GHOST: - return ("Ghost"); - break; - case AVERAGE: - return ("Average"); - break; - case CURVEBBOX: - return ("Curvebbox"); - break; - case ENDPT: - return ("Endpt"); - break; - case STARTPT: - return ("Startpt"); - break; - case FLATTEN: - return ("Flatten"); - break; - } - return ("Unknown"); -} -static char *_HintKind_(int hinttype) { - switch (hinttype) { - case RB: - return ("RB"); - break; - case RV + ESCVAL: - return ("RV"); - break; - case RY: - return ("RY"); - break; - case RM + ESCVAL: - return ("RM"); - break; - } - return ("??"); -} -static char *_elttype_(int indx) { - switch (pathlist[hintsdirIx].path[indx].type) { - case RMT: - return ("Moveto"); - break; - case RDT: - return ("Lineto"); - break; - case RCT: - return ("Curveto"); - break; - case CP: - return ("Closepath"); - break; - } - return ("Unknown"); -} - -#endif - -static boolean nearlyequal_(Fixed a, Fixed b, Fixed tolerance) { - return (ABS(a - b) <= tolerance); -} - -/* Returns whether the hint values are derived from the start, - average, end or flattened curve with an inflection point of - the specified path element. Since path element numbers in - character files start from one and the path array starts - from zero we need to subtract one from the path index. */ -static short GetPointType(short hinttype, Fixed value, long *pathEltIx) { - Cd startPt, endPt; - Fixed startval, endval, loc; - short pathtype; - boolean tryAgain = TRUE; - long pathIx = *pathEltIx - 1; - -#if __CENTERLINE__ - if (TRACE) { - fprintf(stderr, "Enter GetPointType: Hinttype=%s @(%.2f) curr patheltix=%d pathIx=%d <%s>", _HintKind_(hinttype), FIXED2FLOAT(value), *pathEltIx, pathIx, _elttype_(pathIx)); - } -#endif - -retry: - GetEndPoints(hintsdirIx, pathIx, &startPt, &endPt); - switch (hinttype) { - case RB: - case RV + ESCVAL: - startval = startPt.y; - endval = endPt.y; -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, "Startval Y=%.2f EndVal Y=%.2f ", FIXED2FLOAT(startval), FIXED2FLOAT(endval)); -#endif - break; - case RY: - case RM + ESCVAL: - startval = startPt.x; - endval = endPt.x; -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, "Startval X=%.2f EndVal X=%.2f ", FIXED2FLOAT(startval), FIXED2FLOAT(endval)); -#endif - break; - default: - sprintf(globmsg, "Illegal hint type in character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - - /* Check for exactly equal first, in case endval = startval + 1. jvz 1nov95 */ - /* Certain cases are still ambiguous. */ - - if (value == startval) { -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, "==> StartPt\n"); -#endif - return STARTPT; - } else if (value == endval) { -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, "==> EndPt\n"); -#endif - return ENDPT; - } else if (nearlyequal_(value, startval, FixOne)) { -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, "==> ~StartPt\n"); -#endif - return STARTPT; - } else if (nearlyequal_(value, endval, FixOne)) { -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, "==> ~EndPt\n"); -#endif - return ENDPT; - } else if (value == (loc = FixHalfMul(startval + endval)) || - nearlyequal_(value, loc, FixOne)) { -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, "==> Average\n"); -#endif - return AVERAGE; - } - - pathtype = pathlist[hintsdirIx].path[pathIx].type; - if (tryAgain && (pathIx + 1 < path_entries) && (pathtype != CP)) { /* try looking at other end of line or curve */ - pathIx++; - *pathEltIx += 1; - tryAgain = FALSE; -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, " (Retry w/PathEltix=%d) ", *pathEltIx); -#endif - goto retry; - } - if (!tryAgain) /* reset pathEltIx to original value */ { - *pathEltIx -= 1; -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, " (reset PathEltix to %d) ", *pathEltIx); -#endif - } - if (CurveBBox(hintsdirIx, hinttype, *pathEltIx - 1, &loc) && - nearlyequal_(value, loc, FixOne)) { -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, "==> Curvebbox\n"); -#endif - return CURVEBBOX; - } -#if __CENTERLINE__ - if (TRACE) fprintf(stderr, "==> Flatten fallout\n"); -#endif - return FLATTEN; -} - -static void GetRelPos(long pathIx, short hinttype, Fixed hintVal, - CdPtr startPt, CdPtr endPt, Fixed *val) { - Cd origStart, origEnd; - - GetEndPoints(hintsdirIx, pathIx, &origStart, &origEnd); - if (hinttype == RB || hinttype == (RV + ESCVAL)) - GetRelativePosition(endPt->y, startPt->y, origEnd.y, origStart.y, hintVal, val); - else - GetRelativePosition(endPt->x, startPt->x, origEnd.x, origStart.x, hintVal, val); -} - -/* Calculates the relative position of hintVal between its endpoints and - gets new hint value between currEnd and currStart. */ -static void GetRelativePosition(currEnd, currStart, end, start, hintVal, fixedRelValue) - Fixed currEnd, - currStart, end, start, hintVal, *fixedRelValue; -{ - float relVal; - - if ((end - start) == 0) - *fixedRelValue = (Fixed)LROUND((float)(hintVal - start) + currStart); - else { - relVal = (float)(hintVal - start) / (float)(end - start); - *fixedRelValue = (Fixed)LROUND(((currEnd - currStart) * relVal) + currStart); - } -} - -/* For each base design, excluding HintsDir, include the - hint information at the specified path element. type1 - and type2 indicates whether to use the start, end, avg., - curvebbox or flattened curve. If a curve is to be flattened - check if this is an "s" curve and use the inflection point. If not - then use the same relative position between the two endpoints as - in the main hints dir. - hinttype is either RB, RY, RM or RV. pathEltIx - is the index into the path array where the new hint should - be stored. pathIx is the index of the path segment used to - calculate this particular hint. */ -static void InsertHint(PHintElt currHintElt, indx pathEltIx, - short type1, short type2) { - indx ix, j; - Cd startPt, endPt; - PHintElt *hintElt, newEntry; - CharPathElt pathElt; - long pathIx; - short pathtype, hinttype = currHintElt->type; - Fixed *value, ghostVal, tempVal; - -#if __CENTERLINE__ - if (TRACE) { - fprintf(stderr, "InsertHint: "); - fprintf(stderr, "Type1=%s Type2=%s", _HintType_(type1), _HintType_(type2)); - fprintf(stderr, " PathEltIndex= "); - if (pathEltIx == MAINHINTS) { - fprintf(stderr, "MainHints "); - } else { - Fixed tx, ty; - fprintf(stderr, "%d ", pathEltIx); - if (type1 != GHOST) { - GetEndPoint(hintsdirIx, currHintElt->pathix1 - 1, &tx, &ty); - fprintf(stderr, "Start attached to (%.2f %.2f)", FIXED2FLOAT(tx), FIXED2FLOAT(ty)); - } - if (type2 != GHOST) { - GetEndPoint(hintsdirIx, currHintElt->pathix2 - 1, &tx, &ty); - fprintf(stderr, "End attached to (%.2f %.2f)", FIXED2FLOAT(tx), FIXED2FLOAT(ty)); - } - } - fprintf(stderr, "\n"); - } -#endif - - if (type1 == GHOST || type2 == GHOST) - /* ghostVal should be -20 or -21 */ - ghostVal = currHintElt->rightortop - currHintElt->leftorbot; - for (ix = 0; ix < dirCount; ix++) { - if (ix == hintsdirIx) - continue; -#if DOMEMCHECK - newEntry = (PHintElt)memck_malloc(sizeof(HintElt)); -#else - newEntry = (PHintElt)AllocateMem(1, sizeof(HintElt), "hint element"); -#endif - newEntry->type = hinttype; - hintElt = - (pathEltIx == MAINHINTS ? &pathlist[ix].mainhints : &pathlist[ix].path[pathEltIx].hints); - while (*hintElt != NULL && (*hintElt)->next != NULL) - hintElt = &(*hintElt)->next; - if (*hintElt == NULL) - *hintElt = newEntry; - else - (*hintElt)->next = newEntry; - for (j = 0; j < 2; j++) { - pathIx = (j == 0 ? currHintElt->pathix1 - 1 : currHintElt->pathix2 - 1); - pathtype = (j == 0 ? type1 : type2); - value = (j == 0 ? &newEntry->leftorbot : &newEntry->rightortop); - if (pathtype != GHOST) - GetEndPoints(ix, pathIx, &startPt, &endPt); - switch (pathtype) { - case AVERAGE: - *value = ((hinttype == RB || hinttype == (RV + ESCVAL)) ? FixHalfMul(startPt.y + endPt.y) : FixHalfMul(startPt.x + endPt.x)); - break; - case CURVEBBOX: - if (!CurveBBox(ix, hinttype, pathIx, value)) { - GetRelPos(pathIx, hinttype, - ((j == 0) ? currHintElt->leftorbot : currHintElt->rightortop), - &startPt, &endPt, &tempVal); - *value = FRnd(tempVal); - } - break; - case ENDPT: - *value = ((hinttype == RB || hinttype == (RV + ESCVAL)) ? endPt.y : endPt.x); - break; - case FLATTEN: - pathElt = pathlist[ix].path[pathIx]; - if (pathElt.type != RCT) { - sprintf(globmsg, "Malformed path list: %s, dir: %d, element: %ld != RCT.\n", - currentChar, ix, pathIx); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if (!GetInflectionPoint(startPt.x, startPt.y, pathElt.x1, pathElt.y1, - pathElt.x2, pathElt.y2, pathElt.x3, pathElt.y3, value)) { /* no flat spot found */ - /* Get relative position of value in currHintElt. */ - GetRelPos(pathIx, hinttype, - ((j == 0) ? currHintElt->leftorbot : currHintElt->rightortop), - &startPt, &endPt, &tempVal); - *value = FRnd(tempVal); - } - break; - case GHOST: - if (j == 1) - *value = newEntry->leftorbot + ghostVal; - break; - case STARTPT: - *value = ((hinttype == RB || hinttype == (RV + ESCVAL)) ? startPt.y : startPt.x); - break; - default: - sprintf(globmsg, "Illegal point type in character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - /* Assign correct value for bottom band if first path element - is a ghost band. */ - if (j == 1 && type1 == GHOST) - newEntry->leftorbot = newEntry->rightortop - ghostVal; - } - } -} - -static void ReadHints(hintElt, pathEltIx) - PHintElt hintElt; -indx pathEltIx; -{ - PHintElt currElt = hintElt; - short pointtype1, pointtype2; - - while (currElt != NULL) { - if (currElt->pathix1 != 0) - pointtype1 = - GetPointType(currElt->type, currElt->leftorbot, &(currElt->pathix1)); - else - pointtype1 = GHOST; - if (currElt->pathix2 != 0) - pointtype2 = - GetPointType(currElt->type, currElt->rightortop, &(currElt->pathix2)); - else - pointtype2 = GHOST; - InsertHint(currElt, pathEltIx, pointtype1, pointtype2); - currElt = currElt->next; - } -} - -/* Reads hints from hints directory path list and assigns corresponding - hints to other designs. */ -static int ReadandAssignHints() { - indx ix; - - /* Check for main hints first, i.e. global to character. */ - if (pathlist[hintsdirIx].mainhints != NULL) - ReadHints(pathlist[hintsdirIx].mainhints, MAINHINTS); - /* Now check for local hint values. */ - for (ix = 0; ix < path_entries; ix++) { - if (pathlist[hintsdirIx].path == NULL) - return 1; - if (pathlist[hintsdirIx].path[ix].hints != NULL) - ReadHints(pathlist[hintsdirIx].path[ix].hints, ix); - } - return 0; -} - -static boolean DoubleCheckFlexVals(dirnum, eltix, hintdirnum) - indx dirnum, - eltix, hintdirnum; -{ - boolean vert = (pathlist[hintdirnum].path[eltix].x == pathlist[hintdirnum].path[eltix + 1].x3); - if (vert) { - return (pathlist[dirnum].path[eltix].x == pathlist[dirnum].path[eltix + 1].x3); - } else { - return (pathlist[dirnum].path[eltix].y == pathlist[dirnum].path[eltix + 1].y3); - } -} - -static boolean CheckFlexOK(ix) - indx ix; -{ - indx i; - boolean flexOK = pathlist[hintsdirIx].path[ix].isFlex; - PCharPathElt end; - char pathdir[MAXPATHLEN]; - - for (i = 0; i < dirCount; i++) { - if (i == hintsdirIx) continue; - if (flexOK && (!pathlist[i].path[ix].isFlex)) { - if (!DoubleCheckFlexVals(i, ix, hintsdirIx)) { - end = &pathlist[i].path[ix]; - GetMasterDirName(pathdir, i); - sprintf(globmsg, "Flex will not be included in character: %s in '%s' at element %d near (%ld, %ld) because the character does not have flex in each design.\n", currentChar, pathdir, (int)ix, FTrunc8(end->x), FTrunc8(end->y)); - LogMsg(globmsg, WARNING, OK, TRUE); - return FALSE; - } else { - pathlist[i].path[ix].isFlex = flexOK; - } - } - } - return flexOK; -} - -static void OptimizeCT(ix) - indx ix; -{ - short newtype; - boolean vhct = TRUE, hvct = TRUE; - indx i; - - for (i = 0; i < dirCount; i++) - if (pathlist[i].path[ix].rx1 != 0 || pathlist[i].path[ix].ry3 != 0) { - vhct = FALSE; - break; - } - for (i = 0; i < dirCount; i++) - if (pathlist[i].path[ix].ry1 != 0 || pathlist[i].path[ix].rx3 != 0) { - hvct = FALSE; - break; - } - if (vhct) - newtype = VHCT; - else if (hvct) - newtype = HVCT; - if (vhct || hvct) - for (i = 0; i < dirCount; i++) - pathlist[i].path[ix].type = newtype; -} - -static void MtorDt(Cd coord, indx startix, short length) { - if (length == 2) { - WriteCd(coord); - } else if (startix == 0) - WriteX(coord.x); - else - WriteY(coord.y); -} - -static void Hvct(Cd coord1, Cd coord2, Cd coord3, indx startix, short length) { - indx ix; - indx lastix = startix + length; - - for (ix = startix; ix < lastix; ix++) - switch (ix) { - case 0: - WriteX(coord1.x); - break; - case 1: - WriteX(coord2.x); - break; - case 2: - WriteY(coord2.y); - break; - case 3: - WriteY(coord3.y); - break; - default: - sprintf(globmsg, "Invalid index value: %d defined for curveto command1 in character: %s.\n", (int)ix, currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } -} - -static void Vhct(Cd coord1, Cd coord2, Cd coord3, indx startix, short length) { - indx ix; - indx lastix = startix + length; - - for (ix = startix; ix < lastix; ix++) - switch (ix) { - case 0: - WriteY(coord1.y); - break; - case 1: - WriteX(coord2.x); - break; - case 2: - WriteY(coord2.y); - break; - case 3: - WriteX(coord3.x); - break; - default: - sprintf(globmsg, "Invalid index value: %d defined for curveto command2 in character:%s.\n", (int)ix, currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } -} - -/* length can only be 1, 2, 3 or 6 */ -static void Ct(Cd coord1, Cd coord2, Cd coord3, indx startix, short length) { - indx ix; - indx lastix = startix + length; - - for (ix = startix; ix < lastix; ix++) - switch (ix) { - case 0: - WriteX(coord1.x); - break; - case 1: - WriteY(coord1.y); - break; - case 2: - WriteX(coord2.x); - break; - case 3: - WriteY(coord2.y); - break; - case 4: - WriteX(coord3.x); - break; - case 5: - WriteY(coord3.y); - break; - default: - sprintf(globmsg, "Invalid index value: %d defined for curveto command3 in character: %s.\n", (int)ix, currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } -} - -static void ReadHorVStem3Values(indx pathIx, short eltno, short hinttype, - boolean *errormsg) { - indx ix; - PHintElt *hintElt; - short count, newhinttype; - boolean ok = TRUE; - Fixed min, dmin, mid, dmid, max, dmax; - char dirname[MAXPATHLEN]; - - for (ix = 0; ix < dirCount; ix++) { - count = 1; - if (ix == hintsdirIx) - continue; - GetMasterDirName(dirname, ix); - hintElt = (pathIx == MAINHINTS ? &pathlist[ix].mainhints : &pathlist[ix].path[pathIx].hints); - /* Find specified hint element. */ - while (*hintElt != NULL && count != eltno) { - hintElt = &(*hintElt)->next; - count++; - } - /* Check that RM or RV type is in pairs of threes. */ - if (*hintElt == NULL || (*hintElt)->next == NULL || (*hintElt)->next->next == NULL) { - sprintf(globmsg, "Invalid format for hint operator: hstem3 or vstem3 in character: %s/%s.\n", dirname, currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if ((*hintElt)->type != hinttype || (*hintElt)->next->type != hinttype || (*hintElt)->next->next->type != hinttype) { - sprintf(globmsg, "Invalid format for hint operator: hstem3 or vstem3 in character: %s in '%s'.\n", currentChar, dirname); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - min = (*hintElt)->leftorbot; - dmin = (*hintElt)->rightortop - min; - mid = (*hintElt)->next->leftorbot; - dmid = (*hintElt)->next->rightortop - mid; - max = (*hintElt)->next->next->leftorbot; - dmax = (*hintElt)->next->next->rightortop - max; - /* Check that counters are the same width and stems are the same width. */ - if (dmin != dmax || - (((mid + dmid / 2) - (min + dmin / 2)) != ((max + dmax / 2) - (mid + dmid / 2)))) { - ok = FALSE; - break; - } - } - if (!ok) { /* change RM's to RY's or RV's to RB's for this element in each directory */ - newhinttype = (hinttype == (RM + ESCVAL) ? RY : RB); - if (*errormsg) { - sprintf(globmsg, "Near miss for using operator: %s in character: %s in '%s'. (min=%ld..%ld[delta=%ld], mid=%ld..%ld[delta=%ld], max=%ld..%ld[delta=%ld])\n", - (hinttype == (RM + ESCVAL)) ? "vstem3" : "hstem3", - currentChar, dirname, - FTrunc8((*hintElt)->leftorbot), FTrunc8((*hintElt)->rightortop), FTrunc8((*hintElt)->rightortop - (*hintElt)->leftorbot), - FTrunc8((*hintElt)->next->leftorbot), FTrunc8((*hintElt)->next->rightortop), FTrunc8((*hintElt)->next->rightortop - (*hintElt)->next->leftorbot), - FTrunc8((*hintElt)->next->next->leftorbot), FTrunc8((*hintElt)->next->next->rightortop), FTrunc8((*hintElt)->next->next->rightortop - (*hintElt)->next->next->leftorbot)); - LogMsg(globmsg, WARNING, OK, TRUE); - *errormsg = FALSE; - } - for (ix = 0; ix < dirCount; ix++) { - count = 1; - hintElt = (pathIx == MAINHINTS ? &pathlist[ix].mainhints : &pathlist[ix].path[pathIx].hints); - /* Find specified hint element. */ - while (*hintElt != NULL && count != eltno) { - hintElt = &(*hintElt)->next; - count++; - } - /* Already checked that hintElt->next, etc. exists, - so don't need to do it again. */ - (*hintElt)->type = newhinttype; - (*hintElt)->next->type = newhinttype; - (*hintElt)->next->next->type = newhinttype; - } - } -} - -/* Go through each hint element and check that all rm's and rv's - meet the necessary criteria. */ -static void FindHandVStem3(hintElt, pathIx, errormsg) - PHintElt *hintElt; -indx pathIx; -boolean *errormsg; -{ - short count = 1; - - while (*hintElt != NULL) { - if ((*hintElt)->type == (RM + ESCVAL) || (*hintElt)->type == (RV + ESCVAL)) { - ReadHorVStem3Values(pathIx, count, (*hintElt)->type, errormsg); - /* RM's and RV's are in pairs of 3 */ - hintElt = &(*hintElt)->next->next->next; - count += 3; - } else { - hintElt = &(*hintElt)->next; - count++; - } - } -} - -static void CheckHandVStem3() { - indx ix; - boolean errormsg = TRUE; - - FindHandVStem3(&pathlist[hintsdirIx].mainhints, MAINHINTS, &errormsg); - for (ix = 0; ix < path_entries; ix++) - FindHandVStem3(&pathlist[hintsdirIx].path[ix].hints, ix, &errormsg); -} - -static void CheckFlexValues(short *operator, indx eltix, indx flexix, - boolean *xequal, boolean *yequal) { - indx ix; - Cd coord; - - *operator= RMT; - if (flexix < 2) return; - - *xequal = *yequal = TRUE; - for (ix = 1; ix < dirCount; ix++) - switch (flexix) { - case 2: - if ((coord.x = pathlist[ix].path[eltix].rx2) != pathlist[ix - 1].path[eltix].rx2) - *xequal = FALSE; - if ((coord.y = pathlist[ix].path[eltix].ry2) != pathlist[ix - 1].path[eltix].ry2) - *yequal = FALSE; - break; - case 3: - if ((coord.x = pathlist[ix].path[eltix].rx3) != pathlist[ix - 1].path[eltix].rx3) - *xequal = FALSE; - if ((coord.y = pathlist[ix].path[eltix].ry3) != pathlist[ix - 1].path[eltix].ry3) - *yequal = FALSE; - break; - case 4: - if ((coord.x = pathlist[ix].path[eltix + 1].rx1) != pathlist[ix - 1].path[eltix + 1].rx1) - *xequal = FALSE; - if ((coord.y = pathlist[ix].path[eltix + 1].ry1) != pathlist[ix - 1].path[eltix + 1].ry1) - *yequal = FALSE; - break; - case 5: - if ((coord.x = pathlist[ix].path[eltix + 1].rx2) != pathlist[ix - 1].path[eltix + 1].rx2) - *xequal = FALSE; - if ((coord.y = pathlist[ix].path[eltix + 1].ry2) != pathlist[ix - 1].path[eltix + 1].ry2) - *yequal = FALSE; - break; - case 6: - if ((coord.x = pathlist[ix].path[eltix + 1].rx3) != pathlist[ix - 1].path[eltix + 1].rx3) - *xequal = FALSE; - if ((coord.y = pathlist[ix].path[eltix + 1].ry3) != pathlist[ix - 1].path[eltix + 1].ry3) - *yequal = FALSE; - break; - case 7: - if ((coord.x = pathlist[ix].path[eltix + 1].x3) != pathlist[ix - 1].path[eltix + 1].x3) - *xequal = FALSE; - if ((coord.y = pathlist[ix].path[eltix + 1].y3) != pathlist[ix - 1].path[eltix + 1].y3) - *yequal = FALSE; - break; - } - if (!(*xequal) && !(*yequal)) - return; - - if (*xequal && (coord.x == 0)) { - *operator= VMT; - *xequal = FALSE; - } - if (*yequal && (coord.y == 0)) { - *operator= HMT; - *yequal = FALSE; - } -} - -static void GetFlexCoord(rmtCt, dirix, eltix, coord) - indx rmtCt, - dirix, eltix; -CdPtr coord; -{ - switch (rmtCt) { - case 0: - (*coord).x = refPtArray[dirix].x - pathlist[dirix].path[eltix].x; - (*coord).y = refPtArray[dirix].y - pathlist[dirix].path[eltix].y; - break; - case 1: - (*coord).x = pathlist[dirix].path[eltix].x1 - refPtArray[dirix].x; - (*coord).y = pathlist[dirix].path[eltix].y1 - refPtArray[dirix].y; - break; - case 2: - (*coord).x = pathlist[dirix].path[eltix].rx2; - (*coord).y = pathlist[dirix].path[eltix].ry2; - break; - case 3: - (*coord).x = pathlist[dirix].path[eltix].rx3; - (*coord).y = pathlist[dirix].path[eltix].ry3; - break; - case 4: - (*coord).x = pathlist[dirix].path[eltix + 1].rx1; - (*coord).y = pathlist[dirix].path[eltix + 1].ry1; - break; - case 5: - (*coord).x = pathlist[dirix].path[eltix + 1].rx2; - (*coord).y = pathlist[dirix].path[eltix + 1].ry2; - break; - case 6: - (*coord).x = pathlist[dirix].path[eltix + 1].rx3; - (*coord).y = pathlist[dirix].path[eltix + 1].ry3; - break; - case 7: - (*coord).x = pathlist[dirix].path[eltix + 1].x3; - (*coord).y = pathlist[dirix].path[eltix + 1].y3; - break; - } -} - -/* NOTE: Mathematical transformations are applied to the multi-master - data in order to decrease the computation during font execution. - See /user/foley/atm/blendfont1.910123 for the definition of this - transformation. This transformation is applied whenever charstring - data is written (i.e. sb and width, flex, hints, dt, ct, mt) AND - an OtherSubr 7 - 11 will be called. */ -static void WriteFlex(eltix) - indx eltix; -{ -#if !AC_C_LIB - boolean vert = (pathlist[hintsdirIx].path[eltix].x == pathlist[hintsdirIx].path[eltix + 1].x3); - Cd coord, coord0; /* array of reference points */ - boolean xsame, ysame, writeSubrOnce; - char operator[MAXOPLEN]; /* rmt, hmt, vmt */ - short optype; - indx ix, j, opix, startix; - short opcount, subrIx, length; - -#if DOMEMCHECK - refPtArray = (Cd *)memck_malloc(dirCount * sizeof(Cd)); -#else - refPtArray = (Cd *)AllocateMem(dirCount, sizeof(Cd), "reference point array"); -#endif - for (ix = 0; ix < dirCount; ix++) { - refPtArray[ix].x = (vert ? pathlist[ix].path[eltix].x : pathlist[ix].path[eltix].x3); - refPtArray[ix].y = (vert ? pathlist[ix].path[eltix].y3 : pathlist[ix].path[eltix].y); - } - WriteStr("1 subr\n"); - for (j = 0; j < 8; j++) { - if (j == 7) - WRTNUM(DMIN); - xsame = ysame = FALSE; - CheckFlexValues(&optype, eltix, j, &xsame, &ysame); - opcount = GetOperandCount(optype); - if ((xsame && !ysame) || (!xsame && ysame)) - GetLengthandSubrIx((opcount = 1), &length, &subrIx); - else - GetLengthandSubrIx(opcount, &length, &subrIx); - GetOperator(optype, operator); - GetFlexCoord(j, 0, eltix, &coord); - coord0.x = coord.x; - coord0.y = coord.y; - if (j == 7) { - if (!xsame && (optype == VMT)) - WriteX(coord.x); /* usually=0. cf bottom of "CheckFlexValues" */ - } - if (xsame && ysame) { - WriteCd(coord); - } else if (xsame) { - WriteX(coord.x); - if (optype != HMT) { - for (ix = 0; ix < dirCount; ix++) { - GetFlexCoord(j, ix, eltix, &coord); - WriteY((ix == 0 ? coord.y : coord.y - coord0.y)); - } - WriteSubr(subrIx); - } - } else if (ysame) { - if (optype != VMT) { - for (ix = 0; ix < dirCount; ix++) { - GetFlexCoord(j, ix, eltix, &coord); - WriteX((ix == 0 ? coord.x : coord.x - coord0.x)); - } - WriteSubr(subrIx); - } - WriteY(coord.y); - } else { - startix = 0; - if ((writeSubrOnce = (length == opcount))) { - if (optype == HMT) - WriteX(coord.x); - else if (optype == VMT) - WriteY(coord.y); - else - WriteCd(coord); - length = startix = 1; - } - for (opix = 0; opix < opcount; opix += length) { - for (ix = startix; ix < dirCount; ix++) { - GetFlexCoord(j, ix, eltix, &coord); - if (ix != 0) { - coord.x -= coord0.x; - coord.y -= coord0.y; - } - switch (optype) { - case HMT: - WriteX(coord.x); - break; - case VMT: - WriteY(coord.y); - break; - case RMT: - MtorDt(coord, opix, length); - break; - } - } - if (!writeSubrOnce || (opix == (opcount - 1))) - WriteSubr(subrIx); - } /* end of for opix */ - } /* end of last else clause */ - if (j != 7) { - sprintf(outstr, "%s 2 subr\n", operator); - WriteToBuffer(); - } - if (j == 7) { - if (!ysame && (optype == HMT)) - WriteY(coord.y); /* usually=0. cf bottom of "CheckFlexValues" */ - } - } /* end of j for loop */ - WriteStr("0 subr\n"); - flexexists = TRUE; -#if DOMEMCHECK - memck_free(refPtArray); -#else - UnallocateMem(refPtArray); -#endif - -#endif /* AC_C_LIB */ -} - -static void WriteHints(pathEltIx) - indx pathEltIx; -{ - indx ix, opix, startix; - short rmcount, rvcount, hinttype; - short opcount, subrIx, length; - PHintElt *hintArray; - boolean lbsame, rtsame, writeSubrOnce; - - /* hintArray contains the pointers to the beginning of the linked list of hints for - each design at pathEltIx. */ -#if DOMEMCHECK - hintArray = (PHintElt *)memck_malloc(dirCount * sizeof(HintElt *)); -#else - hintArray = (PHintElt *)AllocateMem(dirCount, sizeof(HintElt *), "hint element array"); -#endif - /* Initialize hint array. */ - for (ix = 0; ix < dirCount; ix++) - hintArray[ix] = - (pathEltIx == MAINHINTS ? pathlist[ix].mainhints : pathlist[ix].path[pathEltIx].hints); - if (pathEltIx != MAINHINTS) - WriteStr("beginsubr snc\n"); - rmcount = rvcount = 0; - while (hintArray[0] != NULL) { - startix = 0; - hinttype = hintArray[hintsdirIx]->type; - for (ix = 0; ix < dirCount; ix++) { - hintArray[ix]->rightortop -= hintArray[ix]->leftorbot; /* relativize */ - if ((hinttype == RY || hinttype == (RM + ESCVAL)) && !cubeLibrary) - /* if it is a cube library, sidebearings are considered to be zero */ - /* for normal fonts, translate vstem hints left by sidebearing */ - hintArray[ix]->leftorbot -= IntToFix(pathlist[ix].sb); - } - lbsame = rtsame = TRUE; - for (ix = 1; ix < dirCount; ix++) { - if (hintArray[ix]->leftorbot != hintArray[ix - 1]->leftorbot) - lbsame = FALSE; - if (hintArray[ix]->rightortop != hintArray[ix - 1]->rightortop) - rtsame = FALSE; - } - if (lbsame && rtsame) { - WriteOneHintVal(hintArray[0]->leftorbot); - WriteOneHintVal(hintArray[0]->rightortop); - } else if (lbsame) { - WriteOneHintVal(hintArray[0]->leftorbot); - for (ix = 0; ix < dirCount; ix++) - WriteOneHintVal((ix == 0 ? hintArray[ix]->rightortop : hintArray[ix]->rightortop - hintArray[0]->rightortop)); - GetLengthandSubrIx(1, &length, &subrIx); - WriteSubr(subrIx); - } else if (rtsame) { - for (ix = 0; ix < dirCount; ix++) - WriteOneHintVal((ix == 0 ? hintArray[ix]->leftorbot : hintArray[ix]->leftorbot - hintArray[0]->leftorbot)); - GetLengthandSubrIx(1, &length, &subrIx); - WriteSubr(subrIx); - WriteOneHintVal(hintArray[0]->rightortop); - } else { - opcount = GetOperandCount(hinttype); - GetLengthandSubrIx(opcount, &length, &subrIx); - if ((writeSubrOnce = (length == opcount))) { - WriteOneHintVal(hintArray[0]->leftorbot); - WriteOneHintVal(hintArray[0]->rightortop); - length = startix = 1; - } - for (opix = 0; opix < opcount; opix += length) { - for (ix = startix; ix < dirCount; ix++) { - if (opix == 0) - WriteOneHintVal((ix == 0 ? hintArray[ix]->leftorbot : hintArray[ix]->leftorbot - hintArray[0]->leftorbot)); - else - WriteOneHintVal((ix == 0 ? hintArray[ix]->rightortop : hintArray[ix]->rightortop - hintArray[0]->rightortop)); - } - if (!writeSubrOnce || (opix == (opcount - 1))) - WriteSubr(subrIx); - } - } - switch (hinttype) { - case RB: - WriteStr("rb\n"); - break; - case RV + ESCVAL: - if (++rvcount == 3) { - rvcount = 0; - WriteStr("rv\n"); - } - break; - case RY: - WriteStr("ry\n"); - break; - case RM + ESCVAL: - if (++rmcount == 3) { - rmcount = 0; - WriteStr("rm\n"); - } - break; - default: - sprintf(globmsg, "Illegal hint type: %d in character: %s.\n", hinttype, currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - for (ix = 0; ix < dirCount; ix++) - hintArray[ix] = (hintArray[ix]->next == NULL) ? NULL : hintArray[ix]->next; - } /* end of while */ - if (pathEltIx != MAINHINTS) - WriteStr("endsubr enc\nnewcolors\n"); -#if DOMEMCHECK - memck_free(hintArray); -#else - UnallocateMem(hintArray); -#endif -} - -static void WritePathElt(indx dirIx, indx eltIx, short pathType, - indx startix, short length) { - Cd c1, c2, c3; - PCharPathElt path, path0; - - path = &pathlist[dirIx].path[eltIx]; - path0 = &pathlist[0].path[eltIx]; - - switch (pathType) { - case HDT: - case HMT: - WriteX((dirIx == 0 ? path->rx : path->rx - path0->rx)); - break; - case VDT: - case VMT: - WriteY((dirIx == 0 ? path->ry : path->ry - path0->ry)); - break; - case RDT: - case RMT: - c1.x = (dirIx == 0 ? path->rx : path->rx - path0->rx); - c1.y = (dirIx == 0 ? path->ry : path->ry - path0->ry); - MtorDt(c1, startix, length); - break; - case HVCT: - case VHCT: - case RCT: - if (dirIx == 0) { - c1.x = path->rx1; - c1.y = path->ry1; - c2.x = path->rx2; - c2.y = path->ry2; - c3.x = path->rx3; - c3.y = path->ry3; - } else { - c1.x = path->rx1 - path0->rx1; - c1.y = path->ry1 - path0->ry1; - c2.x = path->rx2 - path0->rx2; - c2.y = path->ry2 - path0->ry2; - c3.x = path->rx3 - path0->rx3; - c3.y = path->ry3 - path0->ry3; - } - if (pathType == RCT) - Ct(c1, c2, c3, startix, length); - else if (pathType == HVCT) - Hvct(c1, c2, c3, startix, length); - else - Vhct(c1, c2, c3, startix, length); - break; - case CP: - break; - default: { - sprintf(globmsg, "Illegal path operator %d found in character: %s.\n", - (int)pathType, currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } -} - -static void OptimizeMtorDt(eltix, op, xequal, yequal) - indx eltix; -short *op; -boolean *xequal, *yequal; -{ - indx ix; - - *xequal = *yequal = TRUE; - for (ix = 1; ix < dirCount; ix++) { - *xequal = *xequal && - (pathlist[ix].path[eltix].rx == pathlist[ix - 1].path[eltix].rx); - *yequal = *yequal && - (pathlist[ix].path[eltix].ry == pathlist[ix - 1].path[eltix].ry); - } - if (*xequal && pathlist[0].path[eltix].rx == 0) { - *op = (*op == RMT) ? VMT : VDT; - *xequal = FALSE; - } else if (*yequal && pathlist[0].path[eltix].ry == 0) { - *op = (*op == RMT) ? HMT : HDT; - *yequal = FALSE; - } -} - -static boolean CoordsEqual(indx dir1, indx dir2, indx opIx, indx eltIx, short op) { - PCharPathElt path1 = &pathlist[dir1].path[eltIx], path2 = &pathlist[dir2].path[eltIx]; - char dirname[MAXPATHLEN]; - - switch (opIx) { - case 0: - if (op == RCT || op == HVCT) - return (path1->rx1 == path2->rx1); - else /* op == VHCT */ - return (path1->ry1 == path2->ry1); - break; - case 1: - if (op == RCT) - return (path1->ry1 == path2->ry1); - else - return (path1->rx2 == path2->rx2); - break; - case 2: - if (op == RCT) - return (path1->rx2 == path2->rx2); - else - return (path1->ry2 == path2->ry2); - break; - case 3: - if (op == RCT) - return (path1->ry2 == path2->ry2); - else if (op == HVCT) - return (path1->ry3 == path2->ry3); - else /* op == VHCT */ - return (path1->rx3 == path2->rx3); - break; - case 4: - return (path1->rx3 == path2->rx3); - break; - case 5: - return (path1->ry3 == path2->ry3); - break; - default: - GetMasterDirName(dirname, dir1); - sprintf(globmsg, "Invalid index value: %d defined for curveto command4 in character: %s. Op=%d, dir=%s near (%ld %ld).\n", (int)opIx, currentChar, (int)op, dirname, FTrunc8(path1->x), FTrunc8(path1->y)); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } - - return 0; -} - -/* Checks if path element values are the same for the RCT, HVCT and VHCT - operators in each master directory between operands startIx to - startIx + length. Returns TRUE if they are the same and FALSE otherwise. */ -static boolean SamePathValues(indx eltIx, short op, indx startIx, short length) { - indx ix, dirIx; - /* PCharPathElt path0 = &pathlist[0].path[eltIx]; */ - boolean same = TRUE; - - for (ix = 0; ix < length; ix++) { - for (dirIx = 1; dirIx < dirCount; dirIx++) - if (!(same = same && CoordsEqual(dirIx, 0, startIx, eltIx, op))) - return FALSE; - startIx++; - } - return TRUE; -} - -/* Takes multiple path descriptions for the same character name and - combines them into a single path description using new subroutine - calls 7 - 11. */ -static void CombinePaths() { -#if !AC_C_LIB - indx ix, eltix, opix, startIx, dirIx; - short length, subrIx, opcount, op; - char operator[MAXOPLEN]; - boolean xequal, yequal; - - if (!cubeLibrary) - WriteSbandWidth(); - if (addHints && (pathlist[hintsdirIx].mainhints != NULL)) - WriteHints(MAINHINTS); - WriteStr("sc\n"); - firstMT = TRUE; - for (eltix = 0; eltix < path_entries; eltix++) { - /* A RDT may be tagged 'remove' because it is followed by a point CP. */ - /* See AddLineCube(). */ - if (pathlist[0].path[eltix].remove) - continue; - - xequal = yequal = FALSE; - if (addHints && (pathlist[hintsdirIx].path[eltix].hints != NULL)) - WriteHints(eltix); - switch (pathlist[0].path[eltix].type) { - case RMT: - if (firstMT && !cubeLibrary) /* translate by sidebearing value */ - /* don't want this for cube */ - for (ix = 0; ix < dirCount; ix++) - pathlist[ix].path[eltix].rx -= IntToFix(pathlist[ix].sb); - firstMT = FALSE; - case RDT: - case CP: - break; - case RCT: - if (CheckFlexOK(eltix)) { - WriteFlex(eltix); - /* Since we know the next element is a flexed curve and - has been written out we skip it. */ - eltix++; - continue; - } - /* Try to use optimized operators. */ - if ((pathlist[0].path[eltix].rx1 == 0 && pathlist[0].path[eltix].ry3 == 0) || (pathlist[0].path[eltix].ry1 == 0 && pathlist[0].path[eltix].rx3 == 0)) - OptimizeCT(eltix); - break; - default: - sprintf(globmsg, "Unknown operator in character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - op = pathlist[0].path[eltix].type; - if (op != RCT && op != HVCT && op != VHCT && op != CP) - /* Try to use optimized operators. */ - OptimizeMtorDt(eltix, &op, &xequal, &yequal); - startIx = 0; - opcount = GetOperandCount(op); - GetLengthandSubrIx(opcount, &length, &subrIx); - if (xequal && yequal) { - WritePathElt(0, eltix, op, 0, opcount); - } else if (xequal) { - WriteX(pathlist[0].path[eltix].rx); - if (op != HMT && op != HDT) { - for (ix = 0; ix < dirCount; ix++) - WriteY(((ix == 0) ? pathlist[ix].path[eltix].ry : pathlist[ix].path[eltix].ry - pathlist[0].path[eltix].ry)); - GetLengthandSubrIx(1, &length, &subrIx); - WriteSubr(subrIx); - } - } else if (yequal) { - if (op != VMT && op != VDT) { - for (ix = 0; ix < dirCount; ix++) - WriteX(((ix == 0) ? pathlist[ix].path[eltix].rx : pathlist[ix].path[eltix].rx - pathlist[0].path[eltix].rx)); - GetLengthandSubrIx(1, &length, &subrIx); - WriteSubr(subrIx); - } - WriteY(pathlist[0].path[eltix].ry); - } else - for (opix = 0; opix < opcount; opix += length) { - WritePathElt(0, eltix, op, opix, length); - startIx = opix; - if (op == RCT || op == HVCT || op == VHCT) - if (SamePathValues(eltix, op, startIx, length)) - continue; - for (ix = 0; ix < length; ix++) { - for (dirIx = 1; dirIx < dirCount; dirIx++) - WritePathElt(dirIx, eltix, op, startIx, 1); - startIx++; - } - if (subrIx >= 0 && op != CP) - WriteSubr(subrIx); - } /* end of for opix */ - GetOperator(op, operator); - WriteStr(operator); - } /* end of for eltix */ - WriteStr("ed\n"); -#endif /* AC_C_LIB */ -} - -/* Returns number of operands for the given operator. */ -extern short GetOperandCount(short op) { - short count; - - if (op < ESCVAL) { - switch (op) { - case CP: - case HDT: - case HMT: - case VDT: - case VMT: - count = 1; - break; - case RMT: - case RDT: - case RB: - case RY: - case SBX: - count = 2; - break; - case HVCT: - case VHCT: - count = 4; - break; - case RCT: - count = 6; - break; - default: - sprintf(globmsg, "Unknown operator in character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } - } else { /* handle escape operators */ - switch (op - ESCVAL) { - case RM: - case RV: - count = 2; - break; - } - } - return count; -} - -/* Returns the subr number to use for a given operator in subrIx and - checks that the argument length of each subr call does not - exceed the font interpreter stack limit. */ -extern void GetLengthandSubrIx(short opcount, short *length, short *subrIx) { - if (((opcount * dirCount) > FONTSTKLIMIT) && opcount != 1) - if ((opcount / 2 * dirCount) > FONTSTKLIMIT) - if ((2 * dirCount) > FONTSTKLIMIT) - *length = 1; - else - *length = 2; - else - *length = opcount / 2; - else - *length = opcount; - if (((*length) * dirCount) > FONTSTKLIMIT) { - sprintf(globmsg, "Font stack limit exceeded for character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if (!cubeLibrary) { - switch (*length) { - case 1: - *subrIx = 7; - break; - case 2: - *subrIx = 8; - break; - case 3: - *subrIx = 9; - break; - case 4: - *subrIx = 10; - break; - case 6: - *subrIx = 11; - break; - default: - sprintf(globmsg, "Illegal operand length for character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } - } else { /* CUBE */ - switch (dirCount) { - case 2: - switch (*length) { - case 1: - *subrIx = 7; - break; - case 2: - *subrIx = 8; - break; - case 3: - *subrIx = 9; - break; - case 4: - *subrIx = 10; - break; - case 6: - *subrIx = 11; - break; - default: - sprintf(globmsg, "Illegal operand length for character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } - break; - - case 4: - switch (*length) { - case 1: - *subrIx = 12; - break; - case 2: - *subrIx = 13; - break; - case 3: - *subrIx = 14; - break; - case 4: - *subrIx = 15; - break; - default: - sprintf(globmsg, "Illegal operand length for character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } - break; - - case 8: - switch (*length) { - case 1: - *subrIx = 16; - break; - case 2: - *subrIx = 17; - break; - default: - sprintf(globmsg, "Illegal operand length for character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } - break; - - case 16: - switch (*length) { - case 1: - *subrIx = 18; - break; - default: - sprintf(globmsg, "Illegal operand length for character: %s.\n", currentChar); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } - break; - - default: - LogMsg("Illegal dirCount.\n", LOGERROR, NONFATALERROR, TRUE); - break; - } - } -} - -/********** - Normal MM fonts have their dimensionality wired into the subrs. - That is, the contents of subr 7-11 are computed on a per-font basis. - Cube fonts can be of 1-4 dimensions on a per-character basis. - But there are only a few possible combinations of these numbers - because we are limited by the stack size: - - dimensions arguments values subr# - 1 1 2 7 - 1 2 4 8 - 1 3 6 9 - 1 4 8 10 - 1 6 12 11 - 2 1 4 12 - 2 2 8 13 - 2 3 12 14 - 2 4 16 15 - 3 1 8 16 - 3 2 16 17 - 4 1 16 18 - - *************/ - -extern void SetHintsDir(dirIx) - indx dirIx; -{ - hintsdirIx = dirIx; -} - -extern int GetHintsDir(void) { - return hintsdirIx; -} - -#if 0 -extern boolean MergeCharPaths(outbuffer, charname, filename, - fortransit, tr, trgroupnum) char **outbuffer, - *charname, *filename; -boolean fortransit; -Transitions *tr; -int trgroupnum; -{ - boolean ok; - int i, ix; - - byteCount = 1; - buffSize = GetMaxBytes(); - outbuff = outbuffer; - startbuff = *outbuffer; - memset(startbuff, 0, buffSize); - currentChar = charname; - -#if DEBUG_PCP - fprintf(OUTPUTBUFF, "start character %s\n", charname); -#endif - - if (!fortransit) { - dirCount = GetTotalInputDirs(); - for (i = 0; i < dirCount; i++) { - GetMasterDirName(Path_Names[i].dirnam, i); - sprintf(Path_Names[i].fullfilepath, "%s/%s/%s", - Path_Names[i].dirnam, BEZDIR, filename); - } - } else { - i = GetNumAxes(); - switch (i) { - case 1: - dirCount = 2; - break; - case 2: - dirCount = 4; - break; - case 3: - dirCount = 8; - break; - case 4: - dirCount = 16; - break; - default: - dirCount = 0; - break; - } - for (i = 0; i < dirCount; i++) { - strcpy(Path_Names[i].fullfilepath, tr->transitgrouparray[trgroupnum].assembledfilename[i]); - ix = strindex(Path_Names[i].fullfilepath, "/"); - strncpy(Path_Names[i].dirnam, Path_Names[i].fullfilepath, ix); - Path_Names[i].dirnam[ix] = '\0'; - } - } - - if (ok = CompareCharPaths(filename, fortransit)) { - CheckForZeroLengthCP(); - SetSbandWidth(charname, fortransit, tr, trgroupnum); - if (addHints && hintsdirIx >= 0 && path_entries > 0) { - if (ReadandAssignHints()) { - sprintf(globmsg, "Path problem in ReadAndAssignHints, character %s.\n", charname); - LogMsg(globmsg, LOGERROR, FATALERROR, TRUE); - } - CheckHandVStem3(); - } - CombinePaths(); - } - FreePathElements(0, dirCount); - return ok; -} -#endif diff --git a/c/autohint/autohintlib/source/bf/charpath.h b/c/autohint/autohintlib/source/bf/charpath.h deleted file mode 100644 index 9d8f9d8d2..000000000 --- a/c/autohint/autohintlib/source/bf/charpath.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* charpath.h */ - -#ifndef CHARPATH_H -#define CHARPATH_H - -typedef struct _t_hintelt { - struct _t_hintelt *next; - short int type; /* RB, RY, RM, RV */ - Fixed leftorbot, rightortop; - long pathix1, pathix2; -} HintElt, *PHintElt; - -typedef struct _t_charpathelt { - short int type; /* RMT, RDT, RCT, CP */ - /* the following fields must be cleared in charpathpriv.c/CheckPath */ - boolean isFlex : 1, sol : 1, eol : 1, remove : 1; - int unused : 12; - PHintElt hints; - Fixed x, y, x1, y1, x2, y2, x3, y3; /* absolute coordinates */ - long rx, ry, rx1, ry1, rx2, ry2, rx3, ry3; /* relative coordinates */ -} CharPathElt, *PCharPathElt; - -typedef struct _t_pathlist { - PCharPathElt path; - PHintElt mainhints; - long sb; - short width; -} PathList, *PPathList; - -extern long path_entries; /* number of elements in a character path */ -extern boolean addHints; /* whether to include hints in the font */ - -extern PCharPathElt AppendCharPathElement(int); - -extern boolean CheckCharPath(char *, char *); - -extern short GetOperandCount(short); - -extern void GetLengthandSubrIx(short, short *, short *); - -extern void ResetMaxPathEntries(void); - -extern void SetCurrPathList(PPathList); - -extern void SetHintsDir(indx); - -extern int GetHintsDir(void); - -extern void SetHintsElt(short, CdPtr, long, long, boolean); - -extern void SetNoHints(void); - -#endif /*CHARPATH_H*/ diff --git a/c/autohint/autohintlib/source/bf/charpathpriv.c b/c/autohint/autohintlib/source/bf/charpathpriv.c deleted file mode 100644 index e14e44db6..000000000 --- a/c/autohint/autohintlib/source/bf/charpathpriv.c +++ /dev/null @@ -1,121 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* This source file should contain any procedure(s) that are called - from AC. It should not contain calls to procedures implemented - in object files that are not bound into AC. */ - -#include "buildfont.h" -#include "bftoac.h" -#include "charpath.h" - -#define MAXPATHELT 100 /* initial maximum number of path elements */ - -static long maxPathEntries = 0; -static PPathList currPathList = NULL; -long path_entries; -boolean addHints = TRUE; - -static void CheckPath( - void); - -static void CheckPath() { - if (currPathList->path == NULL) { -#if DOMEMCHECK - currPathList->path = (CharPathElt *)memck_malloc((unsigned int)maxPathEntries * sizeof(CharPathElt)); -#else - currPathList->path = (CharPathElt *)AllocateMem((unsigned int)maxPathEntries, sizeof(CharPathElt), "path element array"); -#endif - } - if (path_entries >= maxPathEntries) { - int i; - - maxPathEntries += MAXPATHELT; -#if DOMEMCHECK - currPathList->path = (PCharPathElt)memck_realloc(currPathList->path, (maxPathEntries * sizeof(CharPathElt))); -#else - currPathList->path = - (PCharPathElt)ReallocateMem((char *)currPathList->path, - maxPathEntries * sizeof(CharPathElt), "path element array"); -#endif - /* Initialize certain fields in CharPathElt, since realloc'ed memory */ - /* may be non-zero. */ - for (i = path_entries; i < maxPathEntries; i++) { - currPathList->path[i].hints = NULL; - currPathList->path[i].isFlex = FALSE; - currPathList->path[i].sol = FALSE; - currPathList->path[i].eol = FALSE; - currPathList->path[i].remove = FALSE; - } - } -} - -extern PCharPathElt AppendCharPathElement(int pathtype) { - CheckPath(); - currPathList->path[path_entries].type = pathtype; - path_entries++; - return (&currPathList->path[path_entries - 1]); -} - -/* Called from CompareCharPaths when a new character is being read. */ -extern void ResetMaxPathEntries() { - maxPathEntries = MAXPATHELT; -} - -extern void SetCurrPathList(plist) - PPathList plist; -{ - currPathList = plist; -} - -extern void SetHintsElt(short hinttype, CdPtr coord, long elt1, long elt2, boolean mainhints) { - PHintElt *hintEntry; - PHintElt lastHintEntry = NULL; - - if (!addHints) - return; - if (mainhints) /* define main hints for character */ - hintEntry = &currPathList->mainhints; - else { - CheckPath(); - hintEntry = &currPathList->path[path_entries].hints; - } -#if DOMEMCHECK - lastHintEntry = (PHintElt)memck_malloc(sizeof(HintElt)); -#else - lastHintEntry = (PHintElt)AllocateMem(1, sizeof(HintElt), "hint element"); -#endif - lastHintEntry->type = hinttype; - lastHintEntry->leftorbot = coord->x; - lastHintEntry->rightortop = coord->y; /* absolute coordinates */ - lastHintEntry->pathix1 = elt1; - lastHintEntry->pathix2 = elt2; - while (*hintEntry != NULL && (*hintEntry)->next != NULL) - hintEntry = &(*hintEntry)->next; - if (*hintEntry == NULL) - *hintEntry = lastHintEntry; - else - (*hintEntry)->next = lastHintEntry; -} - -/* Called when character file contains hinting operators, but - not the path element information needed for making blended - fonts. */ -extern void SetNoHints() { - addHints = FALSE; -} - -/* According to Bill Paxton the offset locking commands should - be replaced by hint substitution and is not necessary to - use for blended fonts. This means characters that should - have these commands may not look as good on Classic LW's. */ -/* -extern void SetOffsetLocking(locktype) -char *locktype; -{ - if (STREQ(locktype, "sol")) - currPathList[path_entries-1].sol = TRUE; - else - currPathList[path_entries-1].eol = TRUE; -} -*/ diff --git a/c/autohint/autohintlib/source/bf/chartable.h b/c/autohint/autohintlib/source/bf/chartable.h deleted file mode 100644 index 217f38cb9..000000000 --- a/c/autohint/autohintlib/source/bf/chartable.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -#include "buildfont.h" -#include "transitionalchars.h" - -/* Called when making an AFM file. */ - -extern void WriteCharMetrics(FILE *, indx); - -extern indx create_entry(char *name, - char *filename, - short width, - boolean derived, - indx dirix, - short masters, - short hintDir); - -extern long setnoncomps(void); - -extern void AddCCtoTable(char *, BboxPtr, BboxPtr, short, indx); - -extern void AddTransitionaltoTable(char *charname, Transitions *tr); - -extern void SetupCharTable(void); - -/* free strings allocated for char_table */ -extern void FreeCharTab(char *); - -extern void sortchartab(boolean); - -extern void GetWidthandBbox(char *, short *, BboxPtr, boolean, indx); - -/* Returns whether the given character is in the char set and has -a bez file. */ -extern boolean CharExists(char *); - -/* Check that a bez file has been seen for the given file name */ -extern boolean CharFileExists(char *); - -extern void set_char_width(char *, long, short *, indx); - -extern long writechars(boolean, char **, long *, boolean, boolean); - -extern long writesubrs(long *); - -extern long getCapDY(char *, boolean, indx); - -extern void writefontbbox(char *); - -extern void WriteBaseDesignBBox(FILE *, indx); - -extern long CharNameCost(void); - -extern void SetCharEncoding(boolean, boolean); diff --git a/c/autohint/autohintlib/source/bf/cryptdefs.h b/c/autohint/autohintlib/source/bf/cryptdefs.h deleted file mode 100644 index 1da6eb40a..000000000 --- a/c/autohint/autohintlib/source/bf/cryptdefs.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* cryptdefs.h -Original Version: Linda Gass January 4, 1987 -Edit History: -Linda Gass: Fri Jul 17 15:16:59 1987 -Linda Weinert: 3/10/87 - introduce ifndef -End Edit History. -*/ - -#include "basic.h" - -#define MAXINT32 0x7fffffffL - -#define BIN 0L -#define HEX 1L - -#define OTHER 0 -#define EEXEC 1 -#define FONTPASSWORD 2 - -#define INLEN -1L - -extern long DoContEncrypt( - char *, FILE *, boolean, long); - -extern long ContEncrypt(char *indata, FILE *outstream, boolean fileinput, long incount, boolean dblenc); - -extern short DoInitEncrypt( - FILE *, short, long, long, boolean); - -extern long DoEncrypt( - char *, FILE *, boolean, long, short, long, long, boolean, boolean); - -extern long ContDecrypt( - char *, char *, boolean, boolean, long, unsigned long); - -extern unsigned long ReadDecFile( - FILE *, char *, char *, boolean, long, unsigned long, short); - -extern void SetLenIV( - short); diff --git a/c/autohint/autohintlib/source/bf/cryptprocs.c b/c/autohint/autohintlib/source/bf/cryptprocs.c deleted file mode 100644 index 6ee4651c5..000000000 --- a/c/autohint/autohintlib/source/bf/cryptprocs.c +++ /dev/null @@ -1,447 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ - -#include "buildfont.h" -#include "cryptdefs.h" -#include "machinedep.h" - -#define C1e 1069928045L -#define C2e 226908351L -#define C1o 902381661L -#define C2o 341529579L -#define keye 121201L -#define keyo 11586L -#define keyf 85294471L -#define keyc 6492394L - -#define MAXLENIV 4 - -/* Globals used outside this source file */ -short lenIV = 4; - -/* Globals used by encryption routines. */ -static long C1, C2, key, lineLength, lineCount; -static unsigned long innerrndnum, outerrndnum; -static char hexmap[] = "0123456789abcdef"; -static int outerlenIV = 4; - -/* Globals used by decryption routines. */ -static long dec1, dec2, inchars; -static unsigned long randno; -static short decrypttype; - -/* Globals used by both encryption and decryption routines. */ -static long format; - -/* Prototypes */ - -static char *InputEnc( - char *, boolean, unsigned long *); - -static void InitEncrypt( - FILE *, boolean); - -static unsigned long DoDecrypt( - FILE *, char *, boolean, long, boolean, unsigned long, short, long, boolean); - -static void SetCryptGlobs( - int, long, boolean, long *, long *, long *); - -#define InitRnum(r, s) \ - { r = (unsigned long)s; } -#define Rnum8(r) \ - ((unsigned long)(r = (((r * C1) + C2) & 0x3fffffff) >> 8) & 0xFF) -#define Encrypt(r, clear, cipher) \ - r = ((unsigned long)((cipher = ((clear) ^ (r >> 8)) & 0xFF) + r) * C1 + C2) - -#define DoublyEncrypt(r0, r1, clear, cipher) \ - r0 = ((unsigned long)((cipher = ((clear) ^ (r0 >> 8)) & 0xFF) + r0) * C1 + C2); \ - r1 = ((unsigned long)((cipher = ((cipher) ^ (r1 >> 8)) & 0xFF) + r1) * C1 + C2); - -#define Decrypt(r, clear, cipher) \ - clear = (unsigned char)((cipher) ^ (r >> 8)) & 0xFF; \ - r = (unsigned long)((cipher) + r) * dec1 + dec2 - -#define OutputEnc(ch, stm) \ - if (format == BIN) \ - (void)putc(ch, stm); \ - else { \ - (void)putc(hexmap[(ch >> 4) & 0xF], stm); \ - (void)putc(hexmap[ch & 0xF], stm); \ - if (--lineCount <= 0) { \ - (void)putc('\n', stm); \ - lineCount = lineLength / 2; \ - } \ - } - -#define get_char(ch, stream, filein) \ - if (filein) \ - ch = (long)getc((FILE *)stream); \ - else \ - ch = (long)*stm++; \ - inchars++; - -static void SetCryptGlobs(int crypttype, long formattype, boolean chardata, long *c1, long *c2, long *k) { - format = formattype; - switch (crypttype) { - case EEXEC: - *c1 = C1e; - *c2 = C2e; - *k = (chardata ? keyc : keye); - return; - break; - case OTHER: - *c1 = C1o; - *c2 = C2o; - *k = keyo; - return; - break; - case FONTPASSWORD: - *c1 = C1o; - *c2 = C2o; - *k = keyf; - return; - break; - } - LogMsg("Invalid crypt params.\n", LOGERROR, NONFATALERROR, TRUE); -} - -static char *InputEnc(char *stm, boolean fileinput, unsigned long *cipher) { - register long c1, c2; - - get_char(c1, stm, fileinput); - if (format == BIN) { - *cipher = c1; - return (stm); - } - while (c1 <= ' ') { - if (c1 == EOF) { - *cipher = EOF; - return stm; - } - if (decrypttype == OTHER) { - get_char(c1, stm, fileinput); - } else - break; - } - get_char(c2, stm, fileinput); - while (c2 <= ' ') { - if (c2 == EOF) { - *cipher = EOF; - return stm; - } - if (decrypttype == OTHER) { - get_char(c2, stm, fileinput); - } else - break; - } - *cipher = ((c1 <= '9' ? c1 : c1 + 9) & 0xF) << 4 | ((c2 <= '9' ? c2 : c2 + 9) & 0xF); - return (stm); -} - -static char *InputPlain(stm, fileinput, clear) char *stm; -boolean fileinput; -unsigned long *clear; -{ - register long c1; - - get_char(c1, stm, fileinput); - *clear = c1; - return (stm); -} - -void SetLenIV(short len) { - lenIV = len; -} - -/* innerrndnum is a global and represents the random seed for the inner level - of double encryption. outerrndnum is the random seed for the outer level - or single encryption. This procedure generates random bytes - and ensures that the first random byte is not a whitespace character - and that at least one of the random bytes is not one of the - ASCII hexadecimal character codes. - The PS interpreter depends on this when decrypting and uses - this info to decide whether data is binary or hex encrypted. */ -static void InitEncrypt(FILE *outstream, boolean dblenc) { - register indx j; - boolean ok = FALSE; - unsigned long randomseed, clear, cipher, origouterrndnum; - time_t tm; - short keylen = (dblenc ? lenIV : outerlenIV); - char initVec[MAXLENIV]; - - get_time(&tm); - InitRnum(randomseed, (unsigned long)tm); - origouterrndnum = outerrndnum; - while (!ok) { - InitRnum(innerrndnum, key); - if (!dblenc) { /* {}'s needed for enclosing macro call. */ - InitRnum(outerrndnum, key); - } else - outerrndnum = origouterrndnum; - for (j = 0; j < keylen; j++) { - clear = Rnum8(randomseed); - if (dblenc) - Encrypt(innerrndnum, clear, cipher); - else - Encrypt(outerrndnum, clear, cipher); - if (j == 0 && (cipher == ' ' || cipher == '\t' || cipher == '\n' || cipher == '\r')) - break; - if ((cipher < '0' || cipher > '9') && (cipher < 'A' || cipher > 'F') && (cipher < 'a' || cipher > 'f')) - ok = TRUE; - if (dblenc) - Encrypt(outerrndnum, cipher, cipher); - initVec[j] = (char)(cipher & 0xFF); - } - } - lineCount = lineLength / 2; - for (j = 0; j < keylen; j++) - OutputEnc(initVec[j], outstream); -} /* InitEncrypt */ - -/* innerrndnum and outerrndnum are globals */ -extern long ContEncrypt(char *indata, FILE *outstream, boolean fileinput, long incount, boolean dblenc) { - unsigned long clear; - long encchars = 0; - - while (TRUE) { - if (fileinput) { - clear = (unsigned long)getc((FILE *)indata); - if (clear == (unsigned long)EOF) - break; - } else { - if (encchars == incount) - break; - clear = *indata++; - } - encchars++; -#ifdef ENCRYPTOUTPUT - if (dblenc) { - unsigned long cipher; - /* {}'s needed for enclosing macro call. */ - DoublyEncrypt(innerrndnum, outerrndnum, clear, cipher); - } else - Encrypt(outerrndnum, clear, cipher); - OutputEnc(((char)cipher), outstream); -#else - putc((char)clear, outstream); -#endif - } - if (fileerror(outstream)) - return (-1); - return (encchars); -} /* ContEncrypt */ - -short DoInitEncrypt(FILE *outstream, short enctype, long formattype, long linelen, boolean chardata) { - lineLength = linelen; - SetCryptGlobs(enctype, formattype, chardata, &C1, &C2, &key); - InitEncrypt(outstream, FALSE); - return (0); -} /* DoInitEncrypt */ - -/* returns the number of characters encrypted and written */ -extern long DoContEncrypt(char *indata, FILE *outstream, boolean fileinput, long incount) { - unsigned long enccount; - FILE *instream = (FILE *)indata; - - if (fileinput) - clearerr(instream); - else if (incount == INLEN) - incount = (long)strlen(indata); - clearerr(outstream); - enccount = ContEncrypt(indata, outstream, fileinput, incount, FALSE); - if ((fileinput && fileerror(instream)) || fileerror(outstream)) - return (-1); - else - return (enccount); -} /* DoContEncrypt */ - -/* Returns the number of characters encrypted and written. Returns -1 if - * an error occurred while reading or writing. The incount argument is used - * only if we are encrypting characters from memory. - */ -long DoEncrypt(char *indata, FILE *outstream, boolean fileinput, long incount, short enctype, long formattype, long linelen, - boolean chardata, boolean dblenc) { - unsigned long enccount; - FILE *instream = (FILE *)indata; - lineLength = linelen; - SetCryptGlobs(enctype, formattype, chardata, &C1, &C2, &key); - if (fileinput) - clearerr(instream); - clearerr(outstream); - InitEncrypt(outstream, dblenc); - enccount = ContEncrypt(indata, outstream, fileinput, incount, dblenc); - /* if (format==HEX && lineLength!=MAXINT && lineCount outcount) - return (-1); - *outdata++ = clear; - } - clearchars++; - } - /* Check for possible file errors. */ - if ((fileoutput && fileerror(outstream)) || - (fileinput && fileerror(instream))) - return (-1); - return (clearchars); -} - -static unsigned long DoDecrypt(FILE *instream, char *outdata, boolean fileinput, /* whether input is from file or memory */ - long incount, boolean fileoutput, /* whether output is to file or memory */ - unsigned long outcount, short dectype, /* the type of decryption */ - long formattype, boolean chardata) - -{ - unsigned long cipher, seed, clearchars = 0; - unsigned char clear; - FILE *outstream = (FILE *)outdata; - char *currPtr = (char *)instream; - int j; - short keylen = (chardata ? lenIV : outerlenIV); - - inchars = 0; - decrypttype = dectype; - SetCryptGlobs(dectype, formattype, chardata, &dec1, &dec2, (long *)&seed); - if (fileinput) - clearerr(instream); - if (fileoutput) - clearerr(outstream); - InitRnum(randno, seed); - for (j = 0; j < keylen; j++) { - currPtr = InputEnc(currPtr, fileinput, &cipher); - /* Check for empty file. */ - if (cipher == (unsigned long)EOF) - return (0); - Decrypt(randno, clear, cipher); - } - while (fileinput || (inchars < incount)) { - currPtr = InputEnc(currPtr, fileinput, &cipher); - if (cipher == (unsigned long)EOF) - break; - - Decrypt(randno, clear, cipher); - if (fileoutput) - (void)putc(clear, (FILE *)outdata); - else { - if (clearchars > outcount) - return (-1); - *outdata++ = clear; - } - clearchars++; - } - /* Since we are using getc and putc, check for file errors. */ - if (fileoutput) - if (fileerror(((FILE *)outdata))) - return (-1); - if (fileinput) - if (fileerror(instream)) - return (-1); - return (clearchars); -} /* DoDecrypt */ - -static unsigned long DoRead(FILE *instream, char *outdata, boolean fileinput, /* whether input is from file or memory */ - long incount, boolean fileoutput, /* whether output is to file or memory */ - unsigned long outcount) - -{ - unsigned long clear; - unsigned long clearchars = 0; - FILE *outstream = (FILE *)outdata; - char *currPtr = (char *)instream; - - inchars = 0; - if (fileinput) - clearerr(instream); - if (fileoutput) - clearerr(outstream); - - while (fileinput || (inchars < incount)) { - currPtr = InputPlain(currPtr, fileinput, &clear); - if (clear == (unsigned long)EOF) - break; - - if (fileoutput) - (void)putc(clear, (FILE *)outdata); - else { - if (clearchars > outcount) - return (-1); - *outdata++ = (char)(clear & 0xFF); - } - clearchars++; - } - /* Since we are using getc and putc, check for file errors. */ - if (fileoutput) - if (fileerror(((FILE *)outdata))) - return (-1); - if (fileinput) - if (fileerror(instream)) - return (-1); - return (clearchars); -} /* DoRead */ - -unsigned long ReadDecFile(FILE *instream, char *filename, char *outbuffer, - boolean fileinput /* whether input is from file or memory */, long incount, unsigned long outcount, - short dectype /* the type of decryption */) { - unsigned long cc; - boolean decrypt = 1; - char c; - - if (fileinput) { - c = getc(instream); - ungetc(c, instream); - } else - c = *((char *)instream); - - if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) - decrypt = 1; - else - decrypt = 0; - - if (decrypt) - cc = DoDecrypt(instream, outbuffer, fileinput, incount, FALSE, outcount, dectype, HEX, FALSE); - else - cc = DoRead(instream, outbuffer, fileinput, incount, FALSE, outcount); - - switch (cc) { - case -1: - sprintf(globmsg, "A file error occurred in the %s file.\n", filename); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - } - return (cc); -} diff --git a/c/autohint/autohintlib/source/bf/derivedchars.h b/c/autohint/autohintlib/source/bf/derivedchars.h deleted file mode 100644 index 88f188fff..000000000 --- a/c/autohint/autohintlib/source/bf/derivedchars.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* derivedchars.h */ - -#ifndef DERIVEDCHARS_H -#define DERIVEDCHARS_H - -#define DERIVEDCHARFILENAME "derivedchars" - -extern void free_derivedtables( - boolean, indx); - -extern char **make_derivedchars( - boolean, short *, indx); - -extern void readderived( - boolean, indx); - -extern void CheckDerivedFileSizes( - int, int); - -#endif diff --git a/c/autohint/autohintlib/source/bf/fileops.c b/c/autohint/autohintlib/source/bf/fileops.c deleted file mode 100644 index b560c83d4..000000000 --- a/c/autohint/autohintlib/source/bf/fileops.c +++ /dev/null @@ -1,553 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ - -#include "buildfont.h" -#include "afmcharsetdefs.h" -#include "cryptdefs.h" -#include "fipublic.h" -#include "machinedep.h" -#include "charpath.h" - -#define BAKSUFFIX ".BAK" - -static char charsetDir[MAXPATHLEN]; -static char charsetname[MAXPATHLEN]; -static char charsetPath[MAXPATHLEN]; -static char subsetPath[MAXPATHLEN]; -static char subsetname[MAXPATHLEN]; -static char working_dir[MAXPATHLEN]; /* name of directory where bf was invoked*/ -static short total_inputdirs = 1; /* number of input directories */ -static long MaxBytes; -char globmsg[MAXMSGLEN + 1]; /* used to format messages */ -static CharsetParser charsetParser; -static char charsetLayout[MAXPATHLEN]; -static char initialWorkingDir[MAXPATHLEN]; -static int initialWorkingDirLength; - -#if IS_LIB -typedef void *(*AC_MEMMANAGEFUNCPTR)(void *ctxptr, void *old, unsigned long size); -extern AC_MEMMANAGEFUNCPTR AC_memmanageFuncPtr; -extern void *AC_memmanageCtxPtr; -#endif - -#include "memcheck.h" - -typedef struct -{ - int lo; - int hi; -} SubsetData; - -extern boolean multiplemaster; /* from buildfont.c */ - -extern short strindex(s, t) /* return index of t in s, -1 if none */ - char *s, - *t; -{ - indx i, n; - - n = (indx)strlen(t); - for (i = 0; s[i] != '\0'; i++) - if (!strncmp(s + i, t, n)) - return i; - return -1; -} - -char *AllocateMem(unsigned int nelem, unsigned int elsize, const char *description) { -#if IS_LIB - char *ptr = (char *)AC_memmanageFuncPtr(AC_memmanageCtxPtr, NULL, nelem * elsize); - if (NULL != ptr) - memset((void *)ptr, 0x0, nelem * elsize); -#else - char *ptr = (char *)calloc(nelem, elsize); -#endif - if (ptr == NULL) { - sprintf(globmsg, "Cannot allocate %d bytes of memory for %s.\n", - (int)(nelem * elsize), description); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - return (ptr); -} - -char *ReallocateMem(char *ptr, unsigned int size, const char *description) { -#if IS_LIB - char *newptr = (char *)AC_memmanageFuncPtr(AC_memmanageCtxPtr, (void *)ptr, size); -#else - char *newptr = (char *)realloc(ptr, size); -#endif - if (newptr == NULL) { - sprintf(globmsg, "Cannot allocate %d bytes of memory for %s.\n", - (int)size, description); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - return (newptr); -} - -void UnallocateMem(void *ptr) { -#if IS_LIB - AC_memmanageFuncPtr(AC_memmanageCtxPtr, (void *)ptr, 0); -#else - if (ptr != NULL) { - free((char *)ptr); - ptr = NULL; - } -#endif -} - -extern unsigned long CheckFileBufferLen(buffer, filename) char **buffer, *filename; -{ - long filelen; - - filelen = ACGetFileSize(filename); - if (filelen > MaxBytes) { /* renner Tue Sep 11 14:59:37 1990 */ -#if 0 - fprintf(stderr, "Calling realloc: %ld vs %ld\n", filelen, MaxBytes); - fflush(stderr); -#endif - MaxBytes = filelen + 5; -#if DOMEMCHECK - *buffer = (char *)memck_realloc(*buffer, (MaxBytes * sizeof(char))); -#else - *buffer = (char *)ReallocateMem(*buffer, (unsigned)(MaxBytes * sizeof(char)), "file buffer"); -#endif - } - return filelen; -} - -/* ACOpenFile tries to open a file with the access attribute - specified. If fopen fails an error message is printed - and the program exits if severity = FATAL. */ -extern FILE *ACOpenFile(char *filename, char *access, short severity) { - FILE *stream; - char dirname[MAXPATHLEN]; - - stream = fopen(filename, access); - if (stream == NULL) { - GetInputDirName(dirname, ""); - switch (severity) { - case (OPENERROR): - sprintf(globmsg, "The %s file does not exist or is not accessible (currentdir='%s').\n", filename, dirname); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - case (OPENWARN): - sprintf(globmsg, "The %s file does not exist or is not accessible (currentdir='%s').\n", filename, dirname); - LogMsg(globmsg, WARNING, OK, TRUE); - break; - default: - break; - } - } - return (stream); -} - -extern void FileNameLenOK(filename) char *filename; -{ - if (strlen(filename) >= MAXFILENAME) { - sprintf(globmsg, "File name: %s exceeds max allowable length of %d.\n", - filename, (int)MAXFILENAME); - LogMsg(globmsg, LOGERROR, FATALERROR, TRUE); - } -} - -extern void CharNameLenOK(charname) char *charname; -{ - if (strlen(charname) >= MAXCHARNAME) { - sprintf(globmsg, - "Character name: %s exceeds maximum allowable length of %d.\n", - charname, (int)MAXCHARNAME); - LogMsg(globmsg, LOGERROR, FATALERROR, TRUE); - } -} - -extern void PathNameLenOK(pathname) char *pathname; -{ - if (strlen(pathname) >= MAXPATHLEN) { - sprintf(globmsg, - "File name: %s exceeds maximum allowable length of %d.\n", - pathname, (int)MAXPATHLEN); - LogMsg(globmsg, LOGERROR, FATALERROR, TRUE); - } -} - -extern boolean BAKFile(filename) char *filename; -{ - short length = (short)strlen(filename); - if (length <= 4) return FALSE; - if (!strcmp(&filename[length - 4], BAKSUFFIX)) - return TRUE; - return FALSE; -} - -extern long GetMaxBytes() { - return MaxBytes; -} - -extern void SetMaxBytes(value) long value; -{ - MaxBytes = value; -} - -/* Sets the global variable charsetDir. */ -extern void set_charsetdir(dirname) char *dirname; -{ - strcpy(charsetDir, dirname); -} - -extern void getcharsetname(csname) char *csname; -{ - strcpy(csname, charsetname); -} - -void SetCharsetParser(char *fileTypeString) { - if (fileTypeString == NULL) - charsetParser = bf_CHARSET_STANDARD; - else if (STREQ(fileTypeString, "CID")) - charsetParser = bf_CHARSET_CID; - else - charsetParser = bf_CHARSET_STANDARD; -} - -CharsetParser -GetCharsetParser() { - return charsetParser; -} - -void SetCharsetLayout(char *fontinfoString) { - strcpy(charsetLayout, (fontinfoString == NULL) - ? BF_STD_LAYOUT - : fontinfoString); -} - -char * -GetCharsetLayout() { - return charsetLayout; -} - -#define INCREMENT 3 -static SubsetData *subsetdata = NULL; -static int allocation = INCREMENT; -static int allocated = 0; -static boolean usesSubset = FALSE; - -boolean -UsesSubset(void) { - return usesSubset; -} - -void SetSubsetName(char *name) { - strcpy(subsetname, name); -#if DOMEMCHECK - subsetdata = (SubsetData *)memck_malloc(INCREMENT * sizeof(SubsetData)); -#else - subsetdata = (SubsetData *)AllocateMem(INCREMENT, sizeof(SubsetData), "SetSubsetName"); -#endif - usesSubset = TRUE; -} - -char * -GetSubsetName(void) { - return (subsetname); -} - -char * -GetSubsetPath(void) { - return (subsetPath); -} - -void LoadSubsetData(void) { - FILE *fp = ACOpenFile(subsetPath, "r", OPENERROR); - int lo; - int hi; - int scanned; - - while ((scanned = fscanf(fp, "%d-%d", &lo, &hi)) > 0) { - if (scanned == 1) - subsetdata[allocated].lo = subsetdata[allocated].hi = lo; - else { - subsetdata[allocated].lo = lo; - subsetdata[allocated].hi = hi; - } - - if (++allocated >= allocation) { - allocation += INCREMENT; -#if DOMEMCHECK - subsetdata = (SubsetData *)memck_realloc(subsetdata, (allocation * sizeof(SubsetData))); -#else - subsetdata = (SubsetData *)ReallocateMem((char *)subsetdata, - allocation * sizeof(SubsetData), "LoadSubsetData"); -#endif - } - } - - fclose(fp); -} - -boolean -InSubsetData(int cid) { - int i; - - for (i = 0; i < allocated; i++) { - if ((cid >= subsetdata[i].lo) && (cid <= subsetdata[i].hi)) - return TRUE; - } - - return FALSE; -} - -/*****************************************************************************/ -/* Returns the name of the character set file. If the filename exists on */ -/* the current directory use that file, otherwise, preface it with the */ -/* character set directory name. */ -/*****************************************************************************/ -void setcharsetname(boolean release, char *csname, char *baseFontPath) { - char *filename; - long i; - char delimit[2]; - - charsetname[0] = csname[0] = '\0'; - - filename = GetFntInfo("CharacterSet", !release); - if (filename == NULL) { - LogMsg("CharacterSet keyword not found in fontinfo file.\n", - WARNING, OK, TRUE); - return; - } - - if (baseFontPath != NULL) { - sprintf(charsetname, "%s%s", baseFontPath, filename); - sprintf(subsetPath, "%s%s", baseFontPath, subsetname); - } else { - sprintf(charsetname, "%s", filename); - sprintf(subsetPath, "%s", subsetname); - } - - if (!CFileExists(charsetname, FALSE)) { - get_filedelimit(delimit); - if (((i = (long)strlen(charsetDir)) == 0) || (charsetDir[i - 1] == delimit[0])) - delimit[0] = '\0'; - - if (charsetParser == bf_CHARSET_CID) { - sprintf(charsetname, "%s%s%s%s%s%s%s", - charsetDir, delimit, - filename, delimit, - BF_LAYOUTS, delimit, - charsetLayout); - } else - sprintf(charsetname, "%s%s%s", charsetDir, delimit, filename); - } - - if (!CFileExists(subsetPath, FALSE)) { - get_filedelimit(delimit); - if (((i = (long)strlen(charsetDir)) == 0) || (charsetDir[i - 1] == delimit[0])) - delimit[0] = '\0'; - - if (charsetParser == bf_CHARSET_CID) { - sprintf(subsetPath, "%s%s%s%s%s%s%s", - charsetDir, delimit, - filename, delimit, - BF_SUBSETS, delimit, - subsetname); - } else - sprintf(subsetPath, "%s%s%s", charsetDir, delimit, subsetname); - } - -#if DOMEMCHECK - memck_free(filename); -#else - UnallocateMem(filename); -#endif - PathNameLenOK(charsetname); - strcpy(csname, charsetname); - strcpy(charsetPath, charsetname); -} - -extern void get_working_dir(dirname) char *dirname; -{ - strcpy(dirname, working_dir); -} - -extern void init_working_dir() { - GetFullPathname(working_dir, 0, MININT); - strcpy(initialWorkingDir, working_dir); - initialWorkingDirLength = (int)strlen(initialWorkingDir); -} - -extern void set_working_dir() { - set_current_dir(working_dir); -} - -extern char *GetFItoAFMCharSetName() { - char *filename; - - if (strlen(charsetDir) == 0) - return NULL; -#if DOMEMCHECK - filename = memck_malloc((strlen(charsetDir) + strlen(AFMCHARSETTABLE) + 2) * sizeof(char)); -#else - filename = AllocateMem((unsigned int)(strlen(charsetDir) + strlen(AFMCHARSETTABLE) + 2), - sizeof(char), "AFM charset filename"); -#endif - get_filename(filename, charsetDir, AFMCHARSETTABLE); - return filename; -} - -extern short GetTotalInputDirs() { - return total_inputdirs; -} - -extern void SetTotalInputDirs(short total) { - total_inputdirs = total; -} - -/* insures that the meaningful data in the buffer is terminated - * by an end of line marker and the null terminator for a string. */ -extern long ACReadFile(textptr, fd, filename, filelength) char *textptr; -FILE *fd; -char *filename; -long filelength; -{ - long cc; - - cc = ReadDecFile( - fd, filename, textptr, TRUE, MAXINT, (unsigned long)(filelength), - OTHER); - fclose(fd); - if (textptr[cc - 1] != NL || textptr[cc - 1] != '\r') - textptr[cc++] = NL; - textptr[cc] = '\0'; - return ((long)cc); -} /* ACReadFile */ - -boolean -IsHintRowMatch(char *hintDirName, char *rowDirName) { - char fontDirName[MAXPATHLEN]; - int fontDirLength; - - /**************************************************************************/ - /* It is necessary to concatenate the hintDirName and rowDirName when */ - /* doing comparisons because each of these may involve multiple path */ - /* components: a/b and x/y/z -> a/b/x/y/z */ - /**************************************************************************/ - sprintf(fontDirName, "%s/%s/", hintDirName, rowDirName); - fontDirLength = (int)strlen(fontDirName); - return ((initialWorkingDirLength >= fontDirLength) && - (strcmp(initialWorkingDir + initialWorkingDirLength - fontDirLength, - fontDirName) == 0)); -} - -boolean -IsInFullCharset(char *bezName) { - FILE *charsetFile; - char line[501]; - char hintDirName[128]; - char rowDirName[128]; - char cname[128]; - - if ((charsetFile = ACOpenFile(charsetPath, "r", OPENOK)) == NULL) - return FALSE; - while (fgets(line, 500, charsetFile) != NULL) { - switch (charsetParser) { - case bf_CHARSET_CID: - if ((sscanf(line, "%*d%s%s%s", hintDirName, rowDirName, cname) == 3) && - IsHintRowMatch(hintDirName, rowDirName) && - (STREQ(cname, bezName))) { - fclose(charsetFile); - return TRUE; - } - break; - case bf_CHARSET_STANDARD: - default: - if ((sscanf(line, "%s", cname) == 1) && - (STREQ(cname, bezName))) { - fclose(charsetFile); - return TRUE; - } - break; - } - } - - fclose(charsetFile); - return FALSE; -} - -/*****************************************************************************/ -/* ReadNames is used for reading each successive character name from the */ -/* character set file. It returns next free location for characters. */ -/*****************************************************************************/ -extern char * -ReadNames(char *cname, char *filename, long *masters, long *hintDir, - FILE *stream) { -#ifdef IS_GGL - /* This should never be called with the GGL */ - return NULL; -#else - int total_assigns; - char line[501]; - static char *result; - int done = 0; - int cid; - char hintDirName[128]; - char rowDirName[128]; - /* char fontDirName[256]; */ - /* int workingDirLength; */ - /* int fontDirLength; */ - - while (!done && ((result = fgets(line, 500, stream)) != NULL)) { - switch (charsetParser) { - case bf_CHARSET_CID: - total_assigns = sscanf(line, "%d%s%s%s", - &cid, hintDirName, rowDirName, cname); - if (total_assigns == 4) { - if (IsHintRowMatch(hintDirName, rowDirName)) { - if (subsetdata) { - if (InSubsetData(cid)) { - strcpy(filename, cname); - *masters = GetTotalInputDirs(); - *hintDir = GetHintsDir(); - done = 1; - } else - done = 0; - } else { - strcpy(filename, cname); - *masters = GetTotalInputDirs(); - *hintDir = GetHintsDir(); - done = 1; - } - } - } - break; - - case bf_CHARSET_STANDARD: - default: - total_assigns = sscanf(line, " %s %s %ld %ld", - cname, filename, masters, hintDir); - if (total_assigns >= 1) { - CharNameLenOK(cname); - - if (total_assigns == 1) strcpy(filename, cname); - - if (multiplemaster) { - FileNameLenOK(filename); - - if (total_assigns < 3) *masters = GetTotalInputDirs(); - - if (total_assigns < 4) - *hintDir = GetHintsDir(); - else - --*hintDir; /* hintDir is zero-origin */ - } else { - strcpy(filename, cname); - *masters = 1; - *hintDir = 0; - } - - done = 1; - } - break; - } - } - - return result; -#endif -} diff --git a/c/autohint/autohintlib/source/bf/filookup.c b/c/autohint/autohintlib/source/bf/filookup.c deleted file mode 100644 index 3f97e5e93..000000000 --- a/c/autohint/autohintlib/source/bf/filookup.c +++ /dev/null @@ -1,1365 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -/* filookup.c - looks up keywords in the fontinfo file and returns the value. */ - -#include "buildfont.h" -#include "filookup.h" -#include "fipriv.h" -#include "fipublic.h" -#include "machinedep.h" -#include "masterfont.h" -#ifdef ACLIB_EXPORTS -#include "ac.h" -#endif -#if SUN -#include -#endif -#define EOS "" -#define NOMATCH -1 -#define MAXFONTNAME 30 /* max length of the FontName = 36 chars PS */ - /* name length max due to LW ROM bug - 7 */ - /* chars for Mac coordinating + 1 for null */ - /* terminator */ - -#define DEFAULTOVRSHTPTSIZE 9.51 /* Default overshoot point size. */ - -static const char *keywordtab[KWTABLESIZE]; -static boolean tab_initialized = FALSE; -static FINODE finode; -static FIPTR fiptr = &finode; -static char endNotice[] = "EndNotice"; -static char endDirs[] = "EndDirs"; -static char endInstance[] = "EndInstances"; -static char endVectors[] = "EndVectors"; -static char fifilename[MAXPATHLEN]; - -static short lookup( - char *); - -static char *search_for_key( - char *, FILE *); - -static void make_error_return( - short, char *, char *, char *, char *); - -static void make_normal_return( - char *, boolean); - -static void append_normal_return( - char *); - -static void check_for_int( - char *, char *); - -static void check_for_intormatrix( - char *, char *); - -static void check_for_num( - char *, char *); - -static void check_for_string( - char *, char *); - -static void check_for_boolean( - char *, char *); - -static void check_for_matrix( - char *, char *, boolean); - -static void check_PS_comment( - char *); - -static void checkovershootvalue( - char *, boolean, boolean); - -static boolean checkovershoots( - void); - -static char *get_middle_lines( - char *, char *, boolean); - -static char *get_keyword_value( - char *, char *); - -static void init_kw_tab( - void); - -static char *get_base_font_path( - void); - -static char *GetHVStems( - char *, boolean); - -static void CheckStemSnap( - char *); - -#ifdef SUN -static boolean valueOK = TRUE; -#endif - -void fiptrfree(FIPTR ptr) { -#if DOMEMCHECK - memck_free(ptr->value_string); -#else - UnallocateMem(ptr->value_string); -#endif -} - -/* Look up the keyword parameter in the table to get the index */ -static short lookup(key) char *key; -{ - indx kwindex; - - for (kwindex = 0; kwindex < KWTABLESIZE; kwindex++) - if (STREQ(key, keywordtab[kwindex])) - return (kwindex); - return (NOMATCH); -} - -/* This proc reads through the given file searching for a line - with its first word the same as key. If it finds such a - line it returns it. */ -static char *search_for_key(key, file) char *key; -FILE *file; -{ - char *line; - char linekey[LINELEN + 1]; -#if DOMEMCHECK - line = memck_malloc((unsigned)LINELEN * sizeof(char)); -#else - line = AllocateMem((unsigned)LINELEN, sizeof(char), "font info buffer"); -#endif - while (fgets(line, LINELEN, file) != NULL) { - if (sscanf(line, " %s", linekey) < 1) - continue; - if (STREQ(key, linekey)) - return (line); - } -#if DOMEMCHECK - memck_free(line); -#else - UnallocateMem(line); -#endif - return (NULL); -} - -/* make_error_return concatenates the error_msgs - strings together into the string return value and - assigns the exit status in the return value structure, as well */ -static void make_error_return(short exit_status, char *error_msg1, char *error_msg2, char *error_msg3, char *error_msg4) { - short msg1_len = (short)strlen(error_msg1); - short msg2_len = (short)strlen(error_msg2); - short msg3_len = (short)strlen(error_msg3); - short msg4_len = (short)strlen(error_msg4); - -#if DOMEMCHECK - memck_free(fiptr->value_string); -#else - UnallocateMem(fiptr->value_string); -#endif - fiptr->value_string = AllocateMem((unsigned)(msg1_len + msg2_len + msg3_len + msg4_len + 1), sizeof(char), "fontinfo return value"); - sprintf(fiptr->value_string, "%s%s%s%s", - error_msg1, error_msg2, error_msg3, error_msg4); - fiptr->exit_status = exit_status; -} - -/* make_normal_return copies the string argument into the - * the return value string and assigns the normal return - * exit status. The caller should free the arg.*/ -static void make_normal_return(char *arg, boolean arg_is_string) { -#if DOMEMCHECK - fiptr->value_string = memck_malloc((unsigned)(strlen(arg) + 1) * sizeof(char)); -#else - fiptr->value_string = AllocateMem((unsigned)(strlen(arg) + 1), sizeof(char), - "fontinfo return"); -#endif - strcpy(fiptr->value_string, arg); - fiptr->exit_status = NORMAL_RETURN; - fiptr->value_is_string = arg_is_string; -} - -/* - * append_normal_return appends the string argument at the end of - * the return value string and assigns the normal return - * exit status. The caller should free the arg, if necessary. */ -static void append_normal_return(arg) char *arg; -{ - char *temp; - - if (fiptr->value_string == NULL) { -#if DOMEMCHECK - fiptr->value_string = memck_malloc((unsigned)(strlen(arg) + 1) * sizeof(char)); -#else - fiptr->value_string = AllocateMem((unsigned)(strlen(arg) + 1), - sizeof(char), "fontinfo return"); -#endif - strcpy(fiptr->value_string, arg); - } else { - temp = fiptr->value_string; -#if DOMEMCHECK - fiptr->value_string = memck_malloc((strlen(temp) + strlen(arg) + 1) * sizeof(char)); -#else - fiptr->value_string = AllocateMem((unsigned)(strlen(temp) + strlen(arg) + 1), sizeof(char), - "fontinfo return"); -#endif - strcat(fiptr->value_string, temp); - strcat(fiptr->value_string, arg); -#if DOMEMCHECK - memck_free(temp); -#else - UnallocateMem(temp); -#endif - } - fiptr->exit_status = NORMAL_RETURN; - fiptr->value_is_string = FALSE; -} - -/* If lineargs is an int, put the int to the value string. - Otherwise, put an error message to the value string. */ -static void check_for_int(key, lineargs) char *key, *lineargs; -{ - indx i, j; - float f; - - i = sscanf(lineargs, " %f", &f); - if (i == 1) { - j = (short)f; - if ((float)j == f) { - sprintf(lineargs, "%d", j); - make_normal_return(lineargs, FALSE); - return; - } - } - sprintf(globmsg, "integer expected on same line of %s file as keyword ", fifilename); - make_error_return(ERROR_RETURN, globmsg, key, "\n instead of ", lineargs); -} - -/* Checks whether lineargs is an int or matrix then calls the - appropriate procedure. */ -static void check_for_intormatrix(key, lineargs) char *key, *lineargs; -{ - char *lb = (char *)strchr(lineargs, '['); - - if (lb == 0) /* must be an integer */ - check_for_int(key, lineargs); - else - check_for_matrix(key, lineargs, FALSE); -} - -/* If lineargs is a decimal number, put the decimal number to - the value string. Otherwise, put an error message to the - value string. */ -static void check_for_num(key, lineargs) char *key, *lineargs; -{ - short i; - float f; - - i = sscanf(lineargs, " %g", &f); - if (i != 1) { - sprintf(globmsg, - "floating point number expected on same line of %s file as ", fifilename); - make_error_return(ERROR_RETURN, globmsg, key, "\n instead of ", lineargs); - } else { - sprintf(lineargs, "%g", f); - make_normal_return(lineargs, FALSE); - } -} - -/* If lineargs is a string in PostScript format (i.e., enclosed in - * parentheses), put the string to the value string. - * Otherwise, put an error message into the value string. */ -static void check_for_string(key, lineargs) char *key, *lineargs; -{ - char *lp, *rp; - - lp = (char *)strchr(lineargs, '('); - rp = (char *)strrchr(lineargs, ')'); - if ((lp == 0) || (rp == 0) || (lp > rp) || (strspn(rp + 1, " \n\r\t\f\v") != strlen(rp + 1))) { - sprintf(globmsg, - "parenthesized string expected on same line of %s file as ", fifilename); - make_error_return(ERROR_RETURN, globmsg, key, "\n instead of ", lineargs); - return; - } - rp[0] = '\0'; /* trash character after ) to put in string terminator */ - make_normal_return(lp + 1, TRUE); -} - -int misspace(int c) { - if (c == ' ' || c == '\n' || c == '\r' || c == '\t') - return 1; - return 0; -} - -int misdigit(int c) { - return c >= '0' && c <= '9'; -} - -/* If lineargs is a boolean, put the boolean to the value string. - * Otherwise, put an error message to the value string. */ -static void check_for_boolean(key, lineargs) char *key, *lineargs; -{ - indx i; - - for (i = 0; (misspace(lineargs[i])); i++) { - } - if (!strncmp(&lineargs[i], "false", 5)) - make_normal_return("false", FALSE); - else if (!strncmp(&lineargs[i], "true", 4)) - make_normal_return("true", FALSE); - else { - sprintf(globmsg, - "boolean value expected on the same line of %s file as ", fifilename); - make_error_return(ERROR_RETURN, globmsg, key, "\n instead of ", lineargs); - } -} - -/* - If lineargs is a PostScript format matrix (enclosed in square - brackets) put the matrix to the value string. Otherwise, put - an error message to the value string. */ -static void check_for_matrix(char *key, char *lineargs, boolean append) { - char *lb, *rb; - lb = (char *)strchr(lineargs, '['); - rb = (char *)strrchr(lineargs, ']'); - if ((lb == 0) || (rb == 0) || (lb > rb)) { - sprintf(globmsg, "matrix enclosed by square brackets expected on line of\n %s file with ", fifilename); - make_error_return(ERROR_RETURN, globmsg, key, "\n instead of ", lineargs); - return; - } - rb[1] = '\0'; /* trash character after ] to put in string terminator */ - if (!append) - make_normal_return(lb, FALSE); - else - append_normal_return(lb); -} - -/* - * If line is a PostScript comment, put it in the value string - * Otherwise, put an error message in the value string. */ -static void check_PS_comment(line) char *line; -{ - if (BLANK(line)) - return; - if (!COMMENT(line)) - make_error_return(ERROR_RETURN, fifilename, - " file should contain line in PostScript comment form\n instead of ", - line, EOS); - else - append_normal_return(line); -} - -/* This proc reads all of the lines in the fifile, looking for the - * beginkey line. Once that is found, it starts appending - * the lines which follow up to the line that - * matches the param, endkey. If matrix is true then it - * checks that the line is a matrix before appending otherwise - * it checks that the line is a comment. */ -static char *get_middle_lines(char *beginkey, char *endkey, boolean matrix) { - FILE *fifile; - char *line, linekey[LINELEN], linebuf[LINELEN + 1]; - char fname[MAXPATHLEN]; - char *bfp; - - fifile = ACOpenFile(fifilename, "r", OPENOK); - if (fifile == NULL) - return (NULL); - - line = search_for_key(beginkey, fifile); - if (line == NULL) { - bfp = get_base_font_path(); - /* extract line with matching keyword, if any, from the base font - * directory's file */ - if (bfp == NULL) - return (NULL); - sprintf(fname, "%s%s", bfp, fifilename); - fifile = ACOpenFile(fname, "r", OPENOK); - if (fifile == NULL) - return (NULL); - line = search_for_key(beginkey, fifile); - } - while (fgets(linebuf, LINELEN, fifile) != NULL) { - if (sscanf(linebuf, " %s", linekey) < 1) - continue; - if (STRNEQ(endkey, linekey)) - if (!matrix) - check_PS_comment(linebuf); - else - check_for_matrix(beginkey, linebuf, TRUE); - else { - fclose(fifile); - return (line); - } - } - fclose(fifile); -#if DOMEMCHECK - memck_free(line); -#else - UnallocateMem(line); -#endif - return (NULL); -} - -/* Gets a line that has the keyword and returns the remainder of - the line. */ -static char *get_keyword_value(key, dirpath) char *key; -char *dirpath; -{ - FILE *fifile; - char *line, *lineargs; - char fname[MAXPATHLEN]; - - sprintf(fname, "%s%s", dirpath, fifilename); - fifile = ACOpenFile(fname, "r", OPENERROR); - line = search_for_key(key, fifile); - if (line == NULL) { - fclose(fifile); - return (NULL); - } -#if DOMEMCHECK - lineargs = memck_malloc((unsigned)LINELEN * sizeof(char)); -#else - lineargs = AllocateMem((unsigned)LINELEN, sizeof(char), "fontinfo buffer"); -#endif - strcpy(lineargs, line + strindex(line, key) + strlen(key)); - fclose(fifile); -#if DOMEMCHECK - memck_free(line); -#else - UnallocateMem(line); -#endif - return (lineargs); -} - -static void init_kw_tab() { - if (tab_initialized) - return; - tab_initialized = TRUE; - /* These are the keywords actually used on the Mac */ - keywordtab[ADOBECOPYRIGHT] = "AdobeCopyright"; - keywordtab[BASEFONTPATH] = "BaseFontPath"; - keywordtab[CHARACTERSET] = "CharacterSet"; - keywordtab[CHARACTERSETFILETYPE] = "CharacterSetFileType"; - keywordtab[CHARACTERSETLAYOUT] = "CharacterSetLayout"; - keywordtab[COMPOSITES] = "Composites"; - keywordtab[COPYRIGHTNOTICE] = "CopyrightNotice"; - keywordtab[CUBELIBRARY] = "CubeLibrary"; - keywordtab[DOMINANTH] = "DominantH"; - keywordtab[DOMINANTV] = "DominantV"; - keywordtab[ENCODING] = "Encoding"; - keywordtab[FAMILYBLUESPATH] = "FamilyBluesPath"; - keywordtab[FAMILYNAME] = "FamilyName"; - keywordtab[FONTMATRIX] = "FontMatrix"; - keywordtab[FONTNAME] = "FontName"; - keywordtab[FORCEBOLD] = "ForceBold"; - keywordtab[FULLNAME] = "FullName"; - keywordtab[ISFIXEDPITCH] = "isFixedPitch"; - keywordtab[ITALICANGLE] = "ItalicAngle"; - keywordtab[PCFILENAMEPREFIX] = "PCFileNamePrefix"; - keywordtab[SCALEPERCENT] = "ScalePercent"; - keywordtab[STEMSNAPH] = "StemSnapH"; - keywordtab[STEMSNAPV] = "StemSnapV"; - keywordtab[SYNTHETICBASE] = "SyntheticBase"; - keywordtab[TRADEMARK] = "Trademark"; - keywordtab[UNDERLINEPOSITION] = "UnderlinePosition"; - keywordtab[UNDERLINETHICKNESS] = "UnderlineThickness"; - keywordtab[WEIGHT] = "Weight"; - keywordtab[VERSION] = "version"; - - /* These are the keywords used only for blending, coloring or - blackbox backward compatibility */ - keywordtab[APPLEFONDID] = "AppleFONDID"; - keywordtab[APPLENAME] = "AppleName"; - keywordtab[ASCENT] = "Ascent"; - keywordtab[ASCENTDESCENTPATH] = "AscentDescentPath"; - keywordtab[ASCHEIGHT] = "AscenderHeight"; - keywordtab[ASCOVERSHOOT] = "AscenderOvershoot"; - keywordtab[AUXHSTEMS] = "AuxHStems"; - keywordtab[AUXVSTEMS] = "AuxVStems"; - keywordtab[AXISLABELS1] = "AxisLabels1"; - keywordtab[AXISLABELS2] = "AxisLabels2"; - keywordtab[AXISLABELS3] = "AxisLabels3"; - keywordtab[AXISLABELS4] = "AxisLabels4"; - keywordtab[AXISMAP1] = "AxisMap1"; - keywordtab[AXISMAP2] = "AxisMap2"; - keywordtab[AXISMAP3] = "AxisMap3"; - keywordtab[AXISMAP4] = "AxisMap4"; - keywordtab[AXISTYPE1] = "AxisType1"; - keywordtab[AXISTYPE2] = "AxisType2"; - keywordtab[AXISTYPE3] = "AxisType3"; - keywordtab[AXISTYPE4] = "AxisType4"; - keywordtab[BASELINEYCOORD] = "BaselineYCoord"; - keywordtab[BASELINEOVERSHOOT] = "BaselineOvershoot"; - keywordtab[BASELINE5] = "Baseline5"; - keywordtab[BASELINE5OVERSHOOT] = "Baseline5Overshoot"; - keywordtab[BASELINE6] = "Baseline6"; - keywordtab[BASELINE6OVERSHOOT] = "Baseline6Overshoot"; - keywordtab[BITSIZES75] = "BitSizes75"; - keywordtab[BITSIZES96] = "BitSizes96"; - keywordtab[CAPHEIGHT] = "CapHeight"; - keywordtab[CAPOVERSHOOT] = "CapOvershoot"; - keywordtab[DESCENT] = "Descent"; - keywordtab[DESCHEIGHT] = "DescenderHeight"; - keywordtab[DESCOVERSHOOT] = "DescenderOvershoot"; - keywordtab[FIGHEIGHT] = "FigHeight"; - keywordtab[FIGOVERSHOOT] = "FigOvershoot"; - keywordtab[FLEXEXISTS] = "FlexExists"; - keywordtab[FLEXOK] = "FlexOK"; - keywordtab[FLEXSTRICT] = "FlexStrict"; - keywordtab[FONTVENDOR] = "FontVendor"; - keywordtab[FORCEBOLDTHRESHOLD] = "ForceBoldThreshold"; - keywordtab[HINTSDIR] = "HintsDir"; - keywordtab[HCOUNTERCHARS] = "HCounterChars"; - keywordtab[HEIGHT5] = "Height5"; - keywordtab[HEIGHT5OVERSHOOT] = "Height5Overshoot"; - keywordtab[HEIGHT6] = "Height6"; - keywordtab[HEIGHT6OVERSHOOT] = "Height6Overshoot"; - keywordtab[PRIMARYINSTANCES] = "PrimaryInstances"; - keywordtab[LCHEIGHT] = "LcHeight"; - keywordtab[LCOVERSHOOT] = "LcOvershoot"; - keywordtab[MASTERDESIGNPOSITIONS] = "MasterDesignPositions"; - keywordtab[MASTERDIRS] = "MasterDirs"; - keywordtab[MSMENUNAME] = "MSMenuName"; - keywordtab[MSWEIGHT] = "MSWeight"; - keywordtab[NCEXISTS] = "NCExists"; - keywordtab[NUMAXES] = "NumAxes"; - keywordtab[ORDINALBASELINE] = "OrdinalBaseline"; - keywordtab[ORDINALOVERSHOOT] = "OrdinalOvershoot"; - keywordtab[ORIGEMSQUAREUNITS] = "OrigEmSqUnits"; - keywordtab[OVERSHOOTPTSIZE] = "OvershootPtsize"; - keywordtab[PAINTTYPE] = "PaintType"; - keywordtab[PGFONTIDNAME] = "PGFontID"; - keywordtab[PHANTOMVECTORS] = "PhantomVectors"; - keywordtab[PI] = "Pi"; - keywordtab[POLYCONDITIONPROC] = "PolyConditionProc"; - keywordtab[POLYCONDITIONTYPE] = "PolyConditionType"; - keywordtab[POLYFLEX] = "PolyFlex"; - keywordtab[POLYFONT] = "PolyFont"; - keywordtab[PRIMOGENITALFONTNAME] = "PrimogenitalFontName"; - keywordtab[SERIF] = "Serif"; - keywordtab[SOURCE] = "Source"; - keywordtab[REGULARINSTANCE] = "RegularInstance"; - keywordtab[RNDSTEMUP] = "RndStemUp"; - keywordtab[STROKEWIDTH] = "StrokeWidth"; - keywordtab[STROKEWIDTHHEAVY] = "StrokeWidthHeavy"; - keywordtab[STYLEBOLD] = "StyleBold"; - keywordtab[STYLECONDENSED] = "StyleCondensed"; - keywordtab[STYLEEXTENDED] = "StyleExtended"; - keywordtab[SUPERIORBASELINE] = "SuperiorBaseline"; - keywordtab[SUPERIOROVERSHOOT] = "SuperiorOvershoot"; - keywordtab[VCOUNTERCHARS] = "VCounterChars"; - keywordtab[VENDORSFONTID] = "VendorsFontID"; - keywordtab[VPMENUNAME] = "VPMenuName"; - keywordtab[VPSTYLE] = "VPStyle"; - keywordtab[VPTYPEFACEID] = "VPTypefaceID"; - keywordtab[BLUEFUZZ] = "BlueFuzz"; - keywordtab[ZONETHRESHOLD] = "ZoneThreshold"; - - keywordtab[LANGUAGEGROUP] = "LanguageGroup"; -} - -/* filookup will lookup the keyword in the fontinfo file. - If the keyword is found and has the proper type, its value - will be written to the returned value string. If the - keyword is optional and not found, a message to that effect - is returned in the value string. Otherwise, an error message - will be written to the returned value string. -*/ -extern FIPTR filookup(char *keyword, boolean optional) { - short kwindex; - char *fs; - char *bfp = NULL; - - init_kw_tab(); - kwindex = lookup(keyword); - if (kwindex == NOMATCH) { - if ((keyword != NULL) && (keyword[0] != '\0')) { - make_error_return(ERROR_RETURN, - fifilename, " file does not recognize keyword ", keyword, "."); - } else { - make_error_return((optional) ? OPTIONAL_NOT_FOUND : ERROR_RETURN, - fifilename, " empty keyword. ", EOS, EOS); - } - return (fiptr); - } - /* extract line with matching keyword, if any, from the file */ - fs = get_keyword_value(keyword, ""); - if (fs == NULL) { - bfp = get_base_font_path(); - /* extract line with matching keyword, if any, from the base font - * directory's file */ - if (bfp != NULL) - fs = get_keyword_value(keyword, bfp); - } - if (fs == NULL) { - if (optional) { - fiptr->exit_status = OPTIONAL_NOT_FOUND; - fiptr->value_string = NULL; - return (fiptr); - } else { - make_error_return(ERROR_RETURN, - fifilename, " file does not contain keyword ", keyword, "."); - return (fiptr); - } - } - - if (fiptr->value_string != NULL) { -#if DOMEMCHECK - memck_free(fiptr->value_string); -#else - UnallocateMem(fiptr->value_string); -#endif - } - - switch (kwindex) { - case APPLENAME: - case AXISTYPE1: - case AXISTYPE2: - case AXISTYPE3: - case AXISTYPE4: - case FONTVENDOR: - case BITSIZES75: - case BITSIZES96: - case HINTSDIR: - case HCOUNTERCHARS: - case MSMENUNAME: - case POLYCONDITIONPROC: - case PRIMOGENITALFONTNAME: - case SOURCE: - case VCOUNTERCHARS: - case VENDORSFONTID: - case VPMENUNAME: - case VPSTYLE: - case ADOBECOPYRIGHT: - case ASCENTDESCENTPATH: - case BASEFONTPATH: - case CHARACTERSET: - case CHARACTERSETFILETYPE: - case CHARACTERSETLAYOUT: - case ENCODING: - case FAMILYBLUESPATH: - case FAMILYNAME: - case FONTNAME: - case FULLNAME: - case PCFILENAMEPREFIX: - case TRADEMARK: - case VERSION: - case WEIGHT: - check_for_string(keyword, fs); - break; - case COMPOSITES: - case CUBELIBRARY: - case ISFIXEDPITCH: - case SYNTHETICBASE: - case FLEXSTRICT: - case FLEXOK: - case FLEXEXISTS: - case FORCEBOLD: - case NCEXISTS: - case PI: - case SERIF: - case RNDSTEMUP: - check_for_boolean(keyword, fs); - break; - case ASCENT: - case DESCENT: - case FORCEBOLDTHRESHOLD: - case ITALICANGLE: - case SCALEPERCENT: - case UNDERLINEPOSITION: - case UNDERLINETHICKNESS: - case ORIGEMSQUAREUNITS: - case OVERSHOOTPTSIZE: - case STROKEWIDTH: - case STROKEWIDTHHEAVY: - case BLUEFUZZ: - case ZONETHRESHOLD: - check_for_num(keyword, fs); - break; - case MASTERDIRS: - fs = get_middle_lines(keyword, endDirs, FALSE); - if (fs == NULL) - make_error_return(ERROR_RETURN, - "Could not find keyword ", endDirs, " in file ", fifilename); - break; - case COPYRIGHTNOTICE: - fs = get_middle_lines(keyword, endNotice, FALSE); - if (fs == NULL) - make_error_return(ERROR_RETURN, - "No EndNotice line found in ", fifilename, " file.", EOS); - break; - case APPLEFONDID: - case ASCHEIGHT: - case ASCOVERSHOOT: - case BASELINEYCOORD: - case BASELINEOVERSHOOT: - case BASELINE5: - case BASELINE5OVERSHOOT: - case BASELINE6: - case BASELINE6OVERSHOOT: - case CAPHEIGHT: - case CAPOVERSHOOT: - case DESCHEIGHT: - case DESCOVERSHOOT: - case FIGHEIGHT: - case FIGOVERSHOOT: - case HEIGHT5: - case HEIGHT5OVERSHOOT: - case HEIGHT6: - case HEIGHT6OVERSHOOT: - case LCHEIGHT: - case LCOVERSHOOT: - case MSWEIGHT: - case NUMAXES: - case ORDINALBASELINE: - case ORDINALOVERSHOOT: - case PAINTTYPE: - case PGFONTIDNAME: - case POLYCONDITIONTYPE: - case POLYFONT: - case SUPERIORBASELINE: - case SUPERIOROVERSHOOT: - case VPTYPEFACEID: - case LANGUAGEGROUP: - check_for_int(keyword, fs); - break; - case AUXHSTEMS: - case AUXVSTEMS: - case AXISLABELS1: - case AXISLABELS2: - case AXISLABELS3: - case AXISLABELS4: - case AXISMAP1: - case AXISMAP2: - case AXISMAP3: - case AXISMAP4: - case MASTERDESIGNPOSITIONS: - case POLYFLEX: - case REGULARINSTANCE: - case STYLEBOLD: - case STYLECONDENSED: - case STYLEEXTENDED: - case FONTMATRIX: - case STEMSNAPH: - case STEMSNAPV: - check_for_matrix(keyword, fs, FALSE); - break; - case DOMINANTH: - case DOMINANTV: - check_for_intormatrix(keyword, fs); - break; - case PHANTOMVECTORS: - fs = get_middle_lines(keyword, endVectors, TRUE); - if (fs == NULL) - make_error_return(ERROR_RETURN, - "Could not find keyword ", endVectors, " in file ", fifilename); - break; - case PRIMARYINSTANCES: - fs = get_middle_lines(keyword, endInstance, TRUE); - if (fs == NULL) - make_error_return(ERROR_RETURN, - "Could not find keyword ", endInstance, " in file ", fifilename); - break; - default: - make_error_return(ERROR_RETURN, - keyword, " is not a known ", fifilename, " file keyword."); - break; - } - -#if DOMEMCHECK - memck_free(fs); -#else - UnallocateMem(fs); -#endif - return (fiptr); -} - -/* Sets the file name from which to get font info to a non-default - name. */ -extern void SetFntInfoFileName(filename) char *filename; -{ - strcpy(fifilename, filename); -} - -/* Sets the file name from which to get font info to the default - name. */ -extern void ResetFntInfoFileName(void) { - strcpy(fifilename, FIFILENAME); -} - -/* Looks up the value of the specified keyword in the fontinfo - file. If the keyword doesn't exist and this is an optional - key, returns a NULL. Otherwise, returns the value string. */ -extern char *GetFntInfo(char *keyword, boolean optional) { - FIPTR fptr; - char *returnstring = NULL; - -#ifdef ACLIB_EXPORTS - if (featurefiledata != NULL) { - int i; - - for (i = 0; i < featurefilesize; i++) { - if (featurefiledata[i].key && !strcmp(featurefiledata[i].key, keyword)) { -#if DOMEMCHECK - returnstring = memck_malloc((strlen(featurefiledata[i].value) + 1) * sizeof(char)); -#else - returnstring = (char *)AllocateMem((unsigned)strlen(featurefiledata[i].value) + 1, sizeof(char), "GetFntInfo return str"); -#endif - strcpy(returnstring, featurefiledata[i].value); - return returnstring; - } - } - - if (optional) { - return NULL; - } else { - sprintf(globmsg, "ERROR: Fontinfo: Couldn't find fontinfo for %s\n", keyword); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } else { -#endif - - fptr = filookup(keyword, optional); - switch (fptr->exit_status) { - case NORMAL_RETURN: -#if DOMEMCHECK - returnstring = memck_malloc((strlen(fptr->value_string) + 1) * sizeof(char)); -#else - returnstring = AllocateMem((unsigned)strlen(fptr->value_string) + 1, sizeof(char), - "return string for fontinfo"); -#endif - strcpy(returnstring, fptr->value_string); -#if DOMEMCHECK - memck_free(fptr->value_string); -#else - UnallocateMem(fptr->value_string); -#endif - break; - case OPTIONAL_NOT_FOUND: - returnstring = NULL; -#if DOMEMCHECK - memck_free(fptr->value_string); -#else - UnallocateMem(fptr->value_string); -#endif - break; - case ERROR_RETURN: - sprintf(globmsg, "%s\n", fptr->value_string); -#if DOMEMCHECK - memck_free(fptr->value_string); -#else - UnallocateMem(fptr->value_string); -#endif - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - break; - default: -#if DOMEMCHECK - memck_free(fptr->value_string); -#else - UnallocateMem(fptr->value_string); -#endif - LogMsg("Unknown exit status from fontinfo lookup.\n", - LOGERROR, NONFATALERROR, TRUE); - break; - } - return (returnstring); -#ifdef ACLIB_EXPORTS - } -#endif - return NULL; -} - -/* This proc looks up an integer fontinfo value and returns: - 1) the integer value found for the keyword - 2) MAXINT if the keyword was not found - In case of an error, cleanup is called, which never returns - */ - -extern int GetFIInt(char *keyword, boolean optional) { - FIPTR fptr; - int temp; - - fptr = filookup(keyword, optional); - switch (fptr->exit_status) { - case NORMAL_RETURN: - sscanf(fptr->value_string, "%d", &temp); -#if DOMEMCHECK - memck_free(fptr->value_string); -#else - UnallocateMem(fptr->value_string); -#endif - return (temp); - break; - case OPTIONAL_NOT_FOUND: - if (optional) { -#if DOMEMCHECK - memck_free(fptr->value_string); -#else - UnallocateMem(fptr->value_string); -#endif - return (MAXINT); - } - /* fall through intentionally */ - case ERROR_RETURN: - sprintf(globmsg, "%s\n", fptr->value_string); -#if DOMEMCHECK - memck_free(fptr->value_string); -#else - UnallocateMem(fptr->value_string); -#endif - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - default: -#if DOMEMCHECK - memck_free(fptr->value_string); -#else - UnallocateMem(fptr->value_string); -#endif - LogMsg("Unknown exit status from fontinfo lookup.\n", - LOGERROR, NONFATALERROR, TRUE); - } - return (MAXINT); -} - -/* FreeFontInfo frees the memory associated with the pointer ptr. - This is to reclaim the storage allocated in GetFntInfo. */ -extern void FreeFontInfo(char *ptr) { -#if DOMEMCHECK - memck_free(ptr); -#else - UnallocateMem(ptr); -#endif -} - -/* Appends Aux{H,V}Stems which is optional to StemSnap{H,V} respectively. */ -static char *GetHVStems(char *kw, boolean optional) { - char *fistr1, *fistr2, *newfistr; - char *end, *start; - - fistr1 = GetFntInfo(((STREQ(kw, "AuxHStems")) ? "StemSnapH" : "StemSnapV"), optional); - fistr2 = GetFntInfo(kw, ACOPTIONAL); - if (fistr2 == NULL) return fistr1; - if (fistr1 == NULL) return fistr2; - /* Merge two arrays. */ -#if DOMEMCHECK - newfistr = memck_malloc((strlen(fistr1) + strlen(fistr2) + 1) * sizeof(char)); -#else - newfistr = AllocateMem( - (unsigned)(strlen(fistr1) + strlen(fistr2) + 1), sizeof(char), "Aux stem value"); -#endif - end = (char *)strrchr(fistr1, ']'); - end[0] = '\0'; - start = (char *)strchr(fistr2, '['); - start[0] = ' '; - sprintf(newfistr, "%s%s", fistr1, fistr2); -#if DOMEMCHECK - memck_free(fistr1); -#else - UnallocateMem(fistr1); -#endif -#if DOMEMCHECK - memck_free(fistr2); -#else - UnallocateMem(fistr2); -#endif - return newfistr; -} - -/* This procedure parses the various fontinfo file stem keywords: - StemSnap{H,V}, Dominant{H,V} and Aux{H,V}Stems. If Aux{H,V}Stems - is specified then the StemSnap{H,V} values are automatically - added to the stem array. ParseIntStems guarantees that stem values - are unique and in ascending order. - If blendstr is NULL it means we just want the values from the - current font directory and not for all input directories - (e.g., for a multi-master font). - */ -extern void ParseIntStems(char *kw, boolean optional, long maxstems, int *stems, long *pnum, char *blendstr) { - char c; - char *line; - int val, cnt, i, ix, j, temp, targetCnt = -1, total = 0; - boolean singleint = FALSE; - short dirCount = (blendstr == NULL ? 1 : GetTotalInputDirs()); - char *initline; - - *pnum = 0; - for (ix = 0; ix < dirCount; ix++) { - cnt = 0; - if (blendstr != NULL) - SetMasterDir(ix); - if (STREQ(kw, "AuxHStems") || STREQ(kw, "AuxVStems")) - initline = GetHVStems(kw, optional); - else - initline = GetFntInfo(kw, optional); - if (initline == NULL) { - if (targetCnt > 0) { - sprintf(globmsg, "The keyword: %s does not have the same number of values\n in each master design.\n", kw); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } else - continue; /* optional keyword not found */ - } - line = initline; - /* Check for single integer instead of matrix. */ - if ((strlen(line) != 0) && (strchr(line, '[') == 0)) { - singleint = TRUE; - goto numlst; - } - while (TRUE) { - c = *line++; - switch (c) { - case 0: - *pnum = 0; -#if DOMEMCHECK - memck_free(initline); -#else - UnallocateMem(initline); -#endif - return; - case '[': - goto numlst; - default: - break; - } - } - numlst: - while (*line != ']') { - while (misspace(*line)) line++; /* skip past any blanks */ - if (sscanf(line, " %d", &val) < 1) break; - if (total >= maxstems) { - sprintf(globmsg, "Cannot have more than %d values in fontinfo file array: \n %s\n", (int)maxstems, initline); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if (val < 1) { - sprintf(globmsg, "Cannot have a value < 1 in fontinfo file array: \n %s\n", line); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - stems[total++] = val; - cnt++; - if (singleint) break; - while (misdigit(*line)) line++; /* skip past the number */ - } - /* insure they are in order */ - for (i = *pnum; i < total; i++) - for (j = i + 1; j < total; j++) - if (stems[i] > stems[j]) { - temp = stems[i]; - stems[i] = stems[j]; - stems[j] = temp; - } - /* insure they are unique - note: complaint for too many might precede - guarantee of uniqueness */ - for (i = *pnum; i < total - 1; i++) - if (stems[i] == stems[i + 1]) { - for (j = (i + 2); j < total; j++) - stems[j - 1] = stems[j]; - total--; - cnt--; - } - if (ix > 0 && (cnt != targetCnt)) { -#if DOMEMCHECK - memck_free(initline); -#else - UnallocateMem(initline); -#endif - sprintf(globmsg, "The keyword: %s does not have the same number of values\n in each master design.\n", kw); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - targetCnt = cnt; - *pnum += cnt; -#if DOMEMCHECK - memck_free(initline); -#else - UnallocateMem(initline); -#endif - } /* end of for loop */ - if (blendstr == NULL || total == 0) - return; - /* Write array of blended snap values to blendstr to be put in - Blend dict of Private dictionary. */ - WriteBlendedArray(stems, total, cnt, blendstr); - /* Reset pnum so just the first set of snap values is written - in the top level Private dictionary. */ - *pnum = cnt; -} - -/* This proc checks for the existence of StemSnap{H,V}. If it is - specified in the fontinfo file then it checks that the corresponding - Dominant{H,V} value (if it exists) is also in the StemSnap array. - If it is not an error message is issued. Also checks that if there - are more than two values in the StemSnap{H,V} arrays then there must - be two values in the Dominant{H,V} arrays. */ -static void CheckStemSnap(direction) char *direction; -{ - int stems[MAXSTEMSNAP]; - long stemcnt, dominantVal = MAXINT, domValCnt = 0; - char key[15]; - indx ix; - - key[0] = '\0'; - sprintf(key, "Dominant%s", direction); - ParseIntStems(key, ACOPTIONAL, (long)MAXDOMINANTSTEMS, stems, &stemcnt, NULL); - if (stemcnt > 0) { - dominantVal = stems[0]; - domValCnt = stemcnt; - } - sprintf(key, "StemSnap%s", direction); - ParseIntStems(key, ACOPTIONAL, (long)MAXSTEMSNAP, stems, &stemcnt, NULL); - if (stemcnt <= 0) - return; - if (dominantVal == MAXINT) { - sprintf(globmsg, "A StemSnap%s array is specified, but a Dominant%s value\n is not defined. This may cause stem width problems.\n", direction, direction); - LogMsg(globmsg, WARNING, OK, TRUE); - return; - } - if ((stemcnt > 2) && (domValCnt != MAXDOMINANTSTEMS)) { - sprintf(globmsg, "There must be two values in the Dominant{H,V} arrays if there are\n more than two values in the StemSnap{H,V} arrays in the %s file.\n", FIFILENAME); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - for (ix = 0; ix < stemcnt; ix++) - if (dominantVal == stems[ix]) - return; - sprintf(globmsg, "The Dominant%s value: %ld must be included in\n the StemSnap%s array in the %s file.\n", direction, dominantVal, direction, FIFILENAME); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); -} - -extern void -CheckRequiredKWs(void) -/*****************************************************************************/ -/* This proc attempts to test for required fontinfo keywords early in the */ -/* running of buildfont, rather than have the lack of one of them cause */ -/* buildfont to blow up just as it goes to assemble the font. It can only */ -/* check a subset of the keywords that potentially will be required, since */ -/* whether coloring keywords are required is data dependent. FontName, */ -/* version and CharacterSet entries are tested early enough elsewhere. */ -/*****************************************************************************/ -{ - char *s; -/* int stems[MAXDOMINANTSTEMS]; - long stemcnt, bands; */ -#ifdef SUN - float overshootptsize = (float)DEFAULTOVRSHTPTSIZE; -#endif - s = GetFntInfo("FontName", MANDATORY); - if (strlen(s) >= MAXFONTNAME) { - sprintf(globmsg, "FontName in %s exceeds max length of %d.\n", - fifilename, (int)(MAXFONTNAME - 1)); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("Encoding", - scalinghints || (GetCharsetParser() == bf_CHARSET_CID)); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("AdobeCopyright", scalinghints); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("FullName", scalinghints); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("FamilyName", scalinghints); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("Weight", scalinghints); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("isFixedPitch", scalinghints); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("UnderlinePosition", scalinghints); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("UnderlineThickness", scalinghints); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("Trademark", ACOPTIONAL); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("Composites", ACOPTIONAL); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("ScalePercent", ACOPTIONAL); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - -#ifdef SUN - if (scalinghints) { - SetFntInfoFileName(SCALEDHINTSINFO); - s = GetFntInfo("OrigEmSqUnits", MANDATORY); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - } - s = GetFntInfo("FlexOK", ACOPTIONAL); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("RndStemUp", ACOPTIONAL); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("HCounterChars", ACOPTIONAL); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - s = GetFntInfo("VCounterChars", ACOPTIONAL); -#if DOMEMCHECK - memck_free(s); -#else - UnallocateMem(s); -#endif - ParseIntStems("DominantV", MANDATORY, (long)MAXDOMINANTSTEMS, stems, - &stemcnt, NULL); - ParseIntStems("DominantH", ACOPTIONAL, (long)MAXDOMINANTSTEMS, stems, - &stemcnt, NULL); - CheckStemSnap("H"); - CheckStemSnap("V"); - - bands = build_bands(); - if (scalinghints || (bands == 0)) { - ResetFntInfoFileName(); - return; - } - if ((s = GetFntInfo("OvershootPtsize", ACOPTIONAL)) != NULL) - overshootptsize = atof(s) - 0.49; - if (checkbandwidths(overshootptsize, TRUE) || - checkbandwidths(overshootptsize, FALSE) || - checkbandspacing() || !checkovershoots()) - LogMsg( - "Can't continue because of problem with " - "alignment zones in fontinfo file.\n", - LOGERROR, NONFATALERROR, TRUE); -#endif -} - -#ifdef SUN - -static checkovershootvalue(keyword, optional, positive) char *keyword; -boolean optional, positive; -{ - int value; - - if ((value = GetFIInt(keyword, optional)) != MAXINT) { - if (positive) { - if (value < 0) { - sprintf(globmsg, "The keyword %s has a value of %d.\n It should be greater than or equal to 0.\n", keyword, value); - LogMsg(globmsg, LOGERROR, OK, TRUE); - valueOK = FALSE; - } - } else if (value > 0) { - sprintf(globmsg, "The keyword %s has a value of %d.\n It should be less than or equal to 0.\n", keyword, value); - LogMsg(globmsg, LOGERROR, OK, TRUE); - valueOK = FALSE; - } - } -} - -/* Returns TRUE if all values have the correct sign i.e. positive or negative. */ -static boolean checkovershoots() { - valueOK = TRUE; - checkovershootvalue("BaselineOvershoot", MANDATORY, FALSE); - checkovershootvalue("CapOvershoot", MANDATORY, TRUE); - checkovershootvalue("LcOvershoot", ACOPTIONAL, TRUE); - checkovershootvalue("FigOvershoot", ACOPTIONAL, TRUE); - checkovershootvalue("SuperiorOvershoot", ACOPTIONAL, FALSE); - checkovershootvalue("OrdinalOvershoot", ACOPTIONAL, FALSE); - checkovershootvalue("AscenderOvershoot", ACOPTIONAL, TRUE); - checkovershootvalue("DescenderOvershoot", ACOPTIONAL, FALSE); - checkovershootvalue("Baseline5Overshoot", ACOPTIONAL, FALSE); - checkovershootvalue("Baseline6Overshoot", ACOPTIONAL, FALSE); - checkovershootvalue("Height5Overshoot", ACOPTIONAL, TRUE); - checkovershootvalue("Height6Overshoot", ACOPTIONAL, TRUE); - return valueOK; -} - -#endif - -/* - * get_base_font_path reads the BaseFontPath entry out of this - * directory's fontinfo, if any, and returns the base font path name, - * which is guaranteed to end in a delimiter */ -static char * -get_base_font_path() { - char *line = get_keyword_value("BaseFontPath", EOS); - char *bfp; - char *lp, *rp; - char name[MAXPATHLEN]; - int bfp_len; - int i; - - if (line == NULL) - return (NULL); -#if DOMEMCHECK - bfp = memck_malloc((strlen(line) + 3) * sizeof(char)); -#else - bfp = AllocateMem((unsigned)(strlen(line) + 3), - sizeof(char), "font info buffer"); -#endif - i = sscanf(line, "%s", bfp); - if (i != 1) - return (NULL); - lp = (char *)strchr(bfp, '('); - rp = (char *)strrchr(bfp, ')'); - if ((lp == 0) || (rp == 0) || (rp < lp)) - return (NULL); - bfp_len = (int)(rp - lp - 1); - strncpy(line, lp + 1, bfp_len); - line[bfp_len] = '\0'; - line = CheckBFPath(line); - get_filename(name, line, ""); /* Adds appropriate delimiter. */ - strcpy(line, name); -#if DOMEMCHECK - memck_free(bfp); -#else - UnallocateMem(bfp); -#endif - return (line); -} diff --git a/c/autohint/autohintlib/source/bf/filookup.h b/c/autohint/autohintlib/source/bf/filookup.h deleted file mode 100644 index 3e7cd9f62..000000000 --- a/c/autohint/autohintlib/source/bf/filookup.h +++ /dev/null @@ -1,151 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -/*****************************************************************************/ -/* Header file for fontinfo lookup program */ -/*****************************************************************************/ - -/*****************************************/ -/* These keywords are used for colored */ -/* and uncolored, Mac and Sun versions */ -/*****************************************/ -#define ADOBECOPYRIGHT 0 -#define ASCENT 1 + ADOBECOPYRIGHT -#define ASCENTDESCENTPATH 1 + ASCENT -#define BASEFONTPATH 1 + ASCENTDESCENTPATH -#define CHARACTERSET 1 + BASEFONTPATH -#define CHARACTERSETFILETYPE 1 + CHARACTERSET -#define CHARACTERSETLAYOUT 1 + CHARACTERSETFILETYPE -#define COMPOSITES 1 + CHARACTERSETLAYOUT -#define COPYRIGHTNOTICE 1 + COMPOSITES -#define CUBELIBRARY 1 + COPYRIGHTNOTICE -#define DESCENT 1 + CUBELIBRARY -#define DOMINANTH 1 + DESCENT -#define DOMINANTV 1 + DOMINANTH -#define ENCODING 1 + DOMINANTV -#define FAMILYBLUESPATH 1 + ENCODING -#define FAMILYNAME 1 + FAMILYBLUESPATH -#define FONTMATRIX 1 + FAMILYNAME -#define FONTNAME 1 + FONTMATRIX -#define FULLNAME 1 + FONTNAME -#define ISFIXEDPITCH 1 + FULLNAME -#define ITALICANGLE 1 + ISFIXEDPITCH -#define PCFILENAMEPREFIX 1 + ITALICANGLE -#define RNDSTEMUP 1 + PCFILENAMEPREFIX -#define SCALEPERCENT 1 + RNDSTEMUP -#define STEMSNAPH 1 + SCALEPERCENT -#define STEMSNAPV 1 + STEMSNAPH -#define SYNTHETICBASE 1 + STEMSNAPV -#define TRADEMARK 1 + SYNTHETICBASE -#define UNDERLINEPOSITION 1 + TRADEMARK -#define UNDERLINETHICKNESS 1 + UNDERLINEPOSITION -#define VERSION 1 + UNDERLINETHICKNESS -#define WEIGHT 1 + VERSION - -/*****************************************/ -/* These keywords are used just for */ -/* coloring... */ -/*****************************************/ - -#define ASCHEIGHT 1 + WEIGHT -#define ASCOVERSHOOT 1 + ASCHEIGHT -#define AUXHSTEMS 1 + ASCOVERSHOOT -#define AUXVSTEMS 1 + AUXHSTEMS -#define BASELINE5 1 + AUXVSTEMS -#define BASELINE5OVERSHOOT 1 + BASELINE5 -#define BASELINE6 1 + BASELINE5OVERSHOOT -#define BASELINE6OVERSHOOT 1 + BASELINE6 -#define BASELINEYCOORD 1 + BASELINE6OVERSHOOT -#define BASELINEOVERSHOOT 1 + BASELINEYCOORD -#define CAPHEIGHT 1 + BASELINEOVERSHOOT -#define CAPOVERSHOOT 1 + CAPHEIGHT -#define DESCHEIGHT 1 + CAPOVERSHOOT -#define DESCOVERSHOOT 1 + DESCHEIGHT -#define FIGHEIGHT 1 + DESCOVERSHOOT -#define FIGOVERSHOOT 1 + FIGHEIGHT -#define FLEXEXISTS 1 + FIGOVERSHOOT -#define FLEXOK 1 + FLEXEXISTS -#define FORCEBOLD 1 + FLEXOK -#define HCOUNTERCHARS 1 + FORCEBOLD -#define HEIGHT5 1 + HCOUNTERCHARS -#define HEIGHT5OVERSHOOT 1 + HEIGHT5 -#define HEIGHT6 1 + HEIGHT5OVERSHOOT -#define HEIGHT6OVERSHOOT 1 + HEIGHT6 -#define LCHEIGHT 1 + HEIGHT6OVERSHOOT -#define LCOVERSHOOT 1 + LCHEIGHT -#define ORDINALBASELINE 1 + LCOVERSHOOT -#define ORDINALOVERSHOOT 1 + ORDINALBASELINE -#define ORIGEMSQUAREUNITS 1 + ORDINALOVERSHOOT -#define OVERSHOOTPTSIZE 1 + ORIGEMSQUAREUNITS -#define SUPERIORBASELINE 1 + OVERSHOOTPTSIZE -#define SUPERIOROVERSHOOT 1 + SUPERIORBASELINE -#define ZONETHRESHOLD 1 + SUPERIOROVERSHOOT -#define BLUEFUZZ 1 + ZONETHRESHOLD -#define FLEXSTRICT 1 + BLUEFUZZ - -/*****************************************/ -/* These keywords are for compatibility */ -/* with the blackbox (old code) world... */ -/*****************************************/ -#define APPLEFONDID 1 + FLEXSTRICT -#define APPLENAME 1 + APPLEFONDID -#define BITSIZES75 1 + APPLENAME -#define BITSIZES96 1 + BITSIZES75 -#define FONTVENDOR 1 + BITSIZES96 -#define MSMENUNAME 1 + FONTVENDOR -#define MSWEIGHT 1 + MSMENUNAME -#define NCEXISTS 1 + MSWEIGHT -#define PAINTTYPE 1 + NCEXISTS -#define PGFONTIDNAME 1 + PAINTTYPE -#define PRIMOGENITALFONTNAME 1 + PGFONTIDNAME -#define PI 1 + PRIMOGENITALFONTNAME -#define POLYCONDITIONPROC 1 + PI -#define POLYCONDITIONTYPE 1 + POLYCONDITIONPROC -#define POLYFLEX 1 + POLYCONDITIONTYPE -#define POLYFONT 1 + POLYFLEX -#define SERIF 1 + POLYFONT -#define SOURCE 1 + SERIF -#define STROKEWIDTH 1 + SOURCE -#define STROKEWIDTHHEAVY 1 + STROKEWIDTH -#define VCOUNTERCHARS 1 + STROKEWIDTHHEAVY -#define VENDORSFONTID 1 + VCOUNTERCHARS -#define VPMENUNAME 1 + VENDORSFONTID -#define VPSTYLE 1 + VPMENUNAME -#define VPTYPEFACEID 1 + VPSTYLE - -/*****************************************/ -/* These keywords are just used for */ -/* multiple master fonts... */ -/*****************************************/ -#define AXISLABELS1 1 + VPTYPEFACEID -#define AXISLABELS2 1 + AXISLABELS1 -#define AXISLABELS3 1 + AXISLABELS2 -#define AXISLABELS4 1 + AXISLABELS3 -#define AXISMAP1 1 + AXISLABELS4 -#define AXISMAP2 1 + AXISMAP1 -#define AXISMAP3 1 + AXISMAP2 -#define AXISMAP4 1 + AXISMAP3 -#define AXISTYPE1 1 + AXISMAP4 -#define AXISTYPE2 1 + AXISTYPE1 -#define AXISTYPE3 1 + AXISTYPE2 -#define AXISTYPE4 1 + AXISTYPE3 -#define FORCEBOLDTHRESHOLD 1 + AXISTYPE4 -#define HINTSDIR 1 + FORCEBOLDTHRESHOLD -#define MASTERDESIGNPOSITIONS 1 + HINTSDIR -#define MASTERDIRS 1 + MASTERDESIGNPOSITIONS -#define NUMAXES 1 + MASTERDIRS -#define PHANTOMVECTORS 1 + NUMAXES -#define PRIMARYINSTANCES 1 + PHANTOMVECTORS -#define REGULARINSTANCE 1 + PRIMARYINSTANCES -#define STYLEBOLD 1 + REGULARINSTANCE -#define STYLECONDENSED 1 + STYLEBOLD -#define STYLEEXTENDED 1 + STYLECONDENSED - -/* additionals */ -#define LANGUAGEGROUP 1 + STYLEEXTENDED - -#define KWTABLESIZE 1 + LANGUAGEGROUP - -#define MAXOVERSHOOTBANDS 6 -#define MAXUNDERSHOOTBANDS 6 -#define MAXBANDPAIRS (MAXOVERSHOOTBANDS + MAXUNDERSHOOTBANDS) diff --git a/c/autohint/autohintlib/source/bf/fipriv.h b/c/autohint/autohintlib/source/bf/fipriv.h deleted file mode 100644 index 1e7fcb319..000000000 --- a/c/autohint/autohintlib/source/bf/fipriv.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* These procedures are private between filookup.c and fiblues.c. */ - -#include "fipublic.h" - -#ifndef FIPRIVATE_H -#define FIPRIVATE_H - -/* Builds the undershoot and overshoot band arrays. */ -extern int build_bands( - void); - -/* looks up specified keyword in fontinfo file. */ -extern FIPTR filookup( - char *, boolean); - -/* Frees the value string associated with fiptr. */ -extern void fiptrfree( - FIPTR); - -/* These procs check that band widths and band spacing are within limits. */ -extern boolean checkbandwidths( - float, boolean); - -extern boolean checkbandspacing( - void); - -extern void WriteBlendedArray( - int *, int, int, char *); - -#endif /*FIPRIVATE_H*/ diff --git a/c/autohint/autohintlib/source/bf/fipublic.h b/c/autohint/autohintlib/source/bf/fipublic.h deleted file mode 100644 index da3380685..000000000 --- a/c/autohint/autohintlib/source/bf/fipublic.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* This interface is for C-program callers of the font info lookup - * proc. The caller of filookup is responsible for also calling - * fiptrfree to get rid of the storage returned. */ - -#ifndef FIPUBLIC_H -#define FIPUBLIC_H - -#include "basic.h" - -#define NORMAL_RETURN 0 -#define OPTIONAL_NOT_FOUND 1 -#define ERROR_RETURN 2 -#define LINELEN 200 -#define ACOPTIONAL 1 -#define MANDATORY 0 - -#define DEFAULTBLUEFUZZ FixOne /* Default value used by PS interpreter and Adobe's fonts */ - /* to extend the range of alignment zones. */ -#define MAXDOMINANTSTEMS 2 -#define MAXSTEMSNAP 12 -#define MMFINAME "mmfontinfo" -#define FIFILENAME "fontinfo" - -typedef struct fontinfo { - short exit_status; /* NORMAL_RETURN = 0 - normal return => */ - /* keyword found and argument ok, */ - /* value_string has value */ - /* OPTIONAL_NOT_FOUND = 1 */ - /* keyword not found, but optional => */ - /* value_string empty */ - /* ERROR_RETURN = 2 - error return => keyword not found or argument - bad, */ - /* value_string has error msg describing problem */ - short value_is_string; /* 0 means false */ - char *value_string; -} FINODE, *FIPTR; - -/* FreeFontInfo frees the memory associated with the pointer ptr. - This is to reclaim the storage allocated in GetFntInfo. */ -extern void FreeFontInfo( - char *); - -/* Looks up the value of the specified keyword in the fontinfo - file. If the keyword doesn't exist and this is an optional - key, returns a NULL. Otherwise, returns the value string. */ -extern char *GetFntInfo( - char *, boolean); - -/* returns MAXINT if optional and not found */ -extern int GetFIInt( - char *, boolean); - -extern void SetFntInfoFileName( - char *); - -extern void ResetFntInfoFileName( - void); - -/* get_private_blues formats the BlueValue-related data in the - fontinfo file for use in the Private dictionary. */ - -extern char *get_private_blues( - boolean); - -/* get_blended_blues formats the BlueValue-related data for - multiple master fonts. */ -extern char *get_blended_blues( - boolean, boolean); - -/* This proc attempts to test for required fontinfo keywords - early in the running of buildfont, rather than have the lack - of one of them cause buildfont to blow up just as it goes - to assemble the font. */ - -extern void CheckRequiredKWs( - void); - -extern void ParseIntStems( - char *, boolean, long, int *, long *, char *); - -#endif /*FIPUBLIC_H*/ diff --git a/c/autohint/autohintlib/source/bf/hintfile.h b/c/autohint/autohintlib/source/bf/hintfile.h deleted file mode 100644 index ddc20954b..000000000 --- a/c/autohint/autohintlib/source/bf/hintfile.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -extern boolean ReadHintsFile(char *inFileName, PPathList path); -extern void RegisterBezHandlers(void); diff --git a/c/autohint/autohintlib/source/bf/illtobez.c b/c/autohint/autohintlib/source/bf/illtobez.c deleted file mode 100644 index 5fb18c5e5..000000000 --- a/c/autohint/autohintlib/source/bf/illtobez.c +++ /dev/null @@ -1,924 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* Converts Adobe illustrator files to bezier font editor format files */ -/* history: */ -/* JLee - Mar 19, 1987 include debugging flag */ -/* JLee - May 29, 1987 include scale factor */ -/* JLee - June 3, 1987 include -d option */ -/* JLee - October 19, 1987 extract width info from file */ -/* JLee - November 5, 1987 fix bug in initialize_widths */ - -#include "buildfont.h" -#include "bftoac.h" -#include "cryptdefs.h" -#include "fipublic.h" -#include "machinedep.h" - -#define MAXPOINTS 1500 -# -#define WIDTH(s) strindex(s, "%%Note:width") != -1 -#define ENDPROLOG(s) strindex(s, "%%EndProlog") != -1 -#define BEGINSETUP(s) strindex(s, "%%BeginSetup") != -1 -#define ENDSETUP(s) strindex(s, "%%EndSetup") != -1 -#define TRAILER(s) strindex(s, "%%Trailer") != -1 -#define NEWSTROKECOLOR 'G' -#define NEWFILLCOLOR 'g' -#define MOVETO 'm' -#define SMOOTHCURVETO 'c' -#define CORNERCURVETO 'C' -#define SMOOTHLINETO 'l' -#define CORNERLINETO 'L' -#define SMOOTHCOPY 'v' -#define CORNERCOPY 'V' -#define SMOOTHROLL 'y' -#define CORNERROLL 'Y' -#define FILL 'F' -#define FILLANDSTROKE 'B' -#define CLOSEANDFILL 'f' -#define CLOSEANDSTROKE 's' -#define CLOSEANDFILLANDSTROKE 'b' -#define STROKE 'S' -#define CLOSEANDNOPAINT 'n' -#define NOPAINT 'N' -#define MTINDEX 0 -#define LTINDEX 1 -#define CTINDEX 2 -#define BEZLINESIZE 64 - -typedef struct path_element { - Cd coord; - short tag; -} path_element; - -typedef struct char_width { - char name[MAXCHARNAME]; - short width; -} char_width; - -/* Globals */ -static boolean firstpath; /* 1st path in this character */ -static boolean width_found; /* width comment in ill. file */ -static boolean err; /* whether error occurred during conversion */ -static boolean printmsg; /* whether to print Converting msg */ -static boolean release; /* indicates release version */ -static indx np; /* number of points in path */ -static indx widthcnt; /* number of character widths */ -static long dict_entries; -static float scale; /* scale factor */ -static char_width *widthtab = NULL; -static path_element *path = NULL, *final_path = NULL; -static char tmpnm[sizeof(TEMPFILE) + sizeof(bezdir) + 3]; -static short convertedchars; - -extern void ConvertInputDirFiles(const char *dirname, tConvertfunc convertproc); - -static void illcleanup( - void); - -static boolean initialize_widths( - void); - -static void process_width( - FILE *, const char *, boolean); - -static void write_widths_file( - boolean); - -static boolean width_error( - const char *); - -static void toomanypoints( - const char *); - -static void convert( - FILE *, FILE *, const char *, const char *); - -static void do_path( - boolean, FILE *, const char *); - -static long findarea( - CdPtr, CdPtr, CdPtr); - -static boolean directionIsCW( - void); - -static void relative( - FILE *); - -#if ILLDEBUG -static dump_path( - boolean); -#endif - -static void illcleanup() { -#if DOMEMCHECK - memck_free(widthtab); - memck_free(path); - memck_free(final_path); -#else - UnallocateMem(widthtab); - UnallocateMem(path); - UnallocateMem(final_path); -#endif -} - -static boolean initialize_widths() { - FILE *wfile; - boolean widths_exist = FALSE; - long temp; - indx ix; - long cnt, maxChars = MAXCHARS; - char line[MAXLINE + 1]; /* input buffer */ - -#if DOMEMCHECK - widthtab = (struct char_width *)memck_malloc(maxChars * sizeof(char_width)); -#else - widthtab = (struct char_width *)AllocateMem(maxChars, sizeof(char_width), - "width table"); -#endif - for (ix = 0; ix < maxChars; ix++) - widthtab[ix].width = UNINITWIDTH; - widthcnt = dict_entries = 0; - if ((widths_exist = CFileExists(WIDTHSFILENAME, FALSE))) { - wfile = ACOpenFile(WIDTHSFILENAME, "r", OPENERROR); - while (fgets(line, MAXLINE, wfile) != NULL) { - if ((COMMENT(line)) || (BLANK(line))) - continue; - if ((ix = strindex(line, "/")) == -1) - continue; /* no character name on this line */ - if (widthcnt >= maxChars) { - maxChars += 100; -#if DOMEMCHECK - widthtab = (struct char_width *)memck_realloc(widthtab, (maxChars * sizeof(struct char_width))); -#else - widthtab = (struct char_width *)ReallocateMem( - (char *)widthtab, (unsigned)(maxChars * sizeof(struct char_width)), "width table"); -#endif - for (ix = maxChars - 100; ix < maxChars; ix++) - widthtab[ix].width = UNINITWIDTH; - } - cnt = sscanf(&line[ix + 1], " %s %ld WDef", widthtab[widthcnt].name, &temp); - if (cnt != 2) { - fclose(wfile); - sprintf(globmsg, "%s file line: %s cannot be parsed.\n It should have the format: / WDef", - WIDTHSFILENAME, line); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - CharNameLenOK(widthtab[widthcnt].name); - widthtab[widthcnt].width = (short)temp; - widthcnt++; - } - fclose(wfile); - } - return (widths_exist); -} - -static void process_width(FILE *infile, const char *name, boolean seen_width) { - indx n, ix; - long width, cnt; - float real_width, junk; - char line[MAXLINE + 1]; /* input buffer */ - - boolean char_exists = FALSE, done = FALSE; - - /* read width information */ - fgets(line, MAXLINE, infile); - cnt = sscanf(line, " %f %f", &real_width, &junk); - if (cnt != 2) { - fclose(infile); - sprintf(globmsg, "Width specified for %s character cannot be parsed.\n", name); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - /* skip past next "end of path" operator */ - while ((!done) && (fgets(line, MAXLINE, infile) != NULL)) { - n = (indx)strlen(line); - switch (line[n - 2]) /* the illustrator operator */ - { - case CLOSEANDNOPAINT: - case NOPAINT: - done = TRUE; - break; - case CLOSEANDSTROKE: - case STROKE: - case FILL: - case FILLANDSTROKE: - case CLOSEANDFILL: - case CLOSEANDFILLANDSTROKE: - sprintf(globmsg, "Width filled or stroked in %s character.\n", name); - LogMsg(globmsg, WARNING, OK, TRUE); - done = TRUE; - break; - } - } - width = SCALEDRTOL(real_width, scale); - width_found = TRUE; - /* Check if there is already an entry for this char. */ - for (ix = 0; ix < widthcnt; ix++) { - if (!strcmp(name, widthtab[ix].name)) { - if (widthtab[ix].width != width) { - if (seen_width) { - sprintf(globmsg, "2 different widths specified in %s character.\n", name); - LogMsg(globmsg, WARNING, OK, TRUE); - } - if ((widthtab[ix].width != UNINITWIDTH) || (seen_width)) { - sprintf(globmsg, "Width updated for %s character (old: %d, new: %ld).\n", name, (int)widthtab[ix].width, width); - LogMsg(globmsg, INFO, OK, FALSE); - } - widthtab[ix].width = (short)width; - } - char_exists = TRUE; - break; - } - } - if (!char_exists) { - strcpy(widthtab[widthcnt].name, name); - widthtab[widthcnt].width = (short)width; - widthcnt++; - } -} - -static void write_widths_file(boolean widths_exist) { - FILE *wfile; - indx i; - - if (widthcnt == 0) { - sprintf(globmsg, "No %s file written, because no widths were found.\n", - WIDTHSFILENAME); - LogMsg(globmsg, INFO, OK, FALSE); - return; - } - /* if widths.ps file already exists rename it to widths.ps.BAK */ - if (widths_exist) { - char backname[MAXFILENAME]; - - sprintf(backname, "%s.BAK", WIDTHSFILENAME); - RenameFile(WIDTHSFILENAME, backname); - } - wfile = ACOpenFile(TEMPFILE, "w", OPENERROR); - fprintf(wfile, "%d dict dup begin\n", (int)NUMMAX(widthcnt, dict_entries)); - for (i = 0; i < widthcnt; i++) { - fprintf(wfile, "/%s %d WDef\n", widthtab[i].name, - (int)widthtab[i].width); - } - fprintf(wfile, "end\n"); - fclose(wfile); - RenameFile(TEMPFILE, WIDTHSFILENAME); -} - -/* This procedure is called if a width comment is not found - while converting a font illustrator file */ -static boolean width_error(const char *name) { - indx ix; - - /* Check if width is already in width data structure */ - for (ix = 0; ix < widthcnt; ix++) { - if (!strcmp(name, widthtab[ix].name)) { - sprintf(globmsg, "No width in %s character description, using\nwidth of %d from %s file.\n", widthtab[ix].name, (int)widthtab[ix].width, WIDTHSFILENAME); - LogMsg(globmsg, INFO, OK, FALSE); - return (FALSE); - } - } - if (release) { - sprintf(globmsg, "No width was specified for the %s character.\n", name); - LogMsg(globmsg, LOGERROR, OK, TRUE); - return (TRUE); - } else { - sprintf(globmsg, - "No width was specified for the %s character.\n The default width of %d will be used.\n", - name, DEFAULTWIDTH); - LogMsg(globmsg, WARNING, OK, TRUE); - strcpy(widthtab[widthcnt].name, name); - widthtab[widthcnt].width = DEFAULTWIDTH; - widthcnt++; - return (FALSE); - } -} - -static void toomanypoints(const char *name) { - sprintf(globmsg, "%s character description has too many points (maximum is %d).\n", name, (int)MAXPOINTS); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); -} - -static void convert(FILE *infile, FILE *outfile, const char *charname, const char *filename) { - float color = 0.0; - float temp1, temp2, temp3, temp4, temp5, temp6; - indx n; - long cnt; - boolean white, seen_width = FALSE, seen_trailer = FALSE; - char op, line[MAXLINE + 1]; /* input buffer */ - - /* Skip prolog and script setup sections */ - while (fgets(line, MAXLINE, infile) != NULL) { - if (ENDPROLOG(line)) - break; - } - while (fgets(line, MAXLINE, infile) != NULL) { - if (BLANK(line)) - continue; - else - break; - } - if (BEGINSETUP(line)) - /* assume you will have an EndSetup and won't reach end of file */ - while (fgets(line, MAXLINE, infile) != NULL) { - if (ENDSETUP(line)) - break; /* EndSetup will be treated as comment below */ - } - np = 0; - do { - if (WIDTH(line)) { - process_width(infile, charname, seen_width); - seen_width = TRUE; - continue; - } - if (TRAILER(line)) { - if (np != 0) { - sprintf(globmsg, "Incomplete path at end of script section of %s character.\n", filename); - LogMsg(globmsg, WARNING, OK, TRUE); - } - seen_trailer = TRUE; - break; - } - if (COMMENT(line)) - continue; - n = (indx)strlen(line); - if (n < 2) { - sprintf(globmsg, "%s character description contains the invalid line:\n %s.\n", filename, line); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - switch (op = line[n - 2]) /* the illustrator operator */ - { - case CLOSEANDNOPAINT: - case NOPAINT: - case CLOSEANDSTROKE: - case STROKE: - case FILLANDSTROKE: - case CLOSEANDFILLANDSTROKE: - sprintf(globmsg, "%d point path with paint operator %c ignored in %s character.\n", np, op, filename); - LogMsg(globmsg, WARNING, OK, TRUE); - np = 0; - continue; - /* NOTREACHED */ - break; - case CLOSEANDFILL: - if (np > 2) { - if ((path[0].coord.x != path[np - 1].coord.x) || - (path[0].coord.y != path[np - 1].coord.y)) { - sprintf(globmsg, "%d point path in %s character is not closed. It will be ignored.\n", np, filename); - LogMsg(globmsg, WARNING, OK, TRUE); - np = 0; - continue; - } - } - case FILL: - if (np > 2) { - white = (color > 0.5); - do_path(white, outfile, filename); - } else { - sprintf(globmsg, "%d point filled path ignored in %s character.\n", - np, filename); - LogMsg(globmsg, WARNING, OK, TRUE); - np = 0; - continue; - } - np = 0; - break; - case NEWFILLCOLOR: - cnt = sscanf(line, " %f", &color); - if (cnt != 1) { - sprintf(globmsg, "Color specified for %s character cannot be parsed.\n", filename); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - break; - case MOVETO: - if (np != 0) { - sprintf(globmsg, "%d point path not ended before moveto in %s character.\n %s", np, filename, line); - LogMsg(globmsg, WARNING, OK, TRUE); - } - cnt = sscanf(line, " %f %f", &temp1, &temp2); - if (cnt != 2) { - sprintf(globmsg, "Moveto for %s character cannot be parsed.\n %s", filename, line); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - path[np].coord.x = SCALEDRTOL(temp1, scale); - path[np].coord.y = SCALEDRTOL(temp2, scale); - path[np].tag = MTINDEX; - np = 1; - break; - case SMOOTHLINETO: - case CORNERLINETO: - cnt = sscanf(line, " %f %f", &temp1, &temp2); - if (cnt != 2) { - sprintf(globmsg, "Lineto for %s character cannot be parsed.\n %s", filename, line); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if (np >= MAXPOINTS) - toomanypoints(filename); - path[np].coord.x = SCALEDRTOL(temp1, scale); - path[np].coord.y = SCALEDRTOL(temp2, scale); - path[np].tag = LTINDEX; - np++; - break; - case SMOOTHCURVETO: - case CORNERCURVETO: - cnt = sscanf(line, " %f %f %f %f %f %f", - &temp1, &temp2, &temp3, &temp4, &temp5, &temp6); - if (cnt != 6) { - sprintf(globmsg, "Curveto for %s character cannot be parsed.\n %s", filename, line); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if (np > (MAXPOINTS - 3)) - toomanypoints(filename); - path[np].coord.x = SCALEDRTOL(temp1, scale); - path[np].coord.y = SCALEDRTOL(temp2, scale); - path[np + 1].coord.x = SCALEDRTOL(temp3, scale); - path[np + 1].coord.y = SCALEDRTOL(temp4, scale); - path[np + 2].coord.x = SCALEDRTOL(temp5, scale); - path[np + 2].coord.y = SCALEDRTOL(temp6, scale); - path[np].tag = path[np + 1].tag = path[np + 2].tag = CTINDEX; - np += 3; - break; - case SMOOTHCOPY: /* x0 y0 x1 y1 2 copy curveto */ - case CORNERCOPY: - cnt = sscanf(line, " %f %f %f %f", &temp1, &temp2, &temp3, &temp4); - if (cnt != 4) { - sprintf(globmsg, "Curveto for%s character cannot be parsed.\n %s", filename, line); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if (np > (MAXPOINTS - 3)) - toomanypoints(filename); - path[np].coord = path[np - 1].coord; - path[np + 1].coord.x = SCALEDRTOL(temp1, scale); - path[np + 1].coord.y = SCALEDRTOL(temp2, scale); - path[np + 2].coord.x = SCALEDRTOL(temp3, scale); - path[np + 2].coord.y = SCALEDRTOL(temp4, scale); - path[np].tag = path[np + 1].tag = path[np + 2].tag = CTINDEX; - np += 3; - break; - case SMOOTHROLL: - case CORNERROLL: - cnt = sscanf(line, " %f %f %f %f", &temp1, &temp2, &temp3, &temp4); - if (cnt != 4) { - sprintf(globmsg, "Curveto for %s character cannot be parsed.\n %s", filename, line); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if (np > (MAXPOINTS - 3)) - toomanypoints(filename); - path[np].coord.x = SCALEDRTOL(temp1, scale); - path[np].coord.y = SCALEDRTOL(temp2, scale); - path[np + 2].coord.x = path[np + 1].coord.x = SCALEDRTOL(temp3, scale); - path[np + 2].coord.y = path[np + 1].coord.y = SCALEDRTOL(temp4, scale); - path[np].tag = path[np + 1].tag = path[np + 2].tag = CTINDEX; - np += 3; - break; - } /* switch */ - } while (fgets(line, MAXLINE, infile) != NULL); - if (!seen_trailer) { - sprintf(globmsg, "No \"%%TRAILER\" line in file for %s character\n - file probably truncated.\n", filename); - LogMsg(globmsg, WARNING, OK, TRUE); - } -} /* end convert */ - -static void do_path(boolean white, FILE *outfile, const char *name) { - indx n, elem; - path_element *p, *fp; - long tag; - boolean cw, reverse; - boolean open = ((path[0].coord.x != path[np - 1].coord.x) || - (path[0].coord.y != path[np - 1].coord.y)); - - cw = directionIsCW(); -#if ILLDEBUG - fprintf(OUTPUTBUFF, "%s\n", (white ? "WHITE" : "BLACK")); -#endif - reverse = ((white && !cw) || (!white && cw)); - if (reverse) /* reverse path direction */ - { - n = np; - p = &path[np - 1]; - - /* Start at end with a moveto and adjust tags going backwards. */ - tag = p->tag; - p->tag = MTINDEX; - p--; - n--; -#if ILLDEBUG - fprintf(OUTPUTBUFF, "Reversing %d point path in character %s.\n", np, name); -#endif - - while (n > 0) { - switch (tag) { - case CTINDEX: - p -= 2; - tag = p->tag; - p->tag = CTINDEX; - p--; - n -= 3; - break; - - case LTINDEX: - tag = p->tag; - p->tag = LTINDEX; - p--; - n--; - break; - - case MTINDEX: - fprintf(OUTPUTBUFF, "Moveto on reverse in character %s.\n", name); - cleanup(NONFATALERROR); - break; - } - } - -#if ILLDEBUG - dump_path(reverse); - fprintf(OUTPUTBUFF, "Path before restarting, np=%d\n", np); -#endif - - /* If last point is a Lineto, replace it with a closepath. If there are - no Lineto's, add a closepath at the end. Otherwise, find some Lineto, - replace it with a closepath and rearrange the path so that the - closepath is at the end. */ - elem = np - 1; - if (!open) { - if (path[0].tag != LTINDEX) { - p = &path[np - 1]; - for (n = np - 1; n >= 0; n--, p--) { - if (p->tag == LTINDEX) { - elem = n - 1; - np--; - break; - } - } - } else - np--; - } - - p = &path[elem]; - fp = &final_path[0]; - fp->tag = MTINDEX; - - if (p->tag == MTINDEX) { - fp->coord = p->coord; - fp++; - p--; - } else { - fp->coord = path[elem + 1].coord; - fp++; - } - - for (n = 1; n < np; n++) { /* copies from path [elem] or path[elem-1] to path[0] */ - *fp = *p; - fp++; - p--; - if (--elem < 0) { /* resets p to copy from path[np-1] to path[elem] */ - p = &path[np - 1]; - elem = np - 1; - } - } - } else /* dump as is -- do not reverse direction */ - { -#if ILLDEBUG - fprintf(OUTPUTBUFF, "No reverse\n"); - dump_path(reverse); -#endif - /* If last point is a Lineto, replace it with a closepath. If there are - no Lineto's, add a closepath at the end. Otherwise, find some Lineto, - replace it with a closepath and rearrange the path so that the - closepath is at the end. */ - elem = 0; - if (!open) { - if (path[np - 1].tag != LTINDEX) { - p = &path[0]; - for (n = 0; n < np; n++, p++) { - if (p->tag == LTINDEX) { - elem = n + 1; - np--; - break; - } - } - } else { - np--; - } - } - p = &path[elem]; - fp = &final_path[0]; - fp->tag = MTINDEX; - if (p->tag == MTINDEX) { - fp->coord = p->coord; - p++; - } else { - fp->coord = path[elem - 1].coord; - } - fp++; - for (n = 1; n < np; n++) { /* copies from path[elem] or path[elem+1] to path[np] */ - *fp = *p; - fp++; - p++; - if (++elem >= np) { /* resets to copy from path[0] to path[elem] */ - p = &path[0]; - elem = 0; - } - } - } - relative(outfile); -} /* end do_path */ - -static long findarea(CdPtr p1, CdPtr p2, CdPtr sp) { - long v1x, v1y, v2x, v2y; - - v1x = p1->x - sp->x; - v1y = p1->y - sp->y; - v2x = p2->x - sp->x; - v2y = p2->y - sp->y; - /* Cross product = area of parallelogram defined by vectors v1 & v2. */ - return ((v1x * v2y) - (v2x * v1y)); -} - -static boolean directionIsCW() { - path_element *p = path; - long area, n; - Cd c1, c2, old_point, sp; - - area = 0; - n = np; - /* Initialize the stationary point about which the area is computed */ - sp = p->coord; - /* Traverse list of points, accumulating total area. */ - while (n > 0) { - switch (p->tag) { - case MTINDEX: - n--; - break; - case LTINDEX: - area += findarea(&old_point, &p->coord, &sp); - n--; - break; - case CTINDEX: - c1 = p->coord; - p++; - c2 = p->coord; - p++; - area = area + findarea(&old_point, &c1, &sp) + findarea(&c1, &c2, &sp) + findarea(&c2, &p->coord, &sp); - n -= 3; - break; - } - old_point = p->coord; - p++; - } - return (area < 0.0); -} /* direction */ - -/* Convert to relative format */ - -static void relative(FILE *outfile) { - path_element *p, *p1, *p2; - long i, dx, dy; -#if ILLDEBUG - static char op[3] = {'M', 'L', 'C'}; -#endif - static Cd cp; /* current position */ - static char buff[500]; - - p = &final_path[0]; - i = np; -#if ILLDEBUG - fprintf(OUTPUTBUFF, "Path before relativising,np=%d\n", np); - while (i > 0) { - if (p->tag == CTINDEX) { - fprintf(OUTPUTBUFF, "%ld %ld ", p->coord.x, p->coord.y); - p++; - fprintf(OUTPUTBUFF, "%ld %ld ", p->coord.x, p->coord.y); - p++; - fprintf(OUTPUTBUFF, "%ld %ld %c\n", p->coord.x, p->coord.y, op[p->tag]); - p++; - i -= 3; - } else { - fprintf(OUTPUTBUFF, "%ld %ld %c\n", p->coord.x, p->coord.y, op[p->tag]); - p++; - i--; - } - } -#endif - p = &final_path[0]; - i = np; - while (i > 0) { - switch (p->tag) { - case MTINDEX: - if (firstpath) { - sprintf(buff, "%ld %ld rmt\n", p->coord.x, p->coord.y); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - firstpath = FALSE; - } else { - dy = p->coord.y - cp.y; - if ((dx = p->coord.x - cp.x) == 0) { - sprintf(buff, "%ld vmt\n", dy); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - } else if (dy == 0) { - sprintf(buff, "%ld hmt\n", dx); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - } else { - sprintf(buff, "%ld %ld rmt\n", dx, dy); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - } - } - cp = p->coord; - p++; - i--; - break; - case LTINDEX: - dy = p->coord.y - cp.y; - if ((dx = p->coord.x - cp.x) == 0) { - sprintf(buff, "%ld vdt\n", dy); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - } else if (dy == 0) { - sprintf(buff, "%ld hdt\n", dx); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - } else { - sprintf(buff, "%ld %ld rdt\n", dx, dy); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - } - cp = p->coord; - p++; - i--; - break; - case CTINDEX: - p1 = p + 1; - p2 = p + 2; - - if (((dx = (p->coord.x - cp.x)) == 0) && (p2->coord.y == p1->coord.y)) /* vhct */ - { - sprintf(buff, "%ld %ld %ld %ld vhct\n", - p->coord.y - cp.y, p1->coord.x - p->coord.x, - p1->coord.y - p->coord.y, p2->coord.x - p1->coord.x); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - } else if (((dy = (p->coord.y - cp.y)) == 0) && (p2->coord.x == p1->coord.x)) /* hvct */ - { - sprintf(buff, "%ld %ld %ld %ld hvct\n", - dx, p1->coord.x - p->coord.x, - p1->coord.y - p->coord.y, p2->coord.y - p1->coord.y); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - } else /* rct */ - { - sprintf(buff, "%ld %ld ", dx, dy); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - sprintf(buff, "%ld %ld ", p1->coord.x - p->coord.x, p1->coord.y - p->coord.y); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - sprintf(buff, "%ld %ld rct\n", p2->coord.x - p1->coord.x, p2->coord.y - p1->coord.y); - (void)DoContEncrypt(buff, outfile, FALSE, INLEN); - } - cp = p2->coord; - p += 3; - i -= 3; - break; - } - } - (void)DoContEncrypt("cp\n", outfile, FALSE, INLEN); /* closepath */ -} /* end relative */ - -#if ILLDEBUG -static dump_path(boolean reverse) { - static char op[3] = {'M', 'L', 'C'}; - long n; - path_element *p; - - n = np; - if (reverse) { - /* Dump path after reversal. */ - fprintf(OUTPUTBUFF, "Dump of reversed path\n"); - p = &path[np - 1]; - while (n > 0) { - if (p->tag == CTINDEX) { - fprintf(OUTPUTBUFF, "%-10.3d %-10.3d", p->coord.x, p->coord.y); - p--; - fprintf(OUTPUTBUFF, "%-10.3d %-10.3d", p->coord.x, p->coord.y); - p--; - fprintf(OUTPUTBUFF, "%-10.3d %-10.3d %c\n", p->coord.x, p->coord.y, op[p->tag]); - p--; - n -= 3; - } else { - fprintf(OUTPUTBUFF, "%-10.3d %-10.3d %c\n", p->coord.x, p->coord.y, op[p->tag]); - p--; - n--; - } - } - } else { - fprintf(OUTPUTBUFF, "Dump of unreversed path\n"); - p = path; - while (n > 0) { - if (p->tag == CTINDEX) { - fprintf(OUTPUTBUFF, "%-10.3d %-10.3d", p->coord.x, p->coord.y); - p++; - fprintf(OUTPUTBUFF, "%-10.3d %-10.3d", p->coord.x, p->coord.y); - p++; - fprintf(OUTPUTBUFF, "%-10.3d %-10.3d %c\n", p->coord.x, p->coord.y, op[p->tag]); - p++; - n -= 3; - } else { - fprintf(OUTPUTBUFF, "%-10.3d %-10.3d %c\n", p->coord.x, p->coord.y, op[p->tag]); - p++; - n--; - } - } - } -} - -#endif - -void convert_illcharfile(const char *charname, const char *filename) { - FILE *infile, *outfile; - char inname[MAXPATHLEN], outname[MAXPATHLEN]; - - firstpath = TRUE; - width_found = FALSE; - get_filename(inname, ILLDIR, filename); - get_filename(outname, bezdir, filename); - - infile = ACOpenFile(inname, "r", OPENWARN); - if (infile == NULL) return; - outfile = ACOpenFile(tmpnm, "w", OPENERROR); - DoInitEncrypt(outfile, OTHER, HEX, (long)BEZLINESIZE, FALSE); - WriteStart(outfile, charname); - convert(infile, outfile, charname, filename); - (void)DoContEncrypt("ed\n", outfile, FALSE, INLEN); - if (!width_found) - err = err || width_error(charname); - fclose(infile); - fclose(outfile); - RenameFile(tmpnm, outname); - if (printmsg) { - LogMsg("Converting Adobe Illustrator(R) files ...", - INFO, OK, FALSE); - printmsg = FALSE; - } - convertedchars++; -} - -extern void set_scale(float *newscale) { - float temp; - long cnt; - char *fontinfostr; - - *newscale = 1; - fontinfostr = GetFntInfo("ScalePercent", ACOPTIONAL); - if (fontinfostr == NULL) - return; - cnt = sscanf(fontinfostr, " %f", &temp); - if (cnt != 1) { - sprintf(globmsg, "ScalePercent line of fontinfo file invalid.\n"); -#if DOMEMCHECK - memck_free(fontinfostr); -#else - UnallocateMem(fontinfostr); -#endif - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } -#if DOMEMCHECK - memck_free(fontinfostr); -#else - UnallocateMem(fontinfostr); -#endif - *newscale = temp / (float)100; -} - -void convert_illfiles(boolean rel) { - boolean widths_exist; - boolean result = TRUE; - - release = rel; - printmsg = TRUE; - illcleanup(); /* just in case last caller exited with error */ - widths_exist = initialize_widths(); - set_scale(&scale); - get_filename(tmpnm, bezdir, TEMPFILE); - -#if DOMEMCHECK - path = (struct path_element *)memck_malloc(MAXPOINTS * sizeof(path_element)); - final_path = (struct path_element *)memck_malloc(MAXPOINTS * sizeof(path_element)); -#else - path = (struct path_element *)AllocateMem(MAXPOINTS, sizeof(path_element), - "path structure"); - final_path = (struct path_element *)AllocateMem(MAXPOINTS, sizeof(path_element), "final path structure"); -#endif - convertedchars = 0; -#if SUN - ConvertCharFiles(ILLDIR, release, scale, convert_illcharfile); -#elif WIN32 - ConvertCharFiles(ILLDIR, release, scale, convert_illcharfile); -#else - ConvertInputDirFiles(ILLDIR, convert_illcharfile); -#endif - if (convertedchars > 0) { - sprintf(globmsg, " %d files converted.\n", (int)convertedchars); - LogMsg(globmsg, INFO, OK, FALSE); - if (scale != 1.0) { - sprintf(globmsg, "Widths in the original %s file were not scaled.\n", WIDTHSFILENAME); - LogMsg(globmsg, WARNING, OK, TRUE); - } - } - if (err || !result) - cleanup(NONFATALERROR); - write_widths_file(widths_exist); - illcleanup(); -} diff --git a/c/autohint/autohintlib/source/bf/machinedep.c b/c/autohint/autohintlib/source/bf/machinedep.c deleted file mode 100644 index 6d7fcd740..000000000 --- a/c/autohint/autohintlib/source/bf/machinedep.c +++ /dev/null @@ -1,616 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* machinedep.c - -history: - -JLee April 8, 1988 - -Judy Lee: Wed Jul 6 17:55:30 1988 -End Edit History -*/ -#include /* Needed only for _O_RDWR definition */ -#include - -#include -#include -#ifdef WIN32 -#include -#else -#include -#endif -#include - -#include -extern char *ctime(); - -#ifdef WIN32 -#include -/* as of Visual Studi 2005, the POSIX names are deprecated; need to use -Windows specific names instead. -*/ -#include -#define chdir _chdir -#define mkdir _mkdir -#define getcwd _getcwd - -#include -#define access _access -#else -#include /* for access(), lockf() */ -#endif - -#include "ac.h" -#include "fipublic.h" -#include "machinedep.h" - -#define CURRENTID "CurrentID" -#define MAXID "MaxID" -#define MAXUNIQUEID 16777215L /* 2^24 - 1 */ -#define BUFFERSZ 512 /* buffer size used by unique id file */ -#define MAXIDFILELEN 100 /* maximum length of line in unique id file */ - -static char ibmfilename[] = "ibmprinterfont.unprot"; -static char uniqueIDFile[MAXPATHLEN]; -static short warncnt = 0; -#if defined(__MWERKS__) -static char Delimiter[] = "/"; -#elif defined(WIN32) -static char Delimiter[] = "\\"; -#else -static char Delimiter[] = "/"; -#endif - -static int (*errorproc)(short); /* proc to be called from LogMsg if error occurs */ - -/* used for cacheing of log messages */ -static char lastLogStr[MAXMSGLEN + 1] = ""; -static short lastLogLevel = -1; -static boolean lastLogPrefix; -static int logCount = 0; - -static void LogMsg1(char *str, short level, short code, boolean prefix); - -short WarnCount() { - return warncnt; -} - -void ResetWarnCount() { - warncnt = 0; -} - -#ifdef IS_LIB -#define Write(s) \ - { \ - if (libReportCB != NULL) libReportCB(s); \ - } -#define WriteWarnorErr(f, s) \ - { \ - if (libErrorReportCB != NULL) libErrorReportCB(s); \ - } -#else -#define Write(s) -#define WriteWarnorErr(f, s) -#endif - -void set_errorproc(userproc) int (*userproc)(short); -{ - errorproc = userproc; -} - -/* called by LogMsg and when exiting (tidyup) */ -void FlushLogMsg(void) { - /* if message happened exactly 2 times, don't treat it specially */ - if (logCount == 1) { - LogMsg1(lastLogStr, lastLogLevel, OK, lastLogPrefix); - } else if (logCount > 1) { - char newStr[MAXMSGLEN]; - sprintf(newStr, "The last message (%.20s...) repeated %d more times.\n", - lastLogStr, logCount); - LogMsg1(newStr, lastLogLevel, OK, TRUE); - } - logCount = 0; -} - -void LogMsg( - char *str, /* message string */ - short level, /* error, warning, info */ - short code, /* exit value - if !OK, this proc will not return */ - boolean prefix /* prefix message with LOGERROR: or WARNING:, as appropriate */) { - /* changed handling of this to be more friendly (?) jvz */ - if (strlen(str) > MAXMSGLEN) { - LogMsg1("The following message was truncated.\n", WARNING, OK, TRUE); - ++warncnt; - } - if (level == WARNING) - ++warncnt; - if (!strcmp(str, lastLogStr) && level == lastLogLevel) { - ++logCount; /* same message */ - } else { /* new message */ - if (logCount) /* messages pending */ - FlushLogMsg(); - LogMsg1(str, level, code, prefix); /* won't return if LOGERROR */ - strncpy(lastLogStr, str, MAXMSGLEN); - lastLogLevel = level; - lastLogPrefix = prefix; - } -} - -static void LogMsg1(char *str, short level, short code, boolean prefix) { - switch (level) { - case INFO: - Write(str); - break; - case WARNING: - if (prefix) - WriteWarnorErr(stderr, "WARNING: "); - WriteWarnorErr(stderr, str); - break; - case LOGERROR: - if (prefix) - WriteWarnorErr(stderr, "ERROR: "); - WriteWarnorErr(stderr, str); - break; - default: - WriteWarnorErr(stderr, "ERROR - log level not recognized: "); - WriteWarnorErr(stderr, str); - break; - } - if (level == LOGERROR && (code == NONFATALERROR || code == FATALERROR)) { - (*errorproc)(code); - } -} - -void getidfilename(str) char *str; -{ - strcpy(str, uniqueIDFile); -} - -void set_uniqueIDFile(str) char *str; -{ - strcpy(uniqueIDFile, str); -} - -static char afmfilename[] = "AFM"; -static char macfilename[] = "macprinterfont.unprot"; - -void get_filename(char *name, char *str, const char *basename) { - sprintf(name, "%s%s%s", str, Delimiter, basename); -} - -void get_afm_filename(name) char *name; -{ - strcpy(name, afmfilename); -} - -void get_ibm_fontname(ibmfontname) char *ibmfontname; -{ - strcpy(ibmfontname, ibmfilename); -} - -void get_mac_fontname(macfontname) char *macfontname; -{ - strcpy(macfontname, macfilename); -} - -void get_time(time_t *value) { - time(value); -} - -void get_datetime(datetimestr) char *datetimestr; -{ - time_t secs; - - get_time(&secs); - strncpy(datetimestr, ctime(&secs), 24); - /* skip the 24th character, which is a newline */ - datetimestr[24] = '\0'; -} - -/* Sets the current directory to the one specified. */ -void set_current_dir(current_dir) char *current_dir; -{ - if ((chdir(current_dir)) != 0) { - sprintf(globmsg, "Unable to cd to directory: '%s'.\n", current_dir); - LogMsg(globmsg, WARNING, OK, TRUE); - } -} - -void get_current_dir(char *currdir) { - (void)getcwd(currdir, MAXPATHLEN); -} - -/* Returns true if the given file exists, is not a directory - and user has read permission, otherwise it returns FALSE. */ -boolean FileExists(const char *filename, short errormsg) { - struct stat stbuff; - int filedesc; - - if ((strlen(filename) == 0) && !errormsg) - return FALSE; - /* Check if this file exists and if it is a directory. */ - if (stat(filename, &stbuff) == -1) { - if (errormsg) { - sprintf(globmsg, "The %s file does not exist, but is required.\n", filename); - LogMsg(globmsg, LOGERROR, OK, TRUE); - } - return FALSE; - } - if ((stbuff.st_mode & S_IFMT) == S_IFDIR) { - if (errormsg) { - sprintf(globmsg, "%s is a directory not a file.\n", filename); - LogMsg(globmsg, LOGERROR, OK, TRUE); - } - return FALSE; - } else - - /* Check for read permission. */ - if ((filedesc = access(filename, R_OK)) == -1) { - if (errormsg) { - sprintf(globmsg, "The %s file is not accessible.\n", filename); - LogMsg(globmsg, LOGERROR, OK, TRUE); - } - return FALSE; - } - - return TRUE; -} - -boolean CFileExists(const char *filename, short errormsg) { - return FileExists(filename, errormsg); -} - -boolean DirExists(char *dirname, boolean absolute, boolean create, boolean errormsg) { -#ifndef WIN32 -#pragma unused(absolute) -#endif - long int access_denied = access(dirname, F_OK); - - if (access_denied) { - if (errno == EACCES) { - sprintf(globmsg, "The %s directory cannot be accessed.\n", dirname); - LogMsg(globmsg, LOGERROR, OK, TRUE); - return FALSE; - } else { - if (errormsg) { - sprintf(globmsg, "The %s directory does not exist.", dirname); - LogMsg(globmsg, create ? WARNING : LOGERROR, OK, TRUE); - } - if (!create) { - if (errormsg) - LogMsg("\n", LOGERROR, OK, FALSE); - return FALSE; - } - if (errormsg) - LogMsg(" It will be created for you.\n", WARNING, OK, FALSE); - { -#ifdef WIN32 - int result = mkdir(dirname); -#else - int result = mkdir(dirname, 00775); -#endif - - if (result) { - sprintf(globmsg, "Can't create the %s directory.\n", dirname); - LogMsg(globmsg, LOGERROR, OK, TRUE); - return FALSE; - } - } /* end local block for mkdir */ - } - } - return TRUE; -} - -/* Returns the full name of the input directory. */ -void GetInputDirName(name, suffix) char *name; -char *suffix; -{ - char currdir[MAXPATHLEN]; - - getcwd(currdir, MAXPATHLEN); - sprintf(name, "%s%s%s", currdir, Delimiter, suffix); -} - -unsigned long ACGetFileSize(filename) char *filename; -{ - struct stat filestat; - - if ((stat(filename, &filestat)) < 0) return (0); -#ifdef CW80 - return ((unsigned long)filestat.st_mtime); -#else - return ((unsigned long)filestat.st_size); -#endif -} - -void RenameFile(oldName, newName) char *oldName, *newName; -{ - if (FileExists(newName, FALSE)) { - if (remove(newName)) { - sprintf(globmsg, "Could not remove file: %s for renaming (%d).\n", newName, errno); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - } - if (rename(oldName, newName)) { - sprintf(globmsg, "Could not rename file: %s to: %s (%d).\n", oldName, newName, errno); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } -} - -void MoveDerivedFile(filename, basedir, fromDir, toDir) char *filename, *basedir, *fromDir, *toDir; -{ - char fromname[MAXPATHLEN], toname[MAXPATHLEN]; - - if (basedir == NULL) { - get_filename(fromname, fromDir, filename); - get_filename(toname, toDir, filename); - } else { - sprintf(fromname, "%s%s%s%s", basedir, fromDir, Delimiter, filename); - sprintf(toname, "%s%s%s%s", basedir, toDir, Delimiter, filename); - } - RenameFile(fromname, toname); -} - -void AppendFile(start, end) char *start, *end; -{ - FILE *file1, *file2; - char buffer[200]; - file2 = ACOpenFile(end, "r", OPENOK); - if (file2 == NULL) - return; - file1 = ACOpenFile(start, "a", OPENWARN); - while (fgets(buffer, 200, file2) != NULL) - fputs(buffer, file1); - fclose(file1); - fclose(file2); -} - -/* Converts :'s to /'s. Colon's before the first alphabetic - character are converted to ../ */ -char *CheckBFPath(baseFontPath) char *baseFontPath; -{ - char *uponelevel = "../"; - char *startpath, *oldsp; - char newpath[MAXPATHLEN]; - short length; - - newpath[0] = '\0'; - if (strchr(baseFontPath, *Delimiter) == NULL) { - if (*baseFontPath == *Delimiter) - LogMsg( - "BaseFontPath keyword in fontinfo file must indicate a relative path name.\n", - LOGERROR, NONFATALERROR, TRUE); - return baseFontPath; - } - - /* Find number of colons at the start of the path */ - switch (length = (short)strspn(baseFontPath, Delimiter)) { - case (0): - break; - case (1): - LogMsg( - "BaseFontPath keyword in fontinfo file must indicate a relative path name.\n", - LOGERROR, NONFATALERROR, TRUE); - break; - default: - /* first two colons => up one, any subsequent single colon => up one */ - for (startpath = baseFontPath + 1; - startpath < baseFontPath + length; startpath++) - if (*startpath == *Delimiter) - strcat(newpath, uponelevel); - break; - } - - length = (short)strlen(startpath); - /* replace all colons by slashes in remainder of input string - - Note: this does not handle > 1 colon embedded in the middle of - a Mac path name correctly */ - for (oldsp = startpath; startpath < oldsp + length; startpath++) - if (*startpath == *Delimiter) - *startpath = *Delimiter; -#if DOMEMCHECK - startpath = memck_malloc((strlen(newpath) + length + 1) * sizeof(char)); -#else - startpath = AllocateMem(((unsigned int)strlen(newpath)) + length + 1, sizeof(char), - "return string for CheckBFPath"); -#endif - strcpy(startpath, newpath); - strcat(startpath, oldsp); -#if DOMEMCHECK - memck_free(baseFontPath); -#else - UnallocateMem(baseFontPath); -#endif - return startpath; -} - -/* Dummy procedures */ - -void CreateResourceFile(filename) char *filename; -{ -#ifndef WIN32 -#pragma unused(filename) -#endif -} - -/* Returns full pathname of current working directory. */ -void GetFullPathname(char *dirname, short vRefNum, long dirID) { -#ifndef WIN32 -#pragma unused(vRefNum) -#pragma unused(dirID) -#endif - getcwd(dirname, MAXPATHLEN); - /* Append unix delimiter. */ - strcat(dirname, Delimiter); -} - -/* Creates a file called .BFLOCK or .ACLOCK in the current directory. - If checkexists is TRUE this proc will check if .BFLOCK or .ACLOCK exists - before creating it. If it does exist an error message will - be displayed and buildfont will exit. - The .BFLOCK file is used to indicate that buildfont is currently - being run in the directory. The .ACLOCK file is used to indicate - that AC is currently being run in the directory. */ -boolean createlockfile(fileToOpen, baseFontPath) char *fileToOpen; -char *baseFontPath; /* for error msg only; cd has been done */ -{ - FILE *bf; - - if (CFileExists(BFFILE, FALSE)) { - sprintf(globmsg, "BuildFont is already running in the %s directory.\n", - (strlen(baseFontPath)) ? baseFontPath : "current"); - LogMsg(globmsg, LOGERROR, OK, TRUE); - return FALSE; - } - if (CFileExists(ACFILE, FALSE)) { - sprintf(globmsg, "AC is already running in the %s directory.\n", - (strlen(baseFontPath)) ? baseFontPath : "current"); - LogMsg(globmsg, LOGERROR, OK, TRUE); - return FALSE; - } - bf = ACOpenFile(fileToOpen, "w", OPENOK); - if (bf == NULL) { - sprintf(globmsg, - "Cannot open the %s%s file.\n", baseFontPath, fileToOpen); - LogMsg(globmsg, LOGERROR, OK, TRUE); - return FALSE; - } - fclose(bf); - return TRUE; -} - -void SetMacFileType(filename, filetype) char *filename; -char *filetype; -{ -#ifndef WIN32 -#pragma unused(filename) -#pragma unused(filetype) -#endif -} - -void closefiles() { -#ifndef IS_LIB - Write("Warning: closefiles unimplemented\n"); -#endif - /* register int counter, bad_ones = 0; -*/ - /* leave open stdin, stdout, stderr and console */ - /*for (counter = 4; counter < _NFILE; counter++) - if (fclose(&_file[counter])) - bad_ones++; - */ -} - -void get_filedelimit(delimit) char *delimit; -{ - strcpy(delimit, Delimiter); -} - -/* -extern get_afm_filename(char *name) -{ - char fontname[MAXFILENAME]; - - get_mac_fontname(fontname); - sprintf(name, "%s%s", fontname, ".AFM"); - FileNameLenOK(name); -} - -extern get_ibm_fontname(ibmfontname) -char *ibmfontname; -{ - char *fontinfostr; - - if ((fontinfostr = GetFntInfo("PCFileNamePrefix", ACOPTIONAL)) == NULL) - strcpy(ibmfontname, ibmfilename); - else - { - if (strlen(fontinfostr) != 5) - { - sprintf(globmsg, "PCFileNamePrefix in the %s file must be exactly 5 characters.\n", FIFILENAME); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - strcpy(ibmfontname, fontinfostr); - strcat(ibmfontname, "___.PFB"); - FreeFontInfo(fontinfostr); - } -} - -extern get_mac_fontname(macfontname) -char *macfontname; -{ - char *fontinfostr, *fontname; - - fontinfostr = GetFntInfo("FontName", MANDATORY); - fontname = printer_filename(fontinfostr); - strcpy(macfontname, fontname); - FreeFontInfo(fontinfostr); - UnallocateMem(fontname); -} - -extern get_time(value) -long *value; -{ - GetDateTime(value); -} - -extern get_datetime(char *datetimestr) -{ - long secs; - char datestr[25], timestr[25]; - - get_time(&secs); - IUDateString(secs, abbrevDate, datestr); - IUTimeString(secs, TRUE, timestr); - sprintf(datetimestr, "%p %p", datestr, timestr); -} -*/ -/* copies from one path ref num to another - can be different forks of same file */ - -char *MakeTempName(char *dirprefix, char *fileprefix) { -#ifndef WIN32 -#pragma unused(dirprefix) -#pragma unused(fileprefix) -#endif - return NULL; -} - -int AutoCrit(char *filenameparam, char *goo) { -#ifndef WIN32 -#pragma unused(filenameparam) -#pragma unused(goo) -#endif - return 0; -} - -int bf_alphasort(const void *f1, const void *f2) { - struct direct **mf1, **mf2; - mf1 = (struct direct **)f1; - mf2 = (struct direct **)f2; - return strcmp((*mf1)->d_name, (*mf2)->d_name); -} - -#if defined(_MSC_VER) && (_MSC_VER < 1800) -float roundf(float x) { - float val = (float)((x < 0) ? (ceil((x)-0.5)) : (floor((x) + 0.5))); - return val; -} -#endif - -unsigned char *CtoPstr(char *filename) { - int i, length = (int)strlen(filename); - for (i = length; i > 0; i--) - filename[i] = filename[i - 1]; - filename[0] = length; - return (unsigned char *)filename; -} - -char *PtoCstr(unsigned char *filename) { - int i, length = filename[0]; - for (i = 0; i < length; i++) - filename[i] = filename[i + 1]; - filename[i] = '\0'; - - return (char *)filename; -} diff --git a/c/autohint/autohintlib/source/bf/machinedep.h b/c/autohint/autohintlib/source/bf/machinedep.h deleted file mode 100644 index 357c99585..000000000 --- a/c/autohint/autohintlib/source/bf/machinedep.h +++ /dev/null @@ -1,148 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* machinedep.h - defines machine dependent procedures used by - buildfont. - -history: - -Judy Lee: Mon Jul 18 14:13:03 1988 -End Edit History -*/ - -#include "basic.h" - -#ifndef MACHINEDEP_H -#define MACHINEDEP_H - -#if WIN32 -#include -#include -#else -#include -#endif - -#define fileeof(p) feof(p) -#define fileerror(p) ferror(p) - -#define ACFILE ".ACLOCK" /* zero length file to indicate that AC */ - /* is running in current directory. */ - -#define BFFILE ".BFLOCK" /* zero length file to indicate that buildfont */ - /* is running in current directory. */ - -extern void FlushLogMsg(void); - -extern boolean createlockfile( - char *, char *); - -extern void set_errorproc(int (*)(short)); - -extern void closefiles( - void); - -extern void get_filedelimit( - char *); - -extern void get_time(time_t *); - -/* Gets the date and time. */ -extern void get_datetime( - char *); - -/* delimits str with / or : */ -extern void get_filename( - char *, char *, const char *); - -/* Returns name of AFM file. */ -extern void get_afm_filename( - char *); - -/* Returns name of IBM printer file. */ -extern void get_ibm_fontname( - char *); - -/* Returns name of Mac printer file. */ -extern void get_mac_fontname( - char *); - -/* Returns the full path name given ref num and dirID. - If dirID is MININT then it returns the pathname of - the current working directory. On UNIX it always - returns the current working directory. */ -extern void GetFullPathname( - char *, short, long); - -extern char *CheckBFPath( - char *); - -extern void GetInputDirName( - char *, char *); - -extern unsigned long ACGetFileSize( - char *); - -/* Checks if the character set directory exists. */ -extern boolean DirExists( - char *, boolean, boolean, boolean); - -/* Checks for the existence of the specified file. */ -extern boolean FileExists( - const char *, short); - -/* Checks for the existence of the specified file. */ -extern boolean CFileExists( - const char *, short); - -extern void MoveDerivedFile( - char *, char *, char *, char *); - -/* Creates the resource file for the Macintosh downloadable printer font. */ -extern void CreateResourceFile( - char *); - -extern void RenameFile( - char *, char *); - -extern void set_current_dir( - char *); - -extern void get_current_dir( - char *); - -extern void SetMacFileType( - char *, char *); - -extern void ScanBezFiles( - boolean, indx, boolean); - -extern void ScanDirFiles( - boolean, char *); - -extern void AppendFile( - char *, char *); - -extern char *MakeTempName( - char *, char *); - -extern int AutoCrit( - char *, char *); - -public -procedure FlushLogFiles(); -public -procedure OpenLogFiles(); -typedef int (*includeFile)(struct direct *); -typedef int (*sortFn)(const void *, const void *); - -extern char *GetPathName( - char *); - -extern int bf_alphasort(const void *f1, const void *f2); - -#if defined(_MSC_VER) && (_MSC_VER < 1800) -public -float roundf(float x); -#endif - -#endif /*MACHINEDEP_H*/ diff --git a/c/autohint/autohintlib/source/bf/masterfont.h b/c/autohint/autohintlib/source/bf/masterfont.h deleted file mode 100644 index 8c9548fef..000000000 --- a/c/autohint/autohintlib/source/bf/masterfont.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* masterfont.h */ - -#ifndef MASTERFONT_H -#define MASTERFONT_H - -#define MAXDESIGNS 16 /* maximum number of base designs for a multiple master font. */ - -extern void BlendIntArray( - int *, int, int, char *); - -extern void BlendFltArray( - float *, int, int, char *); - -/* Returns the default weight value for this directory. */ -extern float DefaultWeightForDir( - int); - -extern void DefaultWeightVector( - char *); - -extern void FreeDirEntries( - void); - -extern void GetMasterDirName( - char *, indx); - -extern int GetMasterDirIx( - char *); - -extern short GetMasterFontList( - char *); - -extern int InteriorDesignsExist( - void); - -extern void PrintInputDirNames( - void); - -extern void SetDefaultWeightVector( - void); - -extern void SetMasterDir( - indx); - -extern int TotalWtVecs( - void); - -extern void WritePhantomIntercepts( - FILE *); - -#endif /*MASTERFONT_H*/ diff --git a/c/autohint/autohintlib/source/bf/masterfontpriv.h b/c/autohint/autohintlib/source/bf/masterfontpriv.h deleted file mode 100644 index e40c44f1e..000000000 --- a/c/autohint/autohintlib/source/bf/masterfontpriv.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -#ifndef MASTERFONTPRIV_H -#define MASTERFONTPRIV_H - -typedef struct _MasterDesignPosit { - char *MasterDirName; - float posit[4]; -} MasterDesignPosit; - -extern void GetMasterDesignPositions(MasterDesignPosit **MDP, int *nummast, int *numaxes); - -#endif /* MASTERFONTPRIV_H */ diff --git a/c/autohint/autohintlib/source/bf/opcodes.h b/c/autohint/autohintlib/source/bf/opcodes.h deleted file mode 100644 index 7dab4defb..000000000 --- a/c/autohint/autohintlib/source/bf/opcodes.h +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* opcodes for PS operators */ -/* The assignment of mnemonics to constants in this file has two purposes: - 1) establish the value of encoded operators that are put in the - CharString of a character. This purpose requires that the values - of such operators must correspond to the values in fontbuild.c in - the PS interpreter. - 2) provide an index into a lookup table for buildfont's use. - Thus, some of the mnemonics are never put in a CharString, but - are here just so the table lookup is possible. For such operators, - the values don't matter as long as they don't conflict with any of - the PS interpreter values. */ - -/* Thu May 12 22:56:28 PDT 1994 jvz SETWV, COMPOSE */ - -#define COURIERB 0 -/* y COURIERB - Courier coloring */ -#define RB 1 -/* y dy RB -- add horizontal coloring pair at y and y+dy */ -#define COMPOSE 2 -/* subr# COMPOSE -- draw a library element. Pops only one arg from stack. */ -#define RY 3 -/* x dx RY -- add vertical coloring pair at x and x+dx */ -#define VMT 4 -/* dy VMT -- equivalent to 0 dy RMT */ -#define RDT 5 -/* dx dy RDT -- relative lineto */ -#define HDT 6 -/* dx HDT -- equivalent to dx 0 RDT */ -#define VDT 7 -/* dy VDT -- equivalent to 0 dy RDT */ -#define RCT 8 -/* dx1 dy1 dx2 dy2 dx3 dy3 RCT -- relative curveto */ -#define CP 9 -/* closepath */ -#define DOSUB 10 -/* i DOSUB -- execute Subrs[i] */ -#define RET 11 -/* RET -- return from DOSUB call */ -#define ESC 12 -/* escape - see special operators below */ -#define SBX 13 -/* SBX */ -#define ED 14 -/* end of a character */ -#define MT 15 -/* x y MT - non-relative - Courier and some space chars only */ -#define DT 16 -/* x y DT - non-relative - Courier only */ -#define CT 17 -/* x1 y1 x2 y2 x3 y3 CT - non-relative - Courier only */ -#define OMIN 18 /* MIN is a macro in THINK C */ - /* a b MIN -> (min(a,b)) */ -#define ST 19 -/* ST -- stroke (graphics state operator) */ -#define NP 20 -/* NP - Courier newpath */ -#define RMT 21 -/* dx dy RMT -- relative moveto */ -#define HMT 22 -/* dx HMT -- equivalent to dx 0 RMT */ -#define SLC 23 -/* i SLC -- setlinecap (graphics state operator) */ -#define MUL 24 -/* a b MUL -> (a*b) */ -#define STKWDTH 25 -/* font constant for strokewidth */ -#define BSLN 26 -/* font constant for baseline */ -#define CPHGHT 27 -/* font constant for cap height */ -#define BOVER 28 -/* font constant for baseline overshoot */ -#define XHGHT 29 -/* font constant for xheight */ -#define VHCT 30 -/* dy1 dx2 dy2 dx3 VHCT -- equivalent to 0 dy1 dx2 dy2 dx3 0 RCT */ -#define HVCT 31 -/* dx1 dx2 dy2 dy3 HVCT -- equivalent to dx1 0 dx2 dy2 0 dy3 RCT */ - -/* the operators above can be used in the charstring and thus evaluated - by the PS interpreter. The following operators never are placed in - the charstring, but are found in bez files. */ - -#define SNC 38 -/* start new colors */ -#define ENC 39 -/* end new colors */ -#define SC 40 -/* start character */ -#define FLX 41 -/* flex => translated to a 0 DOSUB in CharString */ -#define SOL 42 -/* start of loop = subpath => translated to FL CharString op */ -#define EOL 43 -/* end of loop = subpath => translated to FL CharString op */ -#define ID 44 -/* path id number */ - -/* escape operators - all of these can go into the charstrings */ -#define FL 0 -/* FL -- flip switch for "offset locking" - e.g. insuring > 0 pixel - separation between two paths of an i */ -#define RM 1 -/* x0 dx0 x1 dx1 x2 dx2 RM -- add 3 equal spaced vertical coloring pairs */ -#define RV 2 -/* y0 dy0 y1 dy1 y2 dy2 RV -- add 3 equal spaced horizontal coloring pairs */ -#define FI 3 -/* FI -- fill (graphics state operator) */ -#define ARC 4 -/* cx cy r a1 a2 ARC - Courier only */ -#define SLW 5 -/* w SLW -- setlinewidth (graphics state operator) */ -#define CC 6 -/* asb dx dy ccode acode CC -- composite character definition */ -#define SB 7 -/* */ -#define SSPC 8 -/* llx lly urx ury SSPC -- start self painting character - Courier only */ -#define ESPC 9 -/* ESPC -- end self painting character - Courier only */ -#define ADD 10 -/*a b ADD -> (a+b) */ -#define SUB 11 -/* a b SUB -> (a-b) */ -#define DIV 12 -/* a b DIV -> (a / b), used when need a non-integer value */ -#define OMAX 13 /* MAX is a macro in THINK C */ - /* a b MAX -> (max(a,b)) */ -#define NEG 14 -/* a NEG -> (-a) */ -#define IFGTADD 15 -/* a b c d IFGTADD -> (b > c)? (a+d) : (a) */ -#define DO 16 -/* a1 ... an n i DO -- - push an on PS stack; - ... - push a1 on PS stack; - begin systemdict; - begin fontdict; - execute OtherSubrs[i]; - end; - end; - */ -#define POP 17 -/* pop a number from top of PS stack and push it on fontbuild stack - used in communicating with OtherSubrs */ -#define DSCND 18 -/* font constant for descender */ -#define SETWV 19 -/* set weight vector */ -#define OVRSHT 20 -/* font constant for overshoot */ -#define SLJ 21 -/* i SLJ -- setlinejoin (graphics state operator) */ -#define XOVR 22 -/* font constant for xheight overshoot */ -#define CAPOVR 23 -/* font constant for cap overshoot */ -#define AOVR 24 -/* font constant for ascender overshoot */ -#define HLFSW 25 -/* font constant for half strokewidth */ -#define ROUNDSW 26 -/* w RNDSW -> (RoundSW(w)) -- round stroke width */ -#define ARCN 27 -/* cx cy r a1 a2 ARCN - Courier only */ -#define EXCH 28 -/* a b EXCH -> b a */ -#define INDEX 29 -/* an ... a0 i INDX -> an ... a0 ai */ -#define CRB 30 -/* y dy CRB - Courier rb */ -#define CRY 31 -/* x dx CRY - Courier ry */ -#define PUSHCP 32 -/* PUSHCP -> cx cy -- push the current position onto font stack - (graphics state operator) */ -#define POPCP 33 -/* cx cy POPCP -- set current position from font stack - (graphics state operator) */ diff --git a/c/autohint/autohintlib/source/bf/optable.c b/c/autohint/autohintlib/source/bf/optable.c deleted file mode 100644 index 2a2e7fb1c..000000000 --- a/c/autohint/autohintlib/source/bf/optable.c +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* optable.c - initializes table of known PostScript operators. */ - -#include "buildfont.h" -#include "machinedep.h" -#include "opcodes.h" -#include "optable.h" - -/* This defines an element of the table used to translate ASCII operand - names to the binary encoded equivalents. */ -typedef struct op_element { - short encoding; - char operator[MAXOPLEN]; -} op_element; - -#ifdef SUN -#define KNOWNOPSIZE 32 -#else -#define KNOWNOPSIZE 18 -#endif - -static struct op_element *op_table = NULL; - -/* Globals used outside this module. */ -#ifdef SUN -char beginsubr[10], endsubr[8], preflx[7], newcolors[10]; -#endif - -extern void init_ops() { - indx ix = 0; - - op_table = (struct op_element *)AllocateMem(KNOWNOPSIZE, sizeof(struct op_element), "operator table"); - /* The table is initialized in the following strange way to make it - difficult to find out what the secret font operators are by looking at - the object code for this source. Anyone with a debugger can look at the - operators once they have been initialized, however. It would make sense - to only have this initialization done once when buildfont is first - started, but now it is done once per font processed. - - The operator strings need to be left justified and null terminated. - - Not all of the operators from opcodes.h are initialized here; in - particular, some that seemed to be needed just for Courier were ignored. - - Operators for which the encoding value has been incremented by ESCVAL must - be preceded by an escape when written to the output charstring. */ -#ifdef SUN - sprintf(op_table[ix].operator, "%c%c%c%c", 'r', 'b', '\0', '\0'); - op_table[ix++].encoding = RB; - sprintf(op_table[ix].operator, "%c%c%c%c", 'r', 'y', '\0', '\0'); - op_table[ix++].encoding = RY; - sprintf(op_table[ix].operator, "%c%c%c%c", 's', 'u', 'b', 'r'); - op_table[ix++].encoding = DOSUB; -#endif - sprintf(op_table[ix].operator, "%c%c%c%c", 'v', 'm', 't', '\0'); - op_table[ix++].encoding = VMT; - sprintf(op_table[ix].operator, "%c%c%c%c", 'r', 'd', 't', '\0'); - op_table[ix++].encoding = RDT; - sprintf(op_table[ix].operator, "%c%c%c%c", 'h', 'd', 't', '\0'); - op_table[ix++].encoding = HDT; - sprintf(op_table[ix].operator, "%c%c%c%c", 'v', 'd', 't', '\0'); - op_table[ix++].encoding = VDT; - sprintf(op_table[ix].operator, "%c%c%c%c", 'r', 'c', 't', '\0'); - op_table[ix++].encoding = RCT; - sprintf(op_table[ix].operator, "%c%c%c%c", 'c', 'p', '\0', '\0'); - op_table[ix++].encoding = CP; - sprintf(op_table[ix].operator, "%c%c%c%c", 'r', 'e', 't', '\0'); - op_table[ix++].encoding = RET; - sprintf(op_table[ix].operator, "%c%c%c%c", 'e', 's', 'c', '\0'); - op_table[ix++].encoding = ESC; - sprintf(op_table[ix].operator, "%c%c%c%c", 's', 'b', 'x', '\0'); - op_table[ix++].encoding = SBX; - sprintf(op_table[ix].operator, "%c%c%c%c", 'e', 'd', '\0', '\0'); - op_table[ix++].encoding = ED; - sprintf(op_table[ix].operator, "%c%c%c%c", 'm', 't', '\0', '\0'); - op_table[ix++].encoding = MT; - sprintf(op_table[ix].operator, "%c%c%c%c", 'r', 'm', 't', '\0'); - op_table[ix++].encoding = RMT; - sprintf(op_table[ix].operator, "%c%c%c%c", 'h', 'm', 't', '\0'); - op_table[ix++].encoding = HMT; - sprintf(op_table[ix].operator, "%c%c%c%c", 'v', 'h', 'c', 't'); - op_table[ix++].encoding = VHCT; - sprintf(op_table[ix].operator, "%c%c%c%c", 'h', 'v', 'c', 't'); - op_table[ix++].encoding = HVCT; - /* special non-charstring operators start here */ - sprintf(op_table[ix].operator, "%c%c%c%c", 's', 'c', '\0', '\0'); - op_table[ix++].encoding = SC; - sprintf(op_table[ix].operator, "%c%c%c%c", 'i', 'd', '\0', '\0'); - op_table[ix++].encoding = ID; -#ifdef SUN - sprintf(op_table[ix].operator, "%c%c%c%c", 's', 'n', 'c', '\0'); - op_table[ix++].encoding = SNC; - sprintf(op_table[ix].operator, "%c%c%c%c", 'e', 'n', 'c', '\0'); - op_table[ix++].encoding = ENC; - sprintf(op_table[ix].operator, "%c%c%c%c", 'f', 'l', 'x', '\0'); - op_table[ix++].encoding = FLX; - sprintf(op_table[ix].operator, "%c%c%c%c", 's', 'o', 'l', '\0'); - op_table[ix++].encoding = SOL; - sprintf(op_table[ix].operator, "%c%c%c%c", 'e', 'o', 'l', '\0'); - op_table[ix++].encoding = EOL; -#endif - /* escape operators start here */ - sprintf(op_table[ix].operator, "%c%c%c%c", 'c', 'c', '\0', '\0'); - op_table[ix++].encoding = CC + ESCVAL; -#ifdef SUN - sprintf(op_table[ix].operator, "%c%c%c%c", 'f', 'l', '\0', '\0'); - op_table[ix++].encoding = FL + ESCVAL; - sprintf(op_table[ix].operator, "%c%c%c%c", 'r', 'm', '\0', '\0'); - op_table[ix++].encoding = RM + ESCVAL; - sprintf(op_table[ix].operator, "%c%c%c%c", 'r', 'v', '\0', '\0'); - op_table[ix++].encoding = RV + ESCVAL; - sprintf(op_table[ix].operator, "%c%c%c%c", 'd', 'i', 'v', '\0'); - op_table[ix++].encoding = DIV + ESCVAL; - sprintf(op_table[ix].operator, "%c%c%c%c", 'd', 'o', '\0', '\0'); - op_table[ix++].encoding = DO + ESCVAL; - sprintf(op_table[ix].operator, "%c%c%c%c", 'p', 'o', 'p', 'n'); - op_table[ix++].encoding = POP + ESCVAL; -#endif - - if (ix > KNOWNOPSIZE) { - LogMsg("Initialization of op table failed.\n", - LOGERROR, NONFATALERROR, TRUE); - } - /* These are treated as a special case for no particularly good reason - other than that they are longer than will fit in the above table */ -#ifdef SUN - sprintf(beginsubr, "%s%c%c%c%c", "begin", 's', 'u', 'b', 'r'); - - sprintf(endsubr, "%s%c%c%c%c", "end", 's', 'u', 'b', 'r'); - sprintf(preflx, "%s%c%c%c", "pre", 'f', 'l', 'x'); - sprintf(newcolors, "%s%c%c%c%c%c%c", "new", 'c', 'o', 'l', 'o', 'r', 's'); -#endif -} - -void GetOperator(short encoding, char *operator) { - indx ix; - - for (ix = 0; ix < KNOWNOPSIZE; ix++) - if (encoding == op_table[ix].encoding) { - strcpy(operator, op_table[ix].operator); - return; - } - sprintf(globmsg, "The opcode: %d is invalid.\n", (int)encoding); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); -} - -/* Checks if the operator passed in is a recognized PS operator. - If it is the associated opcode is returned. */ -extern short op_known(operator) char *operator; - -{ - indx ix; - - for (ix = 0; ix < KNOWNOPSIZE; ix++) - if (STREQ(op_table[ix].operator, operator)) - return op_table[ix].encoding; - return MININT; /* Unknown operator */ -} diff --git a/c/autohint/autohintlib/source/bf/optable.h b/c/autohint/autohintlib/source/bf/optable.h deleted file mode 100644 index 69436f6f2..000000000 --- a/c/autohint/autohintlib/source/bf/optable.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ - -#define ESCVAL 100 -#define MAXOPLEN 5 - -#ifdef SUN -extern char beginsubr[10], endsubr[8], preflx[7], newcolors[10]; -#endif - -extern void GetOperator( - short, char*); - -extern short op_known( - char*); - -extern void init_ops( - void); - -extern void freeoptable( - void); diff --git a/c/autohint/autohintlib/source/bf/rawPStobez.c b/c/autohint/autohintlib/source/bf/rawPStobez.c deleted file mode 100644 index 1cc162116..000000000 --- a/c/autohint/autohintlib/source/bf/rawPStobez.c +++ /dev/null @@ -1,310 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -/* rawPStobez.c - converts character description files in raw - PostScript format to relativized bez format. The only - operators allowed are moveto, lineto, curveto and closepath. - This program assumes that the rawPS files are located in a - directory named chars and stores the converted and encrypted - files with the same name in a directory named bez. - -history: - -Judy Lee: Tue Jun 14 17:33:13 1988 -End Edit History - -*/ -#include "buildfont.h" -#include "bftoac.h" -#include "cryptdefs.h" -#include "machinedep.h" - -#define MOVETO ((!strcmp(token, "moveto"))) -#define LINETO ((!strcmp(token, "lineto"))) -#define CURVETO ((!strcmp(token, "curveto"))) -#define CLOSEPATH ((!strcmp(token, "closepath"))) -#define END ((!strcmp(token, "ed"))) -#define START ((!strcmp(token, "sc"))) - -#define SSIZE 20 /* operand stack size */ - -#if !IS_LIB -static long oprnd_stk[SSIZE]; -static short count; -static short convertedchars; -static boolean printmsg; -static long dx, dy; -static char tempname[MAXFILENAME]; -static Cd p1, p2, p3, currPt; -static float scale; /* scale factor for each character. */ -#endif -static char outstr[MAXLINE]; /* contains string to be encrypted */ - -static void errmsg( - char *, char *, FILE *, FILE *); - -static short nextline( - FILE *); - -static char *ReadrawPSFile( - FILE *, char *, char *); - -static void SetCd( - Cd, CdPtr); - -static void putonstk( - long, char *); - -static void mt( - void); - -static void dt( - void); - -static void ct( - void); - -#ifdef OLDFUNCTIONS - -static errmsg(str, name, infile, outfile) char *str, *name; -FILE *infile, *outfile; -{ - fclose(infile); - fclose(outfile); - sprintf(globmsg, "%s in %s file does not have the correct number of operands.\n This file was not converted.\n", str, name); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); -} - -static short nextline(infile) - FILE *infile; -{ - register short c; - - while (TRUE) { - c = getc(infile); - if (c == NL || c == '\r' || c == EOF) - return (c); - } -} - -static char *ReadrawPSFile(stream, tokenPtr, filename) - FILE *stream; -char *tokenPtr, *filename; -{ - register short c; - - /* Skip all white space */ - while (TRUE) { - c = getc(stream); - if (c == '%') - c = nextline(stream); - if (c == EOF) - return (NULL); - if (!isspace(c)) { - *tokenPtr = c; - tokenPtr++; - break; - } - } - while (TRUE) { - c = getc(stream); - if (c == '%') - c = nextline(stream); - if (c == EOF) { - sprintf(globmsg, "Unexpected end of file found in %s directory \n character description: %s.\n", RAWPSDIR, filename); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - if (isspace(c)) - break; - *tokenPtr = c; - tokenPtr++; - } - *tokenPtr = '\0'; - return tokenPtr; -} - -static SetCd(a, b) - Cd a; -CdPtr b; -{ - b->x = a.x; - b->y = a.y; -} - -static putonstk(number, charname) long number; -char *charname; -{ - if (count >= SSIZE) { - sprintf(globmsg, - "Maximum stack size exceeded when converting %s file %s.\n", - RAWPSDIR, charname); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - oprnd_stk[count] = number; - count = count + 1; -} - -static mt() { - count = count - 1; - p1.y = oprnd_stk[count--]; - p1.x = oprnd_stk[count]; - dx = SCALEDRTOL((p1.x - currPt.x), scale); - dy = SCALEDRTOL((p1.y - currPt.y), scale); - if (dx == 0) - sprintf(outstr, "%ld %c%c%c\n", dy, 'v', 'm', 't'); - else if (dy == 0) - sprintf(outstr, "%ld %c%c%c\n", dx, 'h', 'm', 't'); - else - sprintf(outstr, "%ld %ld %c%c%c\n", dx, dy, 'r', 'm', 't'); - SetCd(p1, &currPt); -} - -static dt() { - count = count - 1; - p1.y = oprnd_stk[count--]; - p1.x = oprnd_stk[count]; - dx = SCALEDRTOL((p1.x - currPt.x), scale); - dy = SCALEDRTOL((p1.y - currPt.y), scale); - if (dx == 0) - sprintf(outstr, "%ld %c%c%c\n", dy, 'v', 'd', 't'); - else if (dy == 0) - sprintf(outstr, "%ld %c%c%c\n", dx, 'h', 'd', 't'); - else - sprintf(outstr, "%ld %ld %c%c%c\n", dx, dy, 'r', 'd', 't'); - SetCd(p1, &currPt); -} - -static ct() { - count = count - 1; - p3.y = oprnd_stk[count--]; - p3.x = oprnd_stk[count--]; - p2.y = oprnd_stk[count--]; - p2.x = oprnd_stk[count--]; - p1.y = oprnd_stk[count--]; - p1.x = oprnd_stk[count]; - if ((currPt.x == p1.x) && (p3.y == p2.y)) /* vhct */ - sprintf(outstr, "%ld %ld %ld %ld %c%c%c%c\n", - SCALEDRTOL((p1.y - currPt.y), scale), SCALEDRTOL((p2.x - p1.x), scale), - SCALEDRTOL((p2.y - p1.y), scale), SCALEDRTOL((p3.x - p2.x), scale), - 'v', 'h', 'c', 't'); - else if ((currPt.y == p1.y) && (p3.x == p2.x)) /* hvct */ - sprintf(outstr, "%ld %ld %ld %ld %c%c%c%c\n", - SCALEDRTOL((p1.x - currPt.x), scale), SCALEDRTOL((p2.x - p1.x), scale), - SCALEDRTOL((p2.y - p1.y), scale), SCALEDRTOL((p3.y - p2.y), scale), - 'h', 'v', 'c', 't'); - else /* rct */ - sprintf(outstr, "%ld %ld %ld %ld %ld %ld %c%c%c\n", - SCALEDRTOL((p1.x - currPt.x), scale), SCALEDRTOL((p1.y - currPt.y), scale), - SCALEDRTOL((p2.x - p1.x), scale), SCALEDRTOL((p2.y - p1.y), scale), - SCALEDRTOL((p3.x - p2.x), scale), SCALEDRTOL((p3.y - p2.y), scale), - 'r', 'c', 't'); - SetCd(p3, &currPt); -} - -extern void convert_PScharfile(const char *charname, const char *filename) { - FILE *infile, *outfile; - char token[50]; - long number; - char inname[MAXPATHLEN], outname[MAXPATHLEN]; - - get_filename(inname, RAWPSDIR, filename); - get_filename(outname, bezdir, filename); - infile = ACOpenFile(inname, "r", OPENWARN); - if (infile == NULL) - return; - outfile = ACOpenFile(tempname, "w", OPENERROR); - DoInitEncrypt(outfile, OTHER, HEX, MAXINT32, FALSE); - WriteStart(outfile, charname); - count = 0; - currPt.x = 0; - currPt.y = 0; - while (ReadrawPSFile(infile, token, inname) != NULL) { - if (sscanf(token, " %ld", &number) == 1) { - putonstk(number, charname); - continue; - } else /* must be a string */ - { - if (START) - continue; - if (END) - break; - if (CLOSEPATH) { - (void)DoContEncrypt("cp\n", outfile, FALSE, INLEN); - continue; - } else if (MOVETO) - if (count != 2) - errmsg("moveto", inname, infile, outfile); - else - mt(); - else if (LINETO) - if (count != 2) - errmsg("lineto", inname, infile, outfile); - else - dt(); - else if (CURVETO) - if (count != 6) - errmsg("curveto", inname, infile, outfile); - else - ct(); - else /* Unrecognized operator */ - { - fclose(infile); - fclose(outfile); - unlink(tempname); - sprintf(globmsg, "Unknown operator: %s in character description: %s.\n", token, inname); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - count = 0; - (void)DoContEncrypt(outstr, outfile, FALSE, INLEN); - } - } - (void)DoContEncrypt("ed\n", outfile, FALSE, INLEN); - fclose(infile); - fclose(outfile); - RenameFile(tempname, outname); - if (printmsg) { - LogMsg("Converting PostScript(R) language files ...", - INFO, OK, FALSE); - printmsg = FALSE; - } - convertedchars++; -} - -extern convert_rawPSfiles(release) - boolean release; -{ - boolean result = TRUE; - - /* initialize globals in this source file */ - count = convertedchars = 0; - printmsg = TRUE; - set_scale(&scale); - - get_filename(tempname, bezdir, TEMPFILE); -#if SUN - result = ConvertCharFiles( - RAWPSDIR, release, scale, convert_PScharfile); -#elif WIN32 - result = ConvertCharFiles( - RAWPSDIR, release, scale, convert_PScharfile); -#else - ConvertInputDirFiles(RAWPSDIR, convert_PScharfile); -#endif - if (convertedchars > 0) { - sprintf(globmsg, " %d files converted.\n", (int)convertedchars); - LogMsg(globmsg, INFO, OK, FALSE); - if (scale != 1.0) { - sprintf(globmsg, "Widths in the original %s file were not scaled.\n", WIDTHSFILENAME); - LogMsg(globmsg, WARNING, OK, TRUE); - } - } - if (!result) cleanup(NONFATALERROR); -} - -#endif - -int WriteStart(FILE *outfile, const char *name) { - sprintf(outstr, "%%%s\nsc\n", name); - (void)DoContEncrypt(outstr, outfile, FALSE, INLEN); - return 0; -} diff --git a/c/autohint/autohintlib/source/bf/transitionalchars.h b/c/autohint/autohintlib/source/bf/transitionalchars.h deleted file mode 100644 index 4fa94dffd..000000000 --- a/c/autohint/autohintlib/source/bf/transitionalchars.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/***********************************************************************/ -#ifndef TRANSITIONALCHARS_H -#define TRANSITIONALCHARS_H - -#include "masterfontpriv.h" - -#define TRANSITIONALCHARFILENAME "transitionalchars" - -typedef float Ary4[4]; - -typedef struct _Transitions { - char *charname; - short numtransitiongroups; - struct _TransitGroup *transitgrouparray; /* ARRAY */ -} Transitions; - -typedef struct _TransitGroup { - char **assembledfilename; /* ARRAY : one filename for each "corner" */ - int *assembled_width; /* array */ - int *assembled_sb; /* array */ - Bbox bbx; /* not of the assembled file, but the super-bbox of all elts */ - int subrindex; /* subroutine-index the _Merged_ assembledfilename's charpaths */ - short numentries; - short hintindex; /* which elt entry is -the- source for hints for this group */ - struct _TransitElt *transiteltarray; /* ARRAY */ - Ary4 minval, maxval; /* sorted min/max of group's fromval/toval entries */ -} TransitionGroup; - -typedef struct _tt_pathlist *PTPathList; - -typedef struct _TransitElt { - char *from_filename, *to_filename; - short from_width, to_width; - short from_sb, to_sb; - Bbox from_bbx, to_bbx; - PTPathList from_pathlist, to_pathlist; /* opaque */ - unsigned from_ishintdir : 1, /* else "to" is hintdir for this pair */ - defaultbehavior : 1, /* else, range is in fromval/toval */ - from_isanchored : 1, /* if "from" is at a corner */ - to_isanchored : 1; /* if "to" is at a corner */ - Ary4 fromposit, toposit; /* position of the masters in cartesian space */ - Ary4 fromval, toval; /* cartesian coords where the masters should be utilized */ -} TransitElt; - -extern void ReadTransitional( - boolean); - -extern void PreReadTransitional(); - -extern void CopyTransitionalToTable(); - -extern void AssembleTransitionals(); - -extern char **TransitionalCharsHintList( - boolean, short *, indx); - -extern void Free_TransitionalList(); - -extern void GetMastDesPosInfo(MasterDesignPosit **MDPptr, int *NumMast, int *NumAxes); - -#endif /* TRANSITIONALCHARS_H */ diff --git a/c/autohint/autohintlib/source/public/ac/ac_C_lib.h b/c/autohint/autohintlib/source/public/ac/ac_C_lib.h deleted file mode 100644 index 65846be6b..000000000 --- a/c/autohint/autohintlib/source/public/ac/ac_C_lib.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -/* The following ifdef block is the standard way of creating macros which make exporting -// from a DLL simpler. All files within this DLL are compiled with the ACLIB_API -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see -// ACLIB_API functions as being imported from a DLL, wheras this DLL sees symbols -// defined with this macro as being exported. -*/ -#ifndef AC_C_LIB_H_ -#define AC_C_LIB_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef AC_C_LIB_EXPORTS - -#if WIN32 -#define ACLIB_API __declspec(dllexport) -#else - -#if __MWERKS__ -#define ACLIB_API __declspec(export) -#elif __GNUC__ && __MACH__ -#define ACLIB_API __attribute__((visibility("default"))) -#endif - -#endif - -#else -#define ACLIB_API -#endif - -enum { - AC_Success, - AC_FontinfoParseFail, - AC_FatalError, - AC_MemoryError, - AC_UnknownError, - AC_DestBuffOfloError, - AC_InvalidParameterError -}; - -ACLIB_API const char *AC_getVersion(void); - -typedef void *(*AC_MEMMANAGEFUNCPTR)(void *ctxptr, void *old, unsigned long size); - -/* - * Function: AC_SetMemManager - **************************** -If this is supplied, then the AC lib will call this function foor all memory allocations. -Else is it will use the std C lib alloc/malloc/free. -*/ -ACLIB_API void AC_SetMemManager(void *ctxptr, AC_MEMMANAGEFUNCPTR func); - -/* - * Function: AC_SetReportCB - **************************** -If this is supplied and verbose is set to true, then the AC lib will write (many!) text status messages to this file. -If verbose is set false, then only error messages are written. -*/ -typedef void (*AC_REPORTFUNCPTR)(char *msg); -extern AC_REPORTFUNCPTR libReportCB; /* global log function which is supplied by the following */ -extern AC_REPORTFUNCPTR libErrorReportCB; /* global error log function which is supplied by the following */ - -ACLIB_API void AC_SetReportCB(AC_REPORTFUNCPTR reportCB, int verbose); - -/* Global for reporting log messages. */ - -/* - * Function: AC_SetReportStemsCB - **************************** -If this is called , then the AC lib will write all the stem widths it encounters. -Note that the callabcks should not dispose of the glyphName memory; that belongs to the AC lib. -It should be copied immediately - it may may last past the return of the calback. -*/ - -extern unsigned int allstems; /* if false, then stems defined by curves are xcluded from the reporting */ -typedef void (*AC_REPORTSTEMPTR)(long int top, long int bottom, char *glyphName); - -extern AC_REPORTSTEMPTR addHStemCB; -extern AC_REPORTSTEMPTR addVStemCB; -ACLIB_API void AC_SetReportStemsCB(AC_REPORTSTEMPTR hstemCB, AC_REPORTSTEMPTR vstemCB, unsigned int allStems); - -/* - * Function: AC_SetReportZonesCB - **************************** -If this is called , then the AC lib will write all the aligment zones it encounters. -Note that the callabcks should not dispose of the glyphName memory; that belongs to the AC lib. -It should be copied immediately - it may may last past the return of the calback. -*/ -typedef void (*AC_REPORTZONEPTR)(long int top, long int bottom, char *glyphName); -extern AC_REPORTZONEPTR addCharExtremesCB; -extern AC_REPORTZONEPTR addStemExtremesCB; -ACLIB_API void AC_SetReportZonesCB(AC_REPORTZONEPTR charCB, AC_REPORTZONEPTR stemCB); - -typedef void (*AC_RETRYPTR)(void); -extern AC_RETRYPTR reportRetryCB; - -/* - * Function: AutoColorString - **************************** - * This function takes srcbezdata, a pointer to null terminated C-string containing data in the bez - * format (see bez spec) and fontinfo, a pointer to null terminated C-string containing fontinfo - * for the bez glyph. Hint information is added to the bez data and returned to the caller through the - * buffer dstbezdata. dstbezdata must be allocated before the call and a pointer to its length passed - * as *length. If the space allocated is insufficient for the target bezdata, an error will be returned - * and *length will be set to the desired size. - */ -ACLIB_API int AutoColorString(const char *srcbezdata, const char *fontinfo, char *dstbezdata, int *length, int allowEdit, int allowHintSub, int roundCoords, int debug); - -/* - * Function: AC_initCallGlobals - **************************** - * This function must be called before calling AC_initCallGlobals in the case where - * the program is switching between any of the auto-hinting and stem reportign modes - * while running. - */ - -ACLIB_API void AC_initCallGlobals(void); - -#ifdef __cplusplus -} -#endif -#endif /* AC_C_LIB_H_ */ diff --git a/c/autohint/autohintlib/source/public/ac/memcheck.h b/c/autohint/autohintlib/source/public/ac/memcheck.h deleted file mode 100644 index 2952dbae3..000000000 --- a/c/autohint/autohintlib/source/public/ac/memcheck.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef MEMCHECK_H -#define MEMCHECK_H - -#if DOMEMCHECK - -#if defined(MACINTOSH) || defined(macintosh) || defined(OSX) || defined(__MWERKS__) -#define SINGEXPORT __declspec(export) -#define SINGSTDCALL -#define SINGCALLBACK -#endif - -#if WIN32 -#define SINGEXPORT __declspec(dllexport) -#define SINGSTDCALL __stdcall -#define SINGCALLBACK __cdecl -#endif - -#ifndef SINGLIB_CDECL -#define SINGLIB_CDECL SINGCALLBACK -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum e_MemCheck_MemStore { - memck_store_default = 0, /* default - calls OS-provided malloc() directly */ - memck_store_app, /* for mem want to keep for the app's life */ - memck_store_maxMemStore /* must be the last */ -} MemCheck_MemStore; - -SINGEXPORT void *memck_mallocinternal( - int size, - MemCheck_MemStore index, - char *filename, - int lineno); - -SINGEXPORT void *memck_callocinternal( - int count, - int size, - MemCheck_MemStore index, - char *filename, - int lineno); - -SINGEXPORT void memck_freeinternal( - void *ptr, - char *filename, - int lineno); - -SINGEXPORT void *memck_reallocinternal( - void *ptr, - int size, - char *filename, - int lineno); - -/* PUBLIC */ -SINGEXPORT int memck_PrintAllAllocFreeCalls; - -SINGEXPORT int memck_Startup(char *logfilePathname); /* returns non-0 if failure */ - -/* PUBLIC - Use these macros instead of calling the *alloc/free functions above */ - -#define memck_malloc(x) memck_mallocinternal((x), memck_store_app, __FILE__, __LINE__) -#define memck_calloc(count, size) memck_callocinternal((count), (size), memck_store_app, __FILE__, __LINE__) - -#define memck_free(x) memck_freeinternal((x), __FILE__, __LINE__) -#define memck_realloc(ptr, size) memck_reallocinternal((ptr), (size), __FILE__, __LINE__) - -#define memck_os_malloc(x) memck_mallocinternal((x), memck_store_default, __FILE__, __LINE__) -#define memck_os_calloc(count, size) memck_callocinternal((count), (size), memck_store_default, __FILE__, __LINE__) - -/* PUBLIC */ -SINGEXPORT void memck_ResetMemLeakDetection(void); - -/* PUBLIC */ -SINGEXPORT void memck_CheckMemLeaks(void); /* print allocations, and call memck_ResetMemLeakDetection */ - -/* PUBLIC */ -SINGEXPORT void memck_Shutdown(void); - -#ifdef __cplusplus -} -#endif - -#endif /* DOMEMCHECK */ - -#endif /* MEMCHECK_H */ diff --git a/c/autohint/autohintlib/source/public/extras/numtypes.h b/c/autohint/autohintlib/source/public/extras/numtypes.h deleted file mode 100644 index 078321ac3..000000000 --- a/c/autohint/autohintlib/source/public/extras/numtypes.h +++ /dev/null @@ -1,169 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -#ifndef _NUMTYPES_H -#define _NUMTYPES_H - -#include - -/***********************************************************************/ -/* GUIDELINES FOR SELECTION OF TYPE */ -/* */ -/* The following types give best performance because implicit */ -/* conversion does not take place. So, use them if at all possible. */ -/* Types are show in order of decreasing preference. The dependable */ -/* domain for each type is show enclosed in []. */ -/* */ -/* IntX */ -/* CardX */ -/* ByteX8 whenever there is NO mandated requirement for signed */ -/* or unsigned values [0, 127]. */ -/***********************************************************************/ - -/***********************************************************************/ -/* The present file assumes: */ -/* */ -/* char: 8 bits */ -/* short: 16 bits */ -/* long: 32 bits */ -/* */ -/* This assumption is currently true for Sun, PC, and Mac environments.*/ -/* When this assumption is no longer true, #ifdef the code accordingly */ -/* and change this comment. */ -/***********************************************************************/ - -/***********************************************************************/ -/* The following numeric types guarantee the number of bits: neither */ -/* more or less than specified. Use these ONLY when you actually must */ -/* have the number of bits specified. If you need a minimum of a */ -/* certain number of bits, use types from the IntX.../CardX... group. */ -/***********************************************************************/ - -typedef int32_t Fixed; - -typedef int32_t Int32; -#define MAX_INT32 ((Int32)0x7FFFFFFF) -#define MIN_INT32 ((Int32)0x80000000) - -typedef uint32_t Card32; -#define MAX_CARD32 ((Card32)0xFFFFFFFF) - -typedef int16_t Int16; -#define MAX_INT16 ((Int16)0x7FFF) -#define MIN_INT16 ((Int16)0x8000) - -typedef uint16_t Card16; -#define MAX_CARD16 ((Card16)0xFFFF) - -typedef int8_t Int8; -#define MAX_INT8 ((Int8)0x7F) -#define MIN_INT8 ((Int8)0x80) - -typedef uint8_t Card8; -#define MAX_CARD8 ((Card8)0xFF) - -typedef uint8_t Byte8; - -/***********************************************************************/ -/* The following numeric types guarantee at least the number of bits */ -/* indicated. Use these when a specific size is not required, but */ -/* a minimum size is. Note that IntX/CardX are guaranteed to be at */ -/* least 16 bits, but can be set (for testing purposes) to either */ -/* 16 or 32 bit sizes by defining FORCE_INT_BITS to the compiler. */ -/***********************************************************************/ - -#if defined(FORCE16BITS) -#define FORCE_INT_BITS 16 -#elif defined(FORCE32BITS) -#define FORCE_INT_BITS 32 -#endif - -/***********************************/ -/* Optimize for performance... */ -/***********************************/ -#if FORCE_INT_BITS == 32 - -typedef Int32 IntX; -#define MAX_INTX MAX_INT32 -#define MIN_INTX MIN_INT32 -typedef Card32 CardX; -#define MAX_CARDX MAX_CARD32 - -#elif FORCE_INT_BITS == 16 - -typedef Int16 IntX; -#define MAX_INTX MAX_INT16 -#define MIN_INTX MIN_INT16 -typedef Card16 CardX; -#define MAX_CARDX MAX_CARD16 -#define MAX_CARDX MAX_CARD16 - -#else - -typedef int IntX; -#define MAX_INTX ((IntX)((1 << (sizeof(IntX) * 8 - 1)) - 1)) -#define MIN_INTX ((IntX)(1 << (sizeof(IntX) * 8 - 1))) -typedef unsigned CardX; -#define MAX_CARDX ((CardX)(MAX_INTX | MIN_INTX)) -#endif - -/***********************************/ -/* Optimize for space... */ -/***********************************/ -typedef long IntX32; -#define MAX_INTX32 MAX_INT32 -#define MIN_INTX32 MIN_INT32 - -typedef unsigned long CardX32; -#define MAX_CARDX32 MAX_CARD32 - -typedef short IntX16; -#define MAX_INTX16 MAX_INT16 -#define MIN_INTX16 MIN_INT16 - -typedef unsigned short CardX16; -#define MAX_CARDX16 MAX_CARD16 - -typedef signed char IntX8; -#define MAX_INTX8 MAX_INT8 -#define MIN_INTX8 MIN_INT8 - -typedef unsigned char CardX8; -#define MAX_CARDX8 MAX_CARD8 - -typedef char ByteX8; -/* MAX_BYTEX8 and MIN_BYTEX8 are omitted because it is not known */ -/* whether if a ByteX8 (char) is signed or unsigned. */ - -/***********************************************************************/ -/* Use this type for use with variables connected with system calls. */ -/***********************************************************************/ -typedef int IntN; -#define MAX_INTN ((IntN)((1 << (sizeof(IntN) * 8 - 1)) - 1)) -#define MIN_INTN ((IntN)(1 << (sizeof(IntN) * 8 - 1))) - -typedef unsigned CardN; -#define MAX_CARDN ((CardN)(MAX_INTN | MIN_INTN)) - -typedef short ShortN; -typedef unsigned short ShortCardN; -typedef long LongN; -typedef unsigned long LongCardN; -typedef float FloatN; -typedef double DoubleN; - -/***********************************************************************/ -/* Use these macros with scanf and printf. */ -/***********************************************************************/ -#define FMT_32 "l" -#define FMT_16 "h" - -#if FORCE_INT_BITS == 32 -#define FMT_X FMT_32 -#elif FORCE_INT_BITS == 16 -#define FMT_X FMT_16 -#endif - -#define FMT_N "" - -#endif /*_NUMTYPES_H*/ diff --git a/c/autohint/autohintlib/source/public/extras/pubtypes.h b/c/autohint/autohintlib/source/public/extras/pubtypes.h deleted file mode 100644 index 4bc3b8172..000000000 --- a/c/autohint/autohintlib/source/public/extras/pubtypes.h +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -#ifndef _PUBTYPES_H -#define _PUBTYPES_H - -/***********************************************************************/ -/* THIS FILE IS PROVIDED FOR BACKWARD COMPATIBILITY ONLY!!! */ -/* Its use for new programs is not recommended because it contains */ -/* constructs that have been demonstrated to cause integration */ -/* problems. */ -/***********************************************************************/ - -/***********************************************************************/ -/* Numeric definitions */ -/***********************************************************************/ -#include "numtypes.h" - -typedef Int16 *PInt16; -typedef Int32 *PInt32; -typedef Card8 *PCard8; -typedef Card16 *PCard16; -typedef Card32 *PCard32; - -#define MAXInt32 MAX_INT32 -#define MINInt32 MIN_INT32 - -typedef Int32 integer; -#define MAXinteger MAX_INT32 -#define MINinteger MIN_INT32 -#ifdef __MWERKS__ -typedef CardX boolean; -#endif -typedef Card16 cardinal; -typedef Card32 longcardinal; - -#define MAXCard32 MAX_CARD32 -#define MAXlongcardinal MAX_CARD32 -#define MAXunsignedinteger MAX_CARD32 -#define MAXCard16 MAX_CARD16 -#define MAXcardinal MAX_CARD16 -#define MAXCard8 MAX_CARD8 - -/***********************************************************************/ -/* Other definitions */ -/***********************************************************************/ -#ifndef VAXC -#define readonly -#define exitNormal 1 -#define exitError 2 -#else -#define exitNormal 0 -#define exitError 1 -#endif - -#define _inline -#define _priv extern - -/***********************************/ -/* Control Constructs */ -/***********************************/ -#define until(x) while (!(x)) -#define endswitch default:; - -/***********************************/ -/* Inline Functions */ -/***********************************/ -#ifndef ABS -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#endif -#ifndef MIN -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - -/***********************************/ -/* Declarative Sugar */ -/***********************************/ -#define forward extern - -#if WINATM && !defined(MAKEPUB) -#define private -#else -#define private static -#endif - -#define public -/*#define global extern*/ - -#define procedure void - -#ifndef true -#define true 1 -#define false 0 -#endif - -typedef integer (*PIntProc)(); - -/***********************************/ -/* Canonical type for sizes of */ -/* things -- will change to size_t */ -/* when we are completely */ -/* converted to ANSI conventions. */ -/***********************************/ -typedef long int ps_size_t; - -/***********************************/ -/* Bit fields */ -/***********************************/ -#ifndef BitField -#define BitField unsigned -#endif - -/***********************************/ -/* Reals and Fixed point */ -/***********************************/ -typedef float real; -typedef real *Preal; -typedef double longreal; -typedef Fixed *PFixed; - -/***********************************/ -/* Coordinates */ -/***********************************/ -typedef real ACComponent; - -typedef struct _t_RCd { - ACComponent x, y; -} RCd, *PRCd; - -typedef struct _t_FCd { - Fixed x, y; -} FCd, *PFCd; - -/***********************************/ -/* Characters and strings */ -/***********************************/ -typedef unsigned char character; -typedef character *string; -typedef character *charptr; - -#ifdef NUL -#undef NUL -#endif -#define NUL '\0' - -/***********************************/ -/* Generic Pointers */ -/***********************************/ -#ifndef NULL -#define NULL 0 -#endif - -#ifdef NIL -#undef NIL -#endif -#define NIL NULL - -#ifndef __MWERKS__ -typedef Card32 GenericID; /* Generic ID for contexts, */ - /* spaces, name cache, etc. */ - /* Opaque type used in public */ - /* interfaces */ - -#endif - -#if 0 -#define BitsInGenericIndex 10 -#define BitsInGenericGeneration (32 - BitsInGenericIndex) - -#define MAXGenericIDIndex ((Card32)((1 << BitsInGenericIndex) - 1)) -#define MAXGenericIDGeneration ((Card32)((1 << BitsInGenericGeneration) - 1)) - -typedef union { /* Representation of GenericID */ - struct { - BitField index:BitsInGenericIndex; - /* Reusable component */ - BitField generation:BitsInGenericGeneration; - /* Non-reusable component */ - } id; - GenericID stamp; /* Unique combined id (index, */ - /* generation) */ -} GenericIDRec; -#endif - -/***********************************************************************/ -/* Following is the standard opaque handle for a stream. This is all */ -/* that most clients should need. The concrete data structure is */ -/* defined in stream.h. */ -/***********************************************************************/ -typedef struct _t_StmRec *Stm; - -typedef struct _t_StringList { - integer numStrings; - integer refCnt; - string str[1]; - /* Space for additional strings */ - /* is malloc'ed starting here */ -} StringList, *PStringList; - -#endif /*_PUBTYPES_H*/ diff --git a/c/autohint/autohintlib/source/public/mac/types.h b/c/autohint/autohintlib/source/public/mac/types.h deleted file mode 100644 index ec1ddc78f..000000000 --- a/c/autohint/autohintlib/source/public/mac/types.h +++ /dev/null @@ -1,99 +0,0 @@ -/* @(#)types.h 2.32 94/08/18 SMI; from UCB 7.1 6/4/86 */ - -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -#ifndef __sys_types_h -#define __sys_types_h - -/* - * Basic system types. - */ - -#include "stdtypes.h" /* ANSI & POSIX types */ - -#ifndef _POSIX_SOURCE -#include "sysmacros.h" - -#define physadr physadr_t -#define quad quad_t - -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; -typedef unsigned short ushort; /* System V compatibility */ -typedef unsigned int uint; /* System V compatibility */ -#endif /*!_POSIX_SOURCE*/ - -#ifdef vax -typedef struct _physadr_t { - int r[1]; -} * physadr_t; -typedef struct label_t { - int val[14]; -} label_t; -#endif -#ifdef mc68000 -typedef struct _physadr_t { - short r[1]; -} * physadr_t; -typedef struct label_t { - int val[13]; -} label_t; -#endif -#ifdef i386 -typedef struct _physadr_t { - short r[1]; -} * physadr_t; -typedef struct label_t { - int val[8]; -} label_t; -#endif -typedef struct _quad_t { - long val[2]; -} quad_t; -typedef long daddr_t; -typedef char* caddr_t; -/*typedef unsigned long ino_t; -typedef short dev_t; -typedef long off_t; -typedef unsigned short uid_t; -typedef unsigned short gid_t;*/ -typedef long key_t; -typedef char* addr_t; - -#ifndef _POSIX_SOURCE - -#define NBBY 8 /* number of bits in a byte */ -/* - * Select uses bit masks of file descriptors in longs. - * These macros manipulate such bit fields (the filesystem macros use chars). - * FD_SETSIZE may be defined by the user, but the default here - * should be >= NOFILE (param.h). - */ -#ifndef FD_SETSIZE -#ifdef SUNDBE -#define FD_SETSIZE 2048 -#else -#define FD_SETSIZE 256 -#endif /* SUNDBE */ -#endif - -typedef long fd_mask; -#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ -#ifndef howmany -#define howmany(x, y) (((x) + ((y)-1)) / (y)) -#endif - -typedef struct fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} fd_set; - -#define FD_SET(n, p) ((p)->fds_bits[(n) / NFDBITS] |= (1 << ((n) % NFDBITS))) -#define FD_CLR(n, p) ((p)->fds_bits[(n) / NFDBITS] &= ~(1 << ((n) % NFDBITS))) -#define FD_ISSET(n, p) ((p)->fds_bits[(n) / NFDBITS] & (1 << ((n) % NFDBITS))) -#define FD_ZERO(p) memset((p), 0, sizeof(*(p))) - -#endif /* !_POSIX_SOURCE */ -#endif /* !__sys_types_h */ diff --git a/c/autohint/autohintlib/source/public/winextras/dir.h b/c/autohint/autohintlib/source/public/winextras/dir.h deleted file mode 100644 index 018b9914e..000000000 --- a/c/autohint/autohintlib/source/public/winextras/dir.h +++ /dev/null @@ -1,69 +0,0 @@ -/* @(#)dir.h 2.11 88/08/19 SMI */ - -/* - * Filesystem-independent directory information. - * Directory entry structures are of variable length. - * Each directory entry is a struct direct containing its file number, the - * offset of the next entry (a cookie interpretable only the filesystem - * type that generated it), the length of the entry, and the length of the - * name contained in the entry. These are followed by the name. The - * entire entry is padded with null bytes to a 4 byte boundary. All names - * are guaranteed null terminated. The maximum length of a name in a - * directory is MAXNAMLEN, plus a null byte. - * Note: this file is present only for backwards compatibility. It is superseded - * by the files /usr/include/dirent.h and /usr/include/sys/dirent.h. It will - * disappear in a future major release. - */ - -#ifndef _sys_dir_h -#define _sys_dir_h - -#define MAXNAMLEN 255 - -struct direct { - off_t d_off; /* offset of next disk directory entry */ - unsigned long d_fileno; /* file number of entry */ - unsigned short d_reclen; /* length of this record */ - unsigned short d_namlen; /* length of string in d_name */ - char d_name[MAXNAMLEN + 1]; /* name (up to MAXNAMLEN + 1) */ -}; - -/* - * The macro DIRSIZ(dp) gives the minimum amount of space required to represent - * a directory entry. For any directory entry dp->d_reclen >= DIRSIZ(dp). - * Specific filesystem typesm may use this macro to construct the value - * for d_reclen. - */ -#undef DIRSIZ -#define DIRSIZ(dp) \ - (((sizeof(struct direct) - (MAXNAMLEN + 1) + ((dp)->d_namlen + 1)) + 3) & ~3) - -#ifndef KERNEL -#define d_ino d_fileno /* compatability */ - -/* - * Definitions for library routines operating on directories. - */ -#ifdef WIN32 -typedef struct _dirdesc { - int dd_fd; /* file descriptor */ - long dd_loc; /* buf offset of entry from last readddir() */ - long dd_size; /* amount of valid data in buffer */ - long dd_bsize; /* amount of entries read at a time */ - long dd_off; /* Current offset in dir (for telldir) */ - char *dd_buf; /* directory data buffer */ -} DIR; - -#ifndef NULL -#define NULL 0 -#endif -extern DIR *opendir(); -extern struct direct *readdir(); -extern long telldir(); -extern void seekdir(); -#define rewinddir(dirp) seekdir((dirp), (long)0) -extern int closedir(); -#endif /*WIN32*/ -#endif - -#endif /*!_sys_dir_h*/ diff --git a/c/autohint/autohintlib/source/public/winextras/file.h b/c/autohint/autohintlib/source/public/winextras/file.h deleted file mode 100644 index 475f18e5e..000000000 --- a/c/autohint/autohintlib/source/public/winextras/file.h +++ /dev/null @@ -1,97 +0,0 @@ -/* @(#)file.h 2.20 91/06/18 SMI; from UCB 7.1 6/4/86 */ - -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ - -#ifndef __sys_file_h -#define __sys_file_h - -#ifdef __MWERKS__ -#include "types.h" -#else -#include -#endif - -#ifdef KERNEL -/* - * Descriptor table entry. - * One for each kernel object. - */ -struct file { - int f_flag; /* see below */ - short f_type; /* descriptor type */ - short f_count; /* reference count */ - short f_msgcount; /* references from message queue */ - struct fileops { - int (*fo_rw)(); - int (*fo_ioctl)(); - int (*fo_select)(); - int (*fo_close)(); - } * f_ops; - caddr_t f_data; /* ptr to file specific struct (vnode/socket) */ - off_t f_offset; - struct ucred *f_cred; /* credentials of user who opened file */ -}; - -struct file *file, *fileNFILE; -int nfile; -struct file *getf(); -struct file *falloc(); -#endif /*KERNEL*/ - -#include "fcntl.h" - -/* - * bits to save after an open. The no delay bits mean "don't wait for - * carrier at open" in all cases. Sys5 & POSIX save the no delay bits, - * using them to also mean "don't block on reads"; BSD has you reset it - * with an fcntl() if you want the "don't block on reads" behavior. - */ -#define FMASK (FREAD | FWRITE | FAPPEND | FSYNC | FNBIO | FNONBIO) -#define FCNTLCANT (FREAD | FWRITE | FMARK | FDEFER | FSHLOCK | FEXLOCK | FSETBLK) - -/* - * User definitions. - */ - -/* - * Flock call. - */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* don't block when locking */ -#define LOCK_UN 8 /* unlock */ - -/* - * Access call. Also maintained in unistd.h - */ -#define F_OK 0 /* does file exist */ -#define X_OK 1 /* is it executable by caller */ -#define W_OK 2 /* writable by caller */ -#define R_OK 4 /* readable by caller */ - -/* - * Lseek call. Also maintained in 5include/stdio.h and sys/unistd.h as SEEK_* - */ -#define L_SET 0 /* absolute offset */ -#define L_INCR 1 /* relative to current offset */ -#define L_XTND 2 /* relative to end of file */ -#define LB_SET 3 /* abs. block offset */ -#define LB_INCR 4 /* rel. block offset */ -#define LB_XTND 5 /* block offset rel. to end */ - -#ifdef KERNEL -#define GETF(fp, fd) \ - { \ - if ((fd) < 0 || (fd) > u.u_lastfile || \ - ((fp) = u.u_ofile[fd]) == NULL) { \ - u.u_error = EBADF; \ - return; \ - } \ - } - -#define DTYPE_VNODE 1 /* file */ -#define DTYPE_SOCKET 2 /* communications endpoint */ -#endif /*KERNEL*/ - -#endif /* !__sys_file_h */ diff --git a/c/autohint/autohintlib/source/public/winextras/stdtypes.h b/c/autohint/autohintlib/source/public/winextras/stdtypes.h deleted file mode 100644 index b72ba1e79..000000000 --- a/c/autohint/autohintlib/source/public/winextras/stdtypes.h +++ /dev/null @@ -1,36 +0,0 @@ -/* @(#)stdtypes.h 1.6 90/01/04 SMI */ - -/* - * Suppose you have an ANSI C or POSIX thingy that needs a typedef - * for thingy_t. Put it here and include this file wherever you - * define the thingy. This is used so that we don't have size_t in - * N (N > 1) different places and so that we don't have to have - * types.h included all the time and so that we can include this in - * the lint libs instead of termios.h which conflicts with ioctl.h. - */ -#ifndef __sys_stdtypes_h -#define __sys_stdtypes_h - -#ifndef __MWERKS__ - -typedef int sigset_t; /* signal mask - may change */ - -typedef unsigned int speed_t; /* tty speeds */ -typedef unsigned long tcflag_t; /* tty line disc modes */ -typedef unsigned char cc_t; /* tty control char */ -typedef int pid_t; /* process id */ - -typedef unsigned short mode_t; /* file mode bits */ -typedef short nlink_t; /* links to a file */ - -typedef long clock_t; /* units=ticks (typically 60/sec) */ -typedef long time_t; /* value = secs since epoch */ - -typedef int size_t; /* ??? */ -typedef int ptrdiff_t; /* result of subtracting two pointers */ - -typedef unsigned short wchar_t; /* big enough for biggest char set */ - -#endif - -#endif /* !__sys_stdtypes_h */ diff --git a/c/autohint/autohintlib/source/public/winextras/sysmacros.h b/c/autohint/autohintlib/source/public/winextras/sysmacros.h deleted file mode 100644 index 30c6cb8b4..000000000 --- a/c/autohint/autohintlib/source/public/winextras/sysmacros.h +++ /dev/null @@ -1,19 +0,0 @@ -/* @(#)sysmacros.h 1.4 88/08/19 SMI */ - -/* - * Major/minor device constructing/busting macros. - */ - -#ifndef _sys_sysmacros_h -#define _sys_sysmacros_h - -/* major part of a device */ -#define major(x) ((int)(((unsigned)(x) >> 8) & 0377)) - -/* minor part of a device */ -#define minor(x) ((int)((x)&0377)) - -/* make a device number */ -#define makedev(x, y) ((dev_t)(((x) << 8) | (y))) - -#endif /*!_sys_sysmacros_h*/ diff --git a/c/autohint/autohintlib/source/public/winextras/unistd.h b/c/autohint/autohintlib/source/public/winextras/unistd.h deleted file mode 100644 index 3a9ca18b1..000000000 --- a/c/autohint/autohintlib/source/public/winextras/unistd.h +++ /dev/null @@ -1,121 +0,0 @@ -/* @(#)unistd.h 1.12 89/10/04 SMI; from S5R3 1.5 */ - -#ifndef __sys_unistd_h -#define __sys_unistd_h - -/* WARNING: _SC_CLK_TCK and sysconf() are also defined/declared in . */ -#define _SC_ARG_MAX 1 /* space for argv & envp */ -#define _SC_CHILD_MAX 2 /* maximum children per process??? */ -#define _SC_CLK_TCK 3 /* clock ticks/sec */ -#define _SC_NGROUPS_MAX 4 /* number of groups if multple supp. */ -#define _SC_OPEN_MAX 5 /* max open files per process */ -#define _SC_JOB_CONTROL 6 /* do we have job control */ -#define _SC_SAVED_IDS 7 /* do we have saved uid/gids */ -#define _SC_VERSION 8 /* POSIX version supported */ - -#define _POSIX_JOB_CONTROL 1 -#define _POSIX_SAVED_IDS 1 -#define _POSIX_VERSION 198808 - -#define _PC_LINK_MAX 1 /* max links to file/dir */ -#define _PC_MAX_CANON 2 /* max line length */ -#define _PC_MAX_INPUT 3 /* max "packet" to a tty device */ -#define _PC_NAME_MAX 4 /* max pathname component length */ -#define _PC_PATH_MAX 5 /* max pathname length */ -#define _PC_PIPE_BUF 6 /* size of a pipe */ -#define _PC_CHOWN_RESTRICTED 7 /* can we give away files */ -#define _PC_NO_TRUNC 8 /* trunc or error on >NAME_MAX */ -#define _PC_VDISABLE 9 /* best char to shut off tty c_cc */ -#define _PC_LAST 9 /* highest value of any _PC_* */ - -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 - -#ifndef NULL -#define NULL 0 -#endif - -#ifndef _POSIX_SOURCE -/* - * SVID lockf() requests - */ -#define F_ULOCK 0 /* Unlock a previously locked region */ -#define F_LOCK 1 /* Lock a region for exclusive use */ -#define F_TLOCK 2 /* Test and lock a region for exclusive use */ -#define F_TEST 3 /* Test a region for other processes locks */ - -/* Path names: */ -#define GF_PATH "/etc/group" -#define PF_PATH "/etc/passwd" - -#endif /*!_POSIX_SOURCE*/ - -/* - * lseek & access args - * - * SEEK_* have to track L_* in sys/file.h & SEEK_* in 5include/stdio.h - * ?_OK have to track ?_OK in sys/file.h - */ -#ifndef SEEK_SET -#define SEEK_SET 0 /* Set file pointer to "offset" */ -#define SEEK_CUR 1 /* Set file pointer to current plus "offset" */ -#define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#define F_OK 0 /* does file exist */ -#define X_OK 1 /* is it executable by caller */ -#define W_OK 2 /* is it writable by caller */ -#define R_OK 4 /* is it readable by caller */ - -#if !defined(KERNEL) - -#ifdef __MWERKS__ -#include "types.h" -#else -#include -#endif - -/* extern void _exit(int status );*/ -extern int access(/* char *path, int amode */); -extern unsigned alarm(/* unsigned secs */); -extern int chdir(/* char *path */); -extern int chmod(/* char *path, mode_t mode */); -extern int chown(/* char *path, uid_t owner, gid_t group */); -extern int close(/* int fildes */); -extern char *ctermid(/* char *s */); -extern char *cuserid(/* char *s */); -extern int dup(/* int fildes */); -extern int dup2(/* int fildes, int fildes2 */); -#ifndef CW80 -extern int execl(/* char *path, ... */); -extern int execle(/* char *path, ... */); -extern int execlp(/* char *file, ... */); -extern int execv(/* char *path, char *argv[] */); -extern int execve(/* char *path, char *argv[], char *envp[] */); -extern int execvp(/* char *file, char *argv[] */); -#endif -extern long fpathconf(/* int fd, int name */); -extern char *getcwd(/* char *buf, int size */); -extern int getgroups(/* int gidsetsize, gid_t grouplist[] */); -extern char *getlogin(/* void */); -extern int isatty(/* int fildes */); -extern int link(/* char *path1, char *path2 */); -extern off_t lseek(/* int fildes, off_t offset, int whence */); -extern long pathconf(/* char *path, int name */); -extern int pause(/* void */); -extern int pipe(/* int fildes[2] */); -extern int read(/* int fildes, char *buf, unsigned int nbyte */); -extern int rmdir(/* char *path */); -extern int setgid(/* gid_t gid */); -extern int setpgid(/* pid_t pid, pid_t pgid */); -extern int setuid(/* uid_t uid */); -extern unsigned sleep(/* unsigned int seconds */); -extern long sysconf(/* int name */); -extern int tcsetpgrp(/* int fildes, pid_t pgrp_id */); -extern char *ttyname(/* int fildes */); -/* extern int unlink(const char *path );*/ -extern int write(/* int fildes, char *buf, unsigned int nbyte */); - -#endif /* !KERNEL */ -#endif /* !__sys_unistd_h */ diff --git a/c/autohint/build/linux/gcc/BuildAll.sh b/c/autohint/build/linux/gcc/BuildAll.sh deleted file mode 100755 index b243af8f5..000000000 --- a/c/autohint/build/linux/gcc/BuildAll.sh +++ /dev/null @@ -1,30 +0,0 @@ -#! /bin/sh -set -e -set -x - -target=autohintexe -curdir=$(pwd) - -if [ -z "$1" ] || [ "$1" = "release" ] -then - cd release - make - cd "$curdir" - cp -dR ../../../exe/linux/release/$target ../../../../build_all -elif [ "$1" = "debug" ] -then - cd debug - make - cd "$curdir" - cp -dR ../../../exe/linux/debug/$target ../../../../build_all -elif [ "$1" = "clean" ] -then - cd release - make "$1" - cd "$curdir" - cd debug - make "$1" - cd "$curdir" -else - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -fi diff --git a/c/autohint/build/linux/gcc/debug/Makefile b/c/autohint/build/linux/gcc/debug/Makefile deleted file mode 100644 index d0612bb52..000000000 --- a/c/autohint/build/linux/gcc/debug/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -######################################################################### -# # -# Copyright 1997-2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = debug -ROOT_DIR = ../../../.. -OBJECT_DIR = . -LIB_DIR = $(ROOT_DIR)/autohintlib/lib/$(PLATFORM)/$(CONFIG) - -CFLAGS = $(STD_OPTS) -I$(ROOT_DIR)/autohintlib/source/public/ac \ - -I$(ROOT_DIR)/autohintlib/source/public/extras \ - -I$(ROOT_DIR)/autohintlib/source/ac \ - -I$(ROOT_DIR)/autohintlib/source/bf \ - -DEXECUTABLE=1 -g - -# Program -PRG_SRCS = $(SRC_DIR)/main.c -PRG_OBJS = main.o -PRG_LIBS = $(LIB_DIR)/autohintlib.a -PRG_TARGET = $(EXE_DIR)/autohintexe - -# Build targets -TARGETS = $(PRG_TARGET) - -# Standard definitions -include ../../../../config/linux/gcc/gcc.mak - -# program rule is in gcc.mak - -# Lib rule - $(LIB_DIR)/autohintlib.a: - cd $(ROOT_DIR)/autohintlib/build/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - - -# Object rules -main.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/main.c -o $@ - diff --git a/c/autohint/build/linux/gcc/release/Makefile b/c/autohint/build/linux/gcc/release/Makefile deleted file mode 100644 index 563088604..000000000 --- a/c/autohint/build/linux/gcc/release/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -######################################################################### -# # -# Copyright 1997-2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Configuration -CONFIG = release -ROOT_DIR = ../../../.. -OBJECT_DIR = . -LIB_DIR = $(ROOT_DIR)/autohintlib/lib/$(PLATFORM)/$(CONFIG) - -CFLAGS = $(STD_OPTS) -I$(ROOT_DIR)/autohintlib/source/public/ac \ - -I$(ROOT_DIR)/autohintlib/source/public/extras \ - -I$(ROOT_DIR)/autohintlib/source/ac \ - -I$(ROOT_DIR)/autohintlib/source/bf \ - -DEXECUTABLE=1 - -# Program -PRG_SRCS = $(SRC_DIR)/main.c -PRG_OBJS = main.o -PRG_LIBS = $(LIB_DIR)/autohintlib.a -PRG_TARGET = $(EXE_DIR)/autohintexe - -# Build targets -TARGETS = $(PRG_TARGET) - -# Standard definitions -include ../../../../config/linux/gcc/gcc.mak - -# program rule is in gcc.mak - -# Lib rule - $(LIB_DIR)/autohintlib.a: - cd $(ROOT_DIR)/autohintlib/build/$(PLATFORM)/$(COMPILER)/$(CONFIG); $(MAKE) clean; $(MAKE); - - -# Object rules -main.o: - $(CC) $(CFLAGS) -c $(SRC_DIR)/main.c -o $@ - diff --git a/c/autohint/build/osx/xcode4/BuildAll.sh b/c/autohint/build/osx/xcode4/BuildAll.sh deleted file mode 100755 index ba5fcb9e1..000000000 --- a/c/autohint/build/osx/xcode4/BuildAll.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/sh -set -e -set -x - -target=autohintexe - -if [ -z "$1" ] || [ "$1" = "release" ] -then - xcodebuild -target BuildAll -project $target.xcodeproj -configuration Release - cp ../../../exe/osx/release/$target ../../../../build_all - ls ../../../build -elif [ "$1" = "debug" ] -then - xcodebuild -target BuildAll -project $target.xcodeproj -configuration Debug - cp ../../../exe/osx/debug/$target ../../../../build_all -elif [ "$1" = "clean" ] -then - xcodebuild -target BuildAll -project $target.xcodeproj -configuration Debug "$1" - xcodebuild -target BuildAll -project $target.xcodeproj -configuration Release "$1" -else - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -fi diff --git a/c/autohint/build/osx/xcode4/autohintexe.xcodeproj/project.pbxproj b/c/autohint/build/osx/xcode4/autohintexe.xcodeproj/project.pbxproj deleted file mode 100644 index 960060bfe..000000000 --- a/c/autohint/build/osx/xcode4/autohintexe.xcodeproj/project.pbxproj +++ /dev/null @@ -1,370 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXAggregateTarget section */ - BDD0854714E47AC700F0FC0D /* BuildAll */ = { - isa = PBXAggregateTarget; - buildConfigurationList = BDD0855C14E47B0900F0FC0D /* Build configuration list for PBXAggregateTarget "BuildAll" */; - buildPhases = ( - ); - dependencies = ( - FF99806E1B3D5E000020B466 /* PBXTargetDependency */, - BDD0854D14E47AD500F0FC0D /* PBXTargetDependency */, - ); - name = BuildAll; - productName = BuildAll; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - BB2B3E751B3CFAF600641593 /* libautohintlib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 56AE0BAD1A633B80000ECBEE /* libautohintlib.a */; }; - BD5BF4170D9AD1F80015F645 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = BD5BF4160D9AD1F80015F645 /* main.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 56AE0BAC1A633B80000ECBEE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD5BF4440D9AD3C80015F645 /* autohintlib.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = autohintlib; - }; - BDD0854C14E47AD500F0FC0D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8DD76FA90486AB0100D96B5E; - remoteInfo = autohintexe; - }; - FF99806D1B3D5E000020B466 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BD5BF4440D9AD3C80015F645 /* autohintlib.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = autohintlib; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 56AE0BA71A633867000ECBEE /* libautohintlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libautohintlib.a; path = "../../../../../../../../../Library/Developer/Xcode/DerivedData/autohintexe-aqaujhwuqqtoouhccdzyzjbhhmcb/Build/Products/Debug/libautohintlib.a"; sourceTree = ""; }; - BD5BF40F0D9AD0A50015F645 /* debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = debug.xcconfig; path = ../../../config/xcconfig/debug.xcconfig; sourceTree = SOURCE_ROOT; }; - BD5BF4100D9AD0A50015F645 /* release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = release.xcconfig; path = ../../../config/xcconfig/release.xcconfig; sourceTree = SOURCE_ROOT; }; - BD5BF4130D9AD0DB0015F645 /* ac_C_lib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ac_C_lib.h; path = ../../../autohintlib/source/public/ac/ac_C_lib.h; sourceTree = SOURCE_ROOT; }; - BD5BF4160D9AD1F80015F645 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../../../source/main.c; sourceTree = SOURCE_ROOT; }; - BD5BF4180D9AD2120015F645 /* autohintexe */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = autohintexe; sourceTree = BUILT_PRODUCTS_DIR; }; - BD5BF4200D9AD3230015F645 /* buildfont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = buildfont.h; path = ../../../autohintlib/source/bf/buildfont.h; sourceTree = SOURCE_ROOT; }; - BD5BF4330D9AD3490015F645 /* ../../../autohintlib/source/public/extras/numtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ../../../autohintlib/source/public/extras/numtypes.h; sourceTree = ""; }; - BD5BF4340D9AD3490015F645 /* ../../../autohintlib/source/public/extras/pubtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ../../../autohintlib/source/public/extras/pubtypes.h; sourceTree = ""; }; - BD5BF4360D9AD3630015F645 /* bftoac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bftoac.h; path = ../../../autohintlib/source/bf/bftoac.h; sourceTree = SOURCE_ROOT; }; - BD5BF4370D9AD36B0015F645 /* machinedep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = machinedep.h; path = ../../../autohintlib/source/bf/machinedep.h; sourceTree = SOURCE_ROOT; }; - BD5BF4390D9AD37D0015F645 /* memcheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = memcheck.h; path = ../../../autohintlib/source/public/ac/memcheck.h; sourceTree = SOURCE_ROOT; }; - BD5BF4440D9AD3C80015F645 /* autohintlib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = autohintlib.xcodeproj; path = ../../../autohintlib/build/osx/xcode4/autohintlib.xcodeproj; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8DD76FAD0486AB0100D96B5E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - BB2B3E751B3CFAF600641593 /* libautohintlib.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* autohintexe */ = { - isa = PBXGroup; - children = ( - 56AE0BA71A633867000ECBEE /* libautohintlib.a */, - BD5BF4440D9AD3C80015F645 /* autohintlib.xcodeproj */, - BD5BF4080D9AD0760015F645 /* xcconfig */, - BD5BF4090D9AD0830015F645 /* Headers */, - 08FB7795FE84155DC02AAC07 /* Source */, - C6A0FF2B0290797F04C91782 /* Documentation */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = autohintexe; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - BD5BF4160D9AD1F80015F645 /* main.c */, - ); - name = Source; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - BD5BF4180D9AD2120015F645 /* autohintexe */, - ); - name = Products; - sourceTree = ""; - }; - 56AE0BA91A633B7F000ECBEE /* Products */ = { - isa = PBXGroup; - children = ( - 56AE0BAD1A633B80000ECBEE /* libautohintlib.a */, - ); - name = Products; - sourceTree = ""; - }; - BD5BF4080D9AD0760015F645 /* xcconfig */ = { - isa = PBXGroup; - children = ( - BD5BF40F0D9AD0A50015F645 /* debug.xcconfig */, - BD5BF4100D9AD0A50015F645 /* release.xcconfig */, - ); - name = xcconfig; - sourceTree = ""; - }; - BD5BF4090D9AD0830015F645 /* Headers */ = { - isa = PBXGroup; - children = ( - BD5BF4130D9AD0DB0015F645 /* ac_C_lib.h */, - BD5BF4390D9AD37D0015F645 /* memcheck.h */, - BD5BF4200D9AD3230015F645 /* buildfont.h */, - BD5BF4360D9AD3630015F645 /* bftoac.h */, - BD5BF4370D9AD36B0015F645 /* machinedep.h */, - BD5BF4320D9AD3490015F645 /* extras */, - ); - name = Headers; - sourceTree = ""; - }; - BD5BF4320D9AD3490015F645 /* extras */ = { - isa = PBXGroup; - children = ( - BD5BF4330D9AD3490015F645 /* ../../../autohintlib/source/public/extras/numtypes.h */, - BD5BF4340D9AD3490015F645 /* ../../../autohintlib/source/public/extras/pubtypes.h */, - ); - name = extras; - path = ../../../source/public/extras; - sourceTree = SOURCE_ROOT; - }; - C6A0FF2B0290797F04C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - ); - name = Documentation; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8DD76FA90486AB0100D96B5E /* autohintexe */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "autohintexe" */; - buildPhases = ( - 8DD76FAB0486AB0100D96B5E /* Sources */, - 8DD76FAD0486AB0100D96B5E /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = autohintexe; - productInstallPath = "$(HOME)/bin"; - productName = autohintexe; - productReference = BD5BF4180D9AD2120015F645 /* autohintexe */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - }; - buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "autohintexe" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 08FB7794FE84155DC02AAC07 /* autohintexe */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 56AE0BA91A633B7F000ECBEE /* Products */; - ProjectRef = BD5BF4440D9AD3C80015F645 /* autohintlib.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 8DD76FA90486AB0100D96B5E /* autohintexe */, - BDD0854714E47AC700F0FC0D /* BuildAll */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 56AE0BAD1A633B80000ECBEE /* libautohintlib.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libautohintlib.a; - remoteRef = 56AE0BAC1A633B80000ECBEE /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXSourcesBuildPhase section */ - 8DD76FAB0486AB0100D96B5E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BD5BF4170D9AD1F80015F645 /* main.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - BDD0854D14E47AD500F0FC0D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8DD76FA90486AB0100D96B5E /* autohintexe */; - targetProxy = BDD0854C14E47AD500F0FC0D /* PBXContainerItemProxy */; - }; - FF99806E1B3D5E000020B466 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = autohintlib; - targetProxy = FF99806D1B3D5E000020B466 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1DEB928608733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF40F0D9AD0A50015F645 /* debug.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "EXECUTABLE=1", - "$(inherited)", - ); - HEADER_SEARCH_PATHS = ( - ../../../autohintlib/source/ac, - ../../../autohintlib/source/bf, - ../../../autohintlib/source/public/extras, - ../../../autohintlib/source/public/ac, - ); - }; - name = Debug; - }; - 1DEB928708733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF4100D9AD0A50015F645 /* release.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "EXECUTABLE=1", - "$(inherited)", - ); - HEADER_SEARCH_PATHS = ( - ../../../autohintlib/source/ac, - ../../../autohintlib/source/bf, - ../../../autohintlib/source/public/extras, - ../../../autohintlib/source/public/ac, - ); - }; - name = Release; - }; - 1DEB928A08733DD80010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF40F0D9AD0A50015F645 /* debug.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "EXECUTABLE=1", - "$(inherited)", - ); - HEADER_SEARCH_PATHS = ( - ../../../autohintlib/source/ac, - ../../../autohintlib/source/bf, - ../../../autohintlib/source/public/extras, - ../../../autohintlib/source/public/ac, - "$(SDKROOT)/usr/include", - "$(SDKROOT)/usr/include/sys", - "../../../../public/include_files/sfnt_tables/**", - ); - PRODUCT_NAME = autohintexe; - }; - name = Debug; - }; - 1DEB928B08733DD80010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF4100D9AD0A50015F645 /* release.xcconfig */; - buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "EXECUTABLE=1", - "$(inherited)", - ); - HEADER_SEARCH_PATHS = ( - ../../../autohintlib/source/ac, - ../../../autohintlib/source/bf, - ../../../autohintlib/source/public/extras, - ../../../autohintlib/source/public/ac, - "$(SDKROOT)/usr/include", - "$(SDKROOT)/usr/include/sys", - "../../../../public/include_files/sfnt_tables/**", - ); - PRODUCT_NAME = autohintexe; - }; - name = Release; - }; - BDD0854814E47AC700F0FC0D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF40F0D9AD0A50015F645 /* debug.xcconfig */; - buildSettings = { - }; - name = Debug; - }; - BDD0854914E47AC700F0FC0D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BD5BF4100D9AD0A50015F645 /* release.xcconfig */; - buildSettings = { - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "autohintexe" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928608733DD80010E9CD /* Debug */, - 1DEB928708733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "autohintexe" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB928A08733DD80010E9CD /* Debug */, - 1DEB928B08733DD80010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - BDD0855C14E47B0900F0FC0D /* Build configuration list for PBXAggregateTarget "BuildAll" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - BDD0854814E47AC700F0FC0D /* Debug */, - BDD0854914E47AC700F0FC0D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/c/autohint/build/win/visualstudio/BuildAll.cmd b/c/autohint/build/win/visualstudio/BuildAll.cmd deleted file mode 100755 index e5810fe4c..000000000 --- a/c/autohint/build/win/visualstudio/BuildAll.cmd +++ /dev/null @@ -1,37 +0,0 @@ -@echo off -cd %~dp0 -setlocal enabledelayedexpansion -set targetProgram=autohint - -set do_release=0 -set do_target=0 - -if "%1"=="" set do_release=1 - -if "%1"=="release" set do_release=1 - -if %do_release%==1 ( - set buildConfig=Build - msbuild /target:!buildConfig! /p:configuration=Release %~dp0%targetProgram%.sln - set do_target=1 -) - -if "%1"=="debug" ( - set buildConfig=Build - msbuild /target:!buildConfig! /p:configuration=Debug %~dp0%targetProgram%.sln - set do_target=1 -) - -if %do_target%==1 ( - copy /Y ..\..\..\exe\win\release\%targetProgram%exe.exe ..\..\..\..\build_all -) - -if "%1"=="clean" ( - set buildConfig=Clean - msbuild /target:!buildConfig! /p:configuration=Debug %~dp0%targetProgram%.sln - msbuild /target:!buildConfig! /p:configuration=Release %~dp0%targetProgram%.sln - set do_target=1 -) -if %do_target%==0 ( - echo "Build target must be 'release', 'debug', 'clean', or simply omitted (same as 'release')" -) diff --git a/c/autohint/build/win/visualstudio/autohint.sln b/c/autohint/build/win/visualstudio/autohint.sln deleted file mode 100755 index 6830d6460..000000000 --- a/c/autohint/build/win/visualstudio/autohint.sln +++ /dev/null @@ -1,33 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2047 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "autohintexe", "autohintexe.vcxproj", "{72B7761C-7DAA-4729-9722-81CCE9550E12}" - ProjectSection(ProjectDependencies) = postProject - {FDCEB06E-D2E3-4916-9208-3C70703BFB27} = {FDCEB06E-D2E3-4916-9208-3C70703BFB27} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "autohintlib", "..\..\..\autohintlib\build\win\visualstudio\autohintlib.vcxproj", "{FDCEB06E-D2E3-4916-9208-3C70703BFB27}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {72B7761C-7DAA-4729-9722-81CCE9550E12}.Debug|x86.ActiveCfg = Debug|Win32 - {72B7761C-7DAA-4729-9722-81CCE9550E12}.Debug|x86.Build.0 = Debug|Win32 - {72B7761C-7DAA-4729-9722-81CCE9550E12}.Release|x86.ActiveCfg = Release|Win32 - {72B7761C-7DAA-4729-9722-81CCE9550E12}.Release|x86.Build.0 = Release|Win32 - {FDCEB06E-D2E3-4916-9208-3C70703BFB27}.Debug|x86.ActiveCfg = Debug|Win32 - {FDCEB06E-D2E3-4916-9208-3C70703BFB27}.Debug|x86.Build.0 = Debug|Win32 - {FDCEB06E-D2E3-4916-9208-3C70703BFB27}.Release|x86.ActiveCfg = Release|Win32 - {FDCEB06E-D2E3-4916-9208-3C70703BFB27}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {8A4DAFD0-AB40-4310-A2A3-A0EA88C87AA7} - EndGlobalSection -EndGlobal diff --git a/c/autohint/build/win/visualstudio/autohintexe.vcxproj b/c/autohint/build/win/visualstudio/autohintexe.vcxproj deleted file mode 100755 index b9578191a..000000000 --- a/c/autohint/build/win/visualstudio/autohintexe.vcxproj +++ /dev/null @@ -1,109 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {72B7761C-7DAA-4729-9722-81CCE9550E12} - autohintexe - 10.0.17134.0 - - - - Application - MultiByte - $(DefaultPlatformToolset) - - - Application - MultiByte - $(DefaultPlatformToolset) - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\..\exe\win\debug\ - $(Configuration)\ - true - ..\..\..\exe\win\release\ - $(Configuration)\ - false - $(ProjectName) - $(ProjectName) - - - - Disabled - ..\..\..\autohintlib\source\ac;..\..\..\autohintlib\source\public\ac;..\..\..\autohintlib\source\bf\;..\..\..\autohintlib\source\public\extras;..\..\..\autohintlib\source\public\winextras;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;EXECUTABLE=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDebug - - - Level3 - EditAndContinue - - - autohintlib.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\autohintlib\lib\win\debug;%(AdditionalLibraryDirectories) - true - Console - MachineX86 - - - - - MaxSpeed - ..\..\..\autohintlib\source\ac;..\..\..\autohintlib\source\public\ac;..\..\..\autohintlib\source\bf\;..\..\..\autohintlib\source\public\extras;..\..\..\autohintlib\source\public\winextras;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;EXECUTABLE=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - autohintlib.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName)$(TargetExt) - ..\..\..\autohintlib\lib\win\release;%(AdditionalLibraryDirectories) - false - Console - MachineX86 - - - - - - - - - - - - - - - - {fdceb06e-d2e3-4916-9208-3c70703bfb27} - - - - - - diff --git a/c/autohint/config/linux/gcc/gcc.mak b/c/autohint/config/linux/gcc/gcc.mak deleted file mode 100755 index d69c47916..000000000 --- a/c/autohint/config/linux/gcc/gcc.mak +++ /dev/null @@ -1,55 +0,0 @@ -######################################################################### -# # -# Copyright 2014 Adobe Systems Incorporated. # -# All rights reserved. # -# # -######################################################################### - -# Make definitions for Linux platform (i86) - -# Configuration -PLATFORM = linux -HARDWARE = i86 -COMPILER = gcc -SYS_LIBS = -lm -XFLAGS = -m32 - -# Directories (relative to build directory) -CT_LIB_DIR = $(ROOT_DIR)/../public/lib/lib/$(PLATFORM)/$(CONFIG) -EXE_DIR = $(ROOT_DIR)/exe/$(PLATFORM)/$(CONFIG) -SRC_DIR = $(ROOT_DIR)/source - - -STD_OPTS = $(XFLAGS) \ - -I$(ROOT_DIR)/../public/lib/api \ - -I$(ROOT_DIR)/../public/lib/resource \ - $(SYS_INCLUDES) -ifneq ($(strip $(OSX)),) # In order to test under Mac OSX, define OSX in the user environment. - STD_OPTS += -DOSX=1 -endif - - -default: $(TARGETS) - -$(PRG_TARGET): $(PRG_OBJS) $(PRG_LIBS) $(PRG_SRCS) $(PRG_INCLUDES) - mkdir -p $(EXE_DIR) - $(CC) $(CFLAGS) -o $@ $(PRG_OBJS) $(PRG_LIBS) $(SYS_LIBS) - -clean: - if [ "$(LIB_OBJS)" ]; then \ - rm -f $(LIB_OBJS); \ - fi - - if [ "$(PRG_OBJS)" ]; then \ - rm -f $(PRG_OBJS); \ - fi - - if [ "$(PRG_LIBS)" ]; then \ - rm -f $(PRG_LIBS); \ - fi - - if [ "$(PRG_TARGET)" ]; then \ - rm -f $(PRG_TARGET); \ - fi - - diff --git a/c/autohint/config/xcconfig/common.xcconfig b/c/autohint/config/xcconfig/common.xcconfig deleted file mode 100644 index 2c50eb837..000000000 --- a/c/autohint/config/xcconfig/common.xcconfig +++ /dev/null @@ -1,16 +0,0 @@ -ARCHS = $(ARCHS_STANDARD_32_BIT) -PREBINDING = NO -GCC_C_LANGUAGE_STANDARD = compiler-default -GCC_ENABLE_CPP_RTTI = NO -GCC_SHORT_ENUMS = NO -GCC_PRECOMPILE_PREFIX_HEADER = YES -GCC_WARN_ABOUT_RETURN_TYPE = YES -GCC_WARN_UNKNOWN_PRAGMAS = YES -GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES -GCC_WARN_SIGN_COMPARE = YES -OTHER_CFLAGS = -fno-inline -GCC_MODEL_TUNING = G5 -SDKROOT = macosx -MACOSX_DEPLOYMENT_TARGET = 10.8 -ONLY_ACTIVE_ARCH = YES; -GCC_PREPROCESSOR_DEFINITIONS = OSX=1 OS=os_osx diff --git a/c/autohint/config/xcconfig/debug.xcconfig b/c/autohint/config/xcconfig/debug.xcconfig deleted file mode 100644 index 2bd232ccf..000000000 --- a/c/autohint/config/xcconfig/debug.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -#include "common.xcconfig" -ZERO_LINK = no -UNSTRIPPED_PRODUCT = YES -COPY_PHASE_STRIP = NO -GCC_GENERATE_DEBUGGING_SYMBOLS = YES -GCC_DEBUGGING_SYMBOLS = full -GCC_OPTIMIZATION_LEVEL = 0 -GCC_ENABLE_FIX_AND_CONTINUE = NO -GCC_DYNAMIC_NO_PIC = NO -CONFIGURATION_BUILD_DIR = ../../../exe/osx/debug/ -HEADER_SEARCH_PATHS = $(SDKROOT)/usr/include ../../../sfnt_includes diff --git a/c/autohint/config/xcconfig/release.xcconfig b/c/autohint/config/xcconfig/release.xcconfig deleted file mode 100644 index 293f46b39..000000000 --- a/c/autohint/config/xcconfig/release.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -#include "common.xcconfig" -GCC_GENERATE_DEBUGGING_SYMBOLS = NO -GCC_OPTIMIZATION_LEVEL = s -CONFIGURATION_BUILD_DIR = ../../../exe/osx/release/ -HEADER_SEARCH_PATHS = $(SDKROOT)/usr/include ../../../sfnt_includes diff --git a/c/autohint/doc/AC.doc b/c/autohint/doc/AC.doc deleted file mode 100644 index abfdfc7be..000000000 --- a/c/autohint/doc/AC.doc +++ /dev/null @@ -1,205 +0,0 @@ -AC - Automatic Coloring (Hinting) - -Background ----------- - -AC was written by Bill Paxton over eight years ago. Originally, it -was integrated with the font editor, FE, but Bill extracted the -hinting code so it could run independently and would be easier to -maintain. - -Input ------ - -AC reads a character outline in encrypted bez file format. The fontinfo -file is also read to get alignment zone information, the list of H,V counter -characters, the list of auxiliary H,V stem values, and whether or not flex -can be added to a character. - -As the bez file is read a doubly linked-list is created that contains the -path element information, e.g. coordinates, path type (moveto, curveto...), -etc. - -Setup ------ - -The following initial setup and error checking is done after a character -is read: - -a. Calculate the character bounding box to find the minimum and maximum -x, y values. Supposedly, the very minimum hinting a character will get -is its bounding box values. - -b. Check for duplicate subpaths. - -c. Check for consecutive movetos and only keep the last one. - -d. Check that the path ends with a single closepath and that there are -matching movetos and closepaths. - -e. Initialize the value of the largest vertical and horizontal stem -value allowed. The largest vertical stem value is the larger of 86.25 -and the largest value in the auxiliary V stem array. The largest -horizontal stem value is the larger of 86.25 and the largest value in -the auxiliary H stem array. - -f. If flex is allowed add flex to the character. The current flex -algorithm is very lax and flex can occur where you least expect it. -Almost anything that conforms to page 72 of the black book is flexed. -However, the last line on page 72 says the flex height must be 20 units -or less and this should really say 10 units or less. - -g. Check for smooth curves. If the direction arms tangent to the curve -is between 0 and 30 degrees the points are forced to be colinear. - -h. If there is a sharp angle, greater than 140 degrees, the angle will -be blunted by adding another point. There's a comment that says as of -version 2.21 this blunting will not occur. - -i. Count and save number of subpaths for each path element. - -Hinting -------- - -Generate possible hstem and vstem values. These values are saved as a -linked list (the coloring segment list) in the path element data structure. -There are four segment lists, one for top, bottom, left, and right segments. -The basic progression is: path -> segments -> values -> hints, where a -segment is a horizontal or vertical feature, a value is a pair of -segments (top and bottom or left and right) that is assigned a priority -based on the length and width of a stem, and hints are non-overlapping -pairs with the highest priority. - -Generating {H,V}Stems - -The path element is traversed and possible coordinates are added to the -segment list. The x or y coordinate is saved depending on if it's a -top/bottom or left/right segment and the minimum and maximum extent for a -vertical or horizontal segment. These coordinates are included in the list: -a) the coords of horizontal/vertical lines, b) if this is a curve find the -bends (bend angle must be 135 degrees or less to be included); -don't add a curve's coordinate if the point is not at an extreme and is -going in the same direction as the previous path, c) add points at -extremes, d) add bands for s-curves or where an inflection point occurs, -e) checks are made to see if the curve is in a blue zone and a coordinate -added at the appropriate place. - -Compact the coloring segment lists by removing any pairs that are -completely contained in another. Filter out bogus bend segments and -report any near misses to the horizontal alignment zones. - -Evaluating Stems - -Form all top and bottom, left and right pairs from segment list and -generate ghost pairs for horizontal segments in alignment zones. -A priority value is assigned to each pair. The value is a function -of the length of the segments, the length of any overlap, and the -distance apart. A higher priority value means it is a likely candidate -to be included in the hints and this is given to pairs that are closer -together, longer in length, and have a clean overlap. All pairs with -0 priority are discarded. - -Report any near misses (1 or 2 units) to the values in the H or V stems -array. - -Pruning Values - -Prune non-relevant stem pairs and keep the best of any overlapping pairs. -This is done by looking at the priority values. - -Finding the Best Values - -After pruning, the best pair is found for each top, bottom or left, right -segment using the priority values. Pairs that are at the same location -and are "similar" enough are merged by replacing the lower priority pair -with the higher priority pair. - -The pairs are again checked for near misses (1 or 2 units) to the -values in the H or V stems array, but this time the information is -saved in an array. If fixing these pairs is allowed the pairs saved -in the array are changed to match the value it was "close" to in the -H or V stem array. - -Check to see if H or V counter hints (hstem3, vstem3) should be used -instead of hstem or vstem. - -Create the main hints that are included at the beginning of a character. -These are created by picking, in order of priority, from the segment -lists. - -If no good hints are found use bounding box hints. - -Shuffling Subpaths ------------------- - -The character's subpaths are reordered so that the hints will not need -to change constantly because it is jumping from one subpath to another. -Kanji characters had the most problems with this which caused huge -files to be created. - -Hint Substitution ------------------ - -Remove "flares" from the segment list. Flares usually occur at the top -of a serif where a hint is added at an endpoint, but it's not at the -extreme and there is another endpoint very nearby. This causes a blip -at the top of the serif at low resolutions. Flares are not removed if -they are in an overshoot band. - -Copy hints to earlier elements in the path, if possible, so hint -substitution can start sooner. - -Don't allow hint substitution at short elements, so remove any if -they exist. Short is considered less than 6 units. - -Go through path element looking for pairs. If this pair is compatible -with the currently active hints then add it otherwise start hint -substitution. - -Special Cases -------------- - -When generating stems a procedure is called to allow lines that are not -completely horizontal or vertical to be included in the coloring -segment list. This was specifically included because the serifs of -ITCGaramond Ultra have points that are not quite horizontal according -to the comment int he program. When generating hstem values the threshold -is <= 2 for delta y and >= 25 for delta x. The reverse is true when -generating vstem values. - -There are many thresholds used when evaluating stems, pruning, and -finding the best values. The thresholds used throughout the program are -just "best guesses" according to Bill Paxton. There are various comments -in the code explaining why some of these thresholds were changed and -specifically for which fonts. - -The following characters attempt to have H counter hints added. - - "element", "equivalence", "notelement", "divide" - -in addition to any characters listed in the HCounterChars keyword of -the fontinfo file. - -The following characters attempt to have V counter hints added. - - "m", "M", "T", "ellipsis" - -in addition to any characters listed in the VCounterChars keyword of -the fontinfo file. - -There used to be a special set of characters that received dotsection -hints. This was to handle hinting on older PS interpreters that could -not perform hint replacement. This feature has been commented out of -the current version of AC. - -AC uses a 24.8 Fixed type number rather than the more widely used 16.16. - -Output ------- - -AC writes out a file in encrypted bez file format that includes -the hinting information. Along with each hint it writes a comment -that specifies which path element was used to create this hint. -This comment is used by BuildFont for hinting multiple master -fonts. - diff --git a/c/autohint/doc/bezfileformat.txt b/c/autohint/doc/bezfileformat.txt deleted file mode 100644 index 72c036034..000000000 --- a/c/autohint/doc/bezfileformat.txt +++ /dev/null @@ -1,36 +0,0 @@ - - PROPOSAL FOR BEZIER FILE FORMATS (revised) - -The Standard Bezier format is an encrypted file consisting of the following -operators: - (width) -- character width (* this may be added at a later date) - sc -- start of character outline - rmt -- relative move, same as T1 rmoveto operator) - vmt -- relative move, same as T1 vmoveto operator) - hmt -- relative move, same as T1 hmoveto operator) - rdt -- relative line/draw, same as T1 rlineto operator) - vdt -- relative line/draw, same as T1 vlineto operator) - hdt -- relative line/draw, same as T1 hlineto operator)) - rct -- optimized relative curve, same as T1 rrcurveto operator) - vhct -- optimized relative curve, same as T1 vhcurveto operator) - hvct -- optimized relative curve, same as T1 hvcurveto operator)) - cp -- end of sub-path, same as T1 closepath operator) - ed -- end of character outline, sa,e as T1 endchar operator. - preflx1 -- marks start of flex op, expressed a s T1 path ops - preflx2 -- marks end of flex op - flx -- flex op. - beginsubr snc -- marks start of new block of hint values - endsubr encnewcolors -- marks end of hint values - rb -- horizontal stem hint - ry -- vertical stem hint - rm -- vertical counter hints - rv -- horiztonal counter hints - div -- same PostScript div operator. - - -Notes: -The preflx1/ preflx2 sequence provides the same info as the flex -sequence; the difference is that the preflx1/preflx2 sequence provides -the argument values needed for building a Type1 string while the flex -sequence is simply the 6 rcurveto points. Both sequences are always -provided. diff --git a/c/autohint/source/main.c b/c/autohint/source/main.c deleted file mode 100644 index dd6729d16..000000000 --- a/c/autohint/source/main.c +++ /dev/null @@ -1,516 +0,0 @@ -/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. -This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */ -/* main.c */ - -#include -#include "ac.h" -#include "machinedep.h" - -#ifdef WIN32 -#include -#include -#else -#include -#include -#endif - -const char *C_ProgramVersion = "1.65240"; -const char *reportExt = ".rpt"; -const char *dfltExt = ".new"; -char *bezName = NULL; -char *fileSuffix = NULL; -FILE *reportFile = NULL; - -boolean verbose = TRUE; /* if TRUE don't number of characters processed. */ - -boolean scalinghints = FALSE; - -/* EXECUTABLE defined means it is being compiled as a command-line tool; -if not defined, it is being compiled as a Python module. -*/ -#ifndef EXECUTABLE -extern jmp_buf aclibmark; -#endif - -#if ALLOWCSOUTPUT -boolean charstringoutput = FALSE; -static void read_char_widths(void); -#endif - -#if !WIN32 -extern int unlink(const char *); -#endif - -static void openReportFile(char *name, char *fSuffix); - -static void printVersions(void) { - fprintf(OUTPUTBUFF, "C program version %s. lib version %s.\n", C_ProgramVersion, AC_getVersion()); -} - -static void printUsage(void) { - fprintf(OUTPUTBUFF, "Usage: autohintexe [-u] [-h]\n"); - fprintf(OUTPUTBUFF, " autohintexe -f [-e] [-n] [-q] [-s ] [-ra] [-rs] -a] [ ... ]\n"); - printVersions(); -} - -static void printHelp(void) { - printUsage(); - fprintf(OUTPUTBUFF, " -u usage\n"); - fprintf(OUTPUTBUFF, " -h help message\n"); - fprintf(OUTPUTBUFF, " -e do not edit (change) the paths when hinting\n"); - fprintf(OUTPUTBUFF, " -n no multiple layers of coloring\n"); - fprintf(OUTPUTBUFF, " -q quiet\n"); - fprintf(OUTPUTBUFF, " -f path to font info file\n"); - fprintf(OUTPUTBUFF, " -i This can be used instead of the -f parameter for data input \n"); - fprintf(OUTPUTBUFF, " [name2]..[nameN] paths to glyph bez files\n"); - fprintf(OUTPUTBUFF, " -b the last argument is bez data instead of a file name and the result will go to stdOut\n"); - fprintf(OUTPUTBUFF, " -s Write output data to 'file name' + 'suffix', rather\n"); - fprintf(OUTPUTBUFF, " than writing it to the same file name as the input file.\n"); - fprintf(OUTPUTBUFF, " -ra Write alignment zones data. Does not hint or change glyph. Default extension is '.rpt'\n"); - fprintf(OUTPUTBUFF, " -rs Write stem widths data. Does not hint or change glyph. Default extension is '.rpt'\n"); - fprintf(OUTPUTBUFF, " -a Modifies -ra and -rs: Includes stems between curved lines: default is to omit these.\n"); - fprintf(OUTPUTBUFF, " -v print versions.\n"); -} - -static int main_cleanup(short code) { - closefiles(); - if (code != AC_Success) - exit(code); - - return 0; -} - -static void charZoneCB(Fixed top, Fixed bottom, char *glyphName) { - if (reportFile) - fprintf(reportFile, "charZone %s top %f bottom %f\n", glyphName, top / 256.0, bottom / 256.0); -} - -static void stemZoneCB(Fixed top, Fixed bottom, char *glyphName) { - if (reportFile) - fprintf(reportFile, "stemZone %s top %f bottom %f\n", glyphName, top / 256.0, bottom / 256.0); -} - -static void hstemCB(Fixed top, Fixed bottom, char *glyphName) { - if (reportFile) - fprintf(reportFile, "HStem %s top %f bottom %f\n", glyphName, top / 256.0, bottom / 256.0); -} - -static void vstemCB(Fixed right, Fixed left, char *glyphName) { - if (reportFile) - fprintf(reportFile, "VStem %s right %f left %f\n", glyphName, right / 256.0, left / 256.0); -} - -static void reportCB(char *msg) { - fprintf(OUTPUTBUFF, "%s", msg); - fprintf(OUTPUTBUFF, "\n"); -} - -static void reportRetry(void) { - if (reportFile != NULL) { - fclose(reportFile); - openReportFile(bezName, fileSuffix); - } -} - -static char *getFileData(char *name) { - char *data; - - struct stat filestat; - if ((stat(name, &filestat)) < 0) { - fprintf(OUTPUTBUFF, "Error. Could not open file '%s'. Please check that it exists and is not write-protected.\n", name); - main_cleanup(FATALERROR); - } - - if (filestat.st_size == 0) { - fprintf(OUTPUTBUFF, "Error. File '%s' has zero size.\n", name); - main_cleanup(FATALERROR); - } - - data = malloc(filestat.st_size + 1); - if (data == NULL) { - fprintf(OUTPUTBUFF, "Error. Could not allcoate memory for contents of file %s.\n", name); - main_cleanup(FATALERROR); - } else { - size_t fileSize = 0; - FILE *fp = fopen(name, "r"); - if (fp == NULL) { - fprintf(OUTPUTBUFF, "Error. Could not open file '%s'. Please check that it exists and is not write-protected.\n", name); - main_cleanup(FATALERROR); - } - fileSize = fread(data, 1, filestat.st_size, fp); - data[fileSize] = 0; - fclose(fp); - } - return data; -} - -static void writeFileData(char *name, char *output, char *fSuffix) { - size_t fileSize; - FILE *fp; - size_t nameSize = 1 + strlen(name); - char *savedName; - int usedNewName = 0; - - if ((fSuffix != NULL) && (fSuffix[0] != '\0')) { - nameSize += strlen(fSuffix); - savedName = malloc(nameSize); - savedName[0] = '\0'; - strcat(savedName, name); - strcat(savedName, fSuffix); - usedNewName = 1; - } else - savedName = malloc(nameSize); - - fp = fopen(savedName, "w"); - fileSize = fwrite(output, 1, strlen(output), fp); - fclose(fp); - - if (usedNewName) - free(savedName); -} - -static void openReportFile(char *name, char *fSuffix) { - size_t nameSize = 1 + strlen(name); - char *savedName; - int usedNewName = 0; - - if ((fSuffix != NULL) && (fSuffix[0] != '\0')) { - nameSize += strlen(fSuffix); - savedName = malloc(nameSize); - savedName[0] = '\0'; - strcat(savedName, name); - strcat(savedName, fSuffix); - usedNewName = 1; - } else - savedName = malloc(nameSize); - - reportFile = fopen(savedName, "w"); - - if (usedNewName) - free(savedName); -} - -static void closeReportFile(void) { - if (reportFile != NULL) - fclose(reportFile); -} - -int main(int argc, char *argv[]) { - /* See the discussion in the function definition for: - autohintlib:control.c:Blues() - private procedure Blues() - */ - - int allowEdit, roundCoords, allowHintSub, fixStems, debug, badParam; - boolean argumentIsBezData = false; - char *fontInfoFileName = NULL; /* font info file name, or suffix of environment variable holding the fontfino string. */ - char *fontinfo = NULL; /* the string of fontinfo data */ - int firstFileNameIndex = -1; /* arg index for first bez file name, or suffix of environment variable holding the bez string. */ - - register char *current_arg; - short total_files = 0; - int result, argi; - - badParam = fixStems = debug = doAligns = doStems = allstems = FALSE; - allowEdit = allowHintSub = roundCoords = TRUE; - fileSuffix = (char *)dfltExt; - - /* read in options */ - argi = 0; - while (++argi < argc) { - current_arg = argv[argi]; - - if (current_arg[0] == '\0') { - continue; - } else if (current_arg[0] != '-') { - if (firstFileNameIndex == -1) { - firstFileNameIndex = argi; - } - total_files++; - continue; - } else if (firstFileNameIndex != -1) { - fprintf(OUTPUTBUFF, "Error. Illegal command line. \"-\" option found after first file name.\n"); - exit(1); - } - - switch (current_arg[1]) { - case '\0': - badParam = TRUE; - break; - case 'u': - printUsage(); -#ifdef EXECUTABLE - exit(0); -#else - longjmp(aclibmark, 1); -#endif - break; - case 'h': - printHelp(); -#ifdef EXECUTABLE - exit(0); -#else - longjmp(aclibmark, 1); -#endif - break; - case 'e': - allowEdit = FALSE; - case 'd': - roundCoords = FALSE; - break; - case 'b': - argumentIsBezData = true; - break; - case 'f': - if (fontinfo != NULL) { - fprintf(OUTPUTBUFF, "Error. Illegal command line. \"-f\" can’t be used together with the \"-i\" command.\n"); - exit(1); - } - fontInfoFileName = argv[++argi]; - if ((fontInfoFileName[0] == '\0') || (fontInfoFileName[0] == '-')) { - fprintf(OUTPUTBUFF, "Error. Illegal command line. \"-f\" option must be followed by a file name.\n"); - exit(1); - } - fontinfo = getFileData(fontInfoFileName); - break; - case 'i': - if (fontinfo != NULL) { - fprintf(OUTPUTBUFF, "Error. Illegal command line. \"-i\" can’t be used together with the \"-f\" command.\n"); - exit(1); - } - fontinfo = argv[++argi]; - if ((fontinfo[0] == '\0') || (fontinfo[0] == '-')) { - fprintf(OUTPUTBUFF, "Error. Illegal command line. \"-i\" option must be followed by a font info string.\n"); - exit(1); - } - break; - case 's': - fileSuffix = argv[++argi]; - if ((fileSuffix[0] == '\0') || (fileSuffix[0] == '-')) { - fprintf(OUTPUTBUFF, "Error. Illegal command line. \"-s\" option must be followed by a string, and the string must not begin with '-'.\n"); - exit(1); - } - break; - case 'n': - allowHintSub = FALSE; - break; - case 'q': - verbose = FALSE; - break; - case 'D': - debug = TRUE; - break; - case 'F': - fixStems = TRUE; - break; - case 'a': - allstems = 1; - break; - - case 'r': - allowEdit = allowHintSub = FALSE; - fileSuffix = (char *)reportExt; - switch (current_arg[2]) { - case 'a': - reportRetryCB = reportRetry; - addCharExtremesCB = charZoneCB; - addStemExtremesCB = stemZoneCB; - doAligns = 1; - - addHStemCB = NULL; - addVStemCB = NULL; - doStems = 0; - break; - case 's': - reportRetryCB = reportRetry; - addHStemCB = hstemCB; - addVStemCB = vstemCB; - doStems = 1; - - addCharExtremesCB = NULL; - addStemExtremesCB = NULL; - doAligns = 0; - break; - default: - fprintf(OUTPUTBUFF, "Error. %s is an invalid parameter.\n", current_arg); - badParam = TRUE; - break; - } - break; - case 'v': - printVersions(); - exit(0); - break; - break; -#if ALLOWCSOUTPUT - case 'C': - charstringoutput = TRUE; - break; -#endif - default: - fprintf(OUTPUTBUFF, "Error. %s is an invalid parameter.\n", current_arg); - badParam = TRUE; - break; - } - } - - if (firstFileNameIndex == -1) { - fprintf(OUTPUTBUFF, "Error. Illegal command line. Must provide bez file name.\n"); - badParam = TRUE; - } - if (fontInfoFileName == NULL) { - fprintf(OUTPUTBUFF, "Error. Illegal command line. Must provide font info file name.\n"); - badParam = TRUE; - } - - if (badParam) -#ifdef EXECUTABLE - exit(NONFATALERROR); -#else - longjmp(aclibmark, -1); -#endif - -#if ALLOWCSOUTPUT - if (charstringoutput) - read_char_widths(); -#endif - - AC_SetReportCB(reportCB, verbose); - argi = firstFileNameIndex - 1; - while (++argi < argc) { - char *bezdata; - char *output; - size_t outputsize = 0; - bezName = argv[argi]; - if (!argumentIsBezData) { - bezdata = getFileData(bezName); - } else { - bezdata = bezName; - } - outputsize = 4 * strlen(bezdata); - output = malloc(outputsize); - - if (!argumentIsBezData && (doAligns || doStems)) { - openReportFile(bezName, fileSuffix); - } - - result = AutoColorString(bezdata, fontinfo, output, (int *)&outputsize, allowEdit, allowHintSub, roundCoords, debug); - if (result == AC_DestBuffOfloError) { - if (reportFile != NULL) { - closeReportFile(); - if (!argumentIsBezData && (doAligns || doStems)) { - openReportFile(bezName, fileSuffix); - } - } - free(output); - output = malloc(outputsize); - /* printf("NOTE: trying again. Input size %d output size %d.\n", strlen(bezdata), outputsize); */ - AC_SetReportCB(reportCB, FALSE); - result = AutoColorString(bezdata, fontinfo, output, (int *)&outputsize, allowEdit, allowHintSub, roundCoords, debug); - AC_SetReportCB(reportCB, verbose); - } - - if (reportFile != NULL) { - closeReportFile(); - } else { - if ((outputsize != 0) && (result == AC_Success)) { - if (!argumentIsBezData) { - writeFileData(bezName, output, fileSuffix); - } else { - printf("%s", output); - } - } - } - - free(output); - main_cleanup((result == AC_Success) ? OK : FATALERROR); - } - - return 0; -} -/* end of main */ - -#if ALLOWCSOUTPUT - -typedef struct _wid { - int wid; - char nam[60]; -} WidthElt; - -static WidthElt *widthsarray = NULL; -static int numwidths = 0; -static int maxnumwidths = 0; -#define WIDTHINCR 50 -#define STREQ(a, b) (((a)[0] == (b)[0]) && (strcmp((a), (b)) == 0)) - -static void init_widthsarray(void) { - if (widthsarray != NULL) { -#if DOMEMCHECK - memck_free(widthsarray); -#else - ACFREEMEM(widthsarray); -#endif - widthsarray = NULL; - } - widthsarray = (WidthElt *)calloc(WIDTHINCR + 1, sizeof(WidthElt)); - if (widthsarray == NULL) { - LogMsg("Could not allocate widths.\n", LOGERROR, OK, FALSE); - } - numwidths = 0; - maxnumwidths = WIDTHINCR; -} - -static void set_char_width(char *cname, int width) { - if (numwidths == maxnumwidths) { - widthsarray = (WidthElt *)realloc(widthsarray, (maxnumwidths + WIDTHINCR + 1) * sizeof(WidthElt)); - if (widthsarray == NULL) { - LogMsg("Could not re-allocate widths.\n", LOGERROR, OK, FALSE); - } - maxnumwidths += WIDTHINCR; - } - - widthsarray[numwidths].wid = width; - strcpy(widthsarray[numwidths].nam, cname); - numwidths++; -} - -int get_char_width(char *cname) { - int i; - for (i = 0; i < numwidths; i++) { - if (STREQ(widthsarray[i].nam, cname)) { - return (widthsarray[i].wid); - } - } - sprintf(globmsg, "Could not find width for '%s'. Assuming 1000.\n", cname); - LogMsg(globmsg, INFO, OK, FALSE); - return (1000); -} - -/* Adds width info to char_table. */ -static void read_char_widths(void) { - FILE *fwidth; -#define WIDTHMAXLINE 80 - char cname[50]; - char line[WIDTHMAXLINE + 1]; - int width; - indx ix; - - init_widthsarray(); - fwidth = ACOpenFile("widths.ps", "r", OPENERROR); - while (fgets(line, WIDTHMAXLINE, fwidth) != NULL) { - if (((line[0] == '%') || (ix = strindex(line, "/")) == -1)) { - continue; - } - if (sscanf(&line[ix + 1], " %s %d", cname, &width) != 2) { - sprintf(globmsg, - "%s file line: %s can't be parsed.\n It should have the format: " - "/ WDef\n", - "widths.ps", line); - fclose(fwidth); - LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE); - } - set_char_width(cname, width); - } - fclose(fwidth); -} -#endif /* ALLOWCSOUTPUT */ diff --git a/c/buildall.cmd b/c/buildall.cmd index a6f60ee43..6dde8b6a9 100755 --- a/c/buildall.cmd +++ b/c/buildall.cmd @@ -9,10 +9,6 @@ if %do_target%==0 ( exit /B ) -echo " " -echo "Building autohint..." -call %~dp0autohint\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 - echo " " echo "Building detype1..." call %~dp0detype1\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 diff --git a/setup.py b/setup.py index 410eae6cf..42a4b7ec4 100644 --- a/setup.py +++ b/setup.py @@ -144,7 +144,7 @@ def copy_scripts(self): def _get_scripts(): script_names = [ - 'autohintexe', 'detype1', 'makeotfexe', 'mergefonts', 'rotatefont', + 'detype1', 'makeotfexe', 'mergefonts', 'rotatefont', 'sfntdiff', 'sfntedit', 'spot', 'tx', 'type1' ] if platform.system() == 'Windows': From 34e9a278f049daac76a941e1811074651161d078 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Wed, 12 Sep 2018 00:21:23 -0700 Subject: [PATCH 06/26] [travis] Remove CIBW_BEFORE_BUILD_LINUX command This was only needed for compiling autohintexe --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3866aa1a0..8d660801c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: python env: global: - CIBW_SKIP="cp34-* cp35-* cp37-* *i686" - - CIBW_BEFORE_BUILD_LINUX="yum install -y glibc-devel.i386 libgcc_s.so.1" - CIBW_ENVIRONMENT_LINUX="CODECOV_TOKEN=e0067bac-3ded-4432-83c8-667217c76660" - CIBW_TEST_REQUIRES="pytest-cov==2.5.1 codecov subprocess32" - CIBW_TEST_COMMAND="cd {project} && pytest --cov -v && coverage combine && codecov && pip uninstall --yes afdko" From 3369bf0b5b6f293434609cb4f244443a2dc40fb3 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Tue, 11 Sep 2018 17:31:34 -0700 Subject: [PATCH 07/26] Add x64 configuration to Visual Studio files Also did some cleaning up on them --- c/detype1/build/win/visualstudio/detype1.sln | 7 +- .../build/win/visualstudio/detype1.vcxproj | 75 ++++++- c/makeotf/build/win/visualstudio/makeotf.sln | 30 +++ .../build/win/visualstudio/makeotf.vcxproj | 89 +++++++- .../cffread/win/visualstudio/cffread.vcxproj | 58 +++++- .../hotconv/win/visualstudio/hotconv.vcxproj | 58 ++++++ .../pstoken/win/visualstudio/pstoken.vcxproj | 58 +++++- .../win/visualstudio/typecomp.vcxproj | 58 +++++- .../build/win/visualstudio/mergeFonts.sln | 196 +++++++++--------- .../build/win/visualstudio/mergeFonts.vcxproj | 87 +++++++- .../absfont/win/visualstudio/absfont.vcxproj | 58 +++++- .../cfembed/win/visualstudio/cfembed.vcxproj | 58 +++++- .../cffread/win/visualstudio/cffread.vcxproj | 58 +++++- .../win/visualstudio/cffwrite.vcxproj | 58 +++++- .../ctutil/win/visualstudio/ctutil.vcxproj | 58 +++++- .../dynarr/win/visualstudio/dynarr.vcxproj | 58 +++++- .../win/visualstudio/nameread.vcxproj | 58 +++++- .../win/visualstudio/pdfwrite.vcxproj | 58 +++++- .../pstoken/win/visualstudio/pstoken.vcxproj | 58 +++++- .../win/visualstudio/sfntread.vcxproj | 58 +++++- .../win/visualstudio/sfntwrite.vcxproj | 58 +++++- .../build/sha1/win/visualstudio/sha1.vcxproj | 57 ++++- .../support/win/visualstudio/support.vcxproj | 58 +++++- .../win/visualstudio/svgwrite.vcxproj | 58 +++++- .../svread/win/visualstudio/svread.vcxproj | 58 +++++- .../t1cstr/win/visualstudio/t1cstr.vcxproj | 58 +++++- .../t1read/win/visualstudio/t1read.vcxproj | 58 +++++- .../t1write/win/visualstudio/t1write.vcxproj | 58 +++++- .../t2cstr/win/visualstudio/t2cstr.vcxproj | 58 +++++- .../ttread/win/visualstudio/ttread.vcxproj | 58 +++++- .../uforead/win/visualstudio/uforead.vcxproj | 62 ++++++ .../win/visualstudio/ufowrite.vcxproj | 58 +++++- .../varread/win/visualstudio/varread.vcxproj | 58 +++++- .../build/win/visualstudio/rotateFont.sln | 196 +++++++++--------- .../build/win/visualstudio/rotateFont.vcxproj | 87 +++++++- .../build/win/visualstudio/sfntdiff.sln | 6 + .../build/win/visualstudio/sfntdiff.vcxproj | 77 ++++++- .../build/win/visualstudio/sfntedit.sln | 6 + .../build/win/visualstudio/sfntedit.vcxproj | 79 ++++++- c/spot/build/win/visualstudio/spot.sln | 6 + c/spot/build/win/visualstudio/spot.vcxproj | 77 ++++++- c/tx/build/win/visualstudio/tx.sln | 196 +++++++++--------- c/tx/build/win/visualstudio/tx.vcxproj | 93 ++++++++- c/type1/build/win/visualstudio/type1.sln | 7 +- c/type1/build/win/visualstudio/type1.vcxproj | 77 ++++++- 45 files changed, 2597 insertions(+), 363 deletions(-) diff --git a/c/detype1/build/win/visualstudio/detype1.sln b/c/detype1/build/win/visualstudio/detype1.sln index 679bf2d98..b9e45fd54 100644 --- a/c/detype1/build/win/visualstudio/detype1.sln +++ b/c/detype1/build/win/visualstudio/detype1.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27703.2047 @@ -7,12 +6,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "detype1", "detype1.vcxproj" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x64.ActiveCfg = Debug|x64 + {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x64.Build.0 = Debug|x64 {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x86.ActiveCfg = Debug|Win32 {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x86.Build.0 = Debug|Win32 + {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x64.ActiveCfg = Release|x64 + {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x64.Build.0 = Release|x64 {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x86.ActiveCfg = Release|Win32 {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/c/detype1/build/win/visualstudio/detype1.vcxproj b/c/detype1/build/win/visualstudio/detype1.vcxproj index 44650e391..b967c825a 100755 --- a/c/detype1/build/win/visualstudio/detype1.vcxproj +++ b/c/detype1/build/win/visualstudio/detype1.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {BBE0C559-C528-4619-9449-AB466605C1C8} @@ -21,31 +29,57 @@ MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + Application MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\..\..\exe\win\debug\ $(Configuration)\ true + true ..\..\..\exe\win\release\ $(Configuration)\ false + false $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) + + + ..\..\..\exe\win\release\ + + + ..\..\..\exe\win\debug\ @@ -59,12 +93,31 @@ EditAndContinue - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) true Console MachineX86 + + + Disabled + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + true + Console + + MaxSpeed @@ -77,11 +130,29 @@ ProgramDatabase - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) Console MachineX86 + + + MaxSpeed + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + Console + + diff --git a/c/makeotf/build/win/visualstudio/makeotf.sln b/c/makeotf/build/win/visualstudio/makeotf.sln index 54d2e9d92..9cd0ea563 100644 --- a/c/makeotf/build/win/visualstudio/makeotf.sln +++ b/c/makeotf/build/win/visualstudio/makeotf.sln @@ -18,36 +18,66 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "typecomp", "..\..\..\makeot EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Debug|x64.ActiveCfg = Debug|x64 + {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Debug|x64.Build.0 = Debug|x64 {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Debug|x86.ActiveCfg = Debug|Win32 {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Debug|x86.Build.0 = Debug|Win32 + {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Release|x64.ActiveCfg = Release|x64 + {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Release|x64.Build.0 = Release|x64 {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Release|x86.ActiveCfg = Release|Win32 {00D7DB77-ABC2-440B-A2EB-7F8C51884E05}.Release|x86.Build.0 = Release|Win32 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.ActiveCfg = Debug|x64 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.Build.0 = Debug|x64 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.ActiveCfg = Debug|Win32 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.Build.0 = Debug|Win32 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.ActiveCfg = Release|x64 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.Build.0 = Release|x64 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.ActiveCfg = Release|Win32 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.Build.0 = Release|Win32 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.ActiveCfg = Debug|x64 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.Build.0 = Debug|x64 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.ActiveCfg = Debug|Win32 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.Build.0 = Debug|Win32 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.ActiveCfg = Release|x64 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.Build.0 = Release|x64 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.ActiveCfg = Release|Win32 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.Build.0 = Release|Win32 + {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Debug|x64.ActiveCfg = Debug|x64 + {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Debug|x64.Build.0 = Debug|x64 {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Debug|x86.ActiveCfg = Debug|Win32 {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Debug|x86.Build.0 = Debug|Win32 + {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Release|x64.ActiveCfg = Release|x64 + {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Release|x64.Build.0 = Release|x64 {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Release|x86.ActiveCfg = Release|Win32 {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD}.Release|x86.Build.0 = Release|Win32 + {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Debug|x64.ActiveCfg = Debug|x64 + {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Debug|x64.Build.0 = Debug|x64 {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Debug|x86.ActiveCfg = Debug|Win32 {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Debug|x86.Build.0 = Debug|Win32 + {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Release|x64.ActiveCfg = Release|x64 + {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Release|x64.Build.0 = Release|x64 {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Release|x86.ActiveCfg = Release|Win32 {3B478F53-4BAB-49FA-A4F5-DEB315241C7C}.Release|x86.Build.0 = Release|Win32 + {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Debug|x64.ActiveCfg = Debug|x64 + {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Debug|x64.Build.0 = Debug|x64 {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Debug|x86.ActiveCfg = Debug|Win32 {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Debug|x86.Build.0 = Debug|Win32 + {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Release|x64.ActiveCfg = Release|x64 + {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Release|x64.Build.0 = Release|x64 {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Release|x86.ActiveCfg = Release|Win32 {2B131B1A-B54A-48BF-9B5E-5B446E6C662C}.Release|x86.Build.0 = Release|Win32 + {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Debug|x64.ActiveCfg = Debug|x64 + {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Debug|x64.Build.0 = Debug|x64 {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Debug|x86.ActiveCfg = Debug|Win32 {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Debug|x86.Build.0 = Debug|Win32 + {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Release|x64.ActiveCfg = Release|x64 + {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Release|x64.Build.0 = Release|x64 {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Release|x86.ActiveCfg = Release|Win32 {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/c/makeotf/build/win/visualstudio/makeotf.vcxproj b/c/makeotf/build/win/visualstudio/makeotf.vcxproj index f8c46c5bc..747ee4c37 100755 --- a/c/makeotf/build/win/visualstudio/makeotf.vcxproj +++ b/c/makeotf/build/win/visualstudio/makeotf.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {3B478F53-4BAB-49FA-A4F5-DEB315241C7C} @@ -21,31 +29,57 @@ MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + Application MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\..\..\exe\win\debug\ $(Configuration)\ true + true ..\..\..\exe\win\release\ $(Configuration)\ false + false $(ProjectName)exe + $(ProjectName)exe $(ProjectName)exe + $(ProjectName)exe + + + ..\..\..\exe\win\release\ + + + ..\..\..\exe\win\debug\ @@ -59,18 +93,41 @@ EditAndContinue - ctutil.lib;dynarr.lib;hotconv.lib;pstoken.lib;typecomp.lib;cffread.lib;%(AdditionalDependencies) - ..\..\..\..\public\lib\lib\win\debug;..\..\..\makeotf_lib\lib\win\debug;%(AdditionalLibraryDirectories) + %(AdditionalDependencies) + $(OutDir) 536870912 536870912 32000000 32000000 - $(OutDir)$(TargetName)$(TargetExt) + $(TargetPath) true Console MachineX86 + + + Disabled + ..\..\..\source\include_files;..\..\..\makeotf_lib\api;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) + WIN32;DEBUG;_WINDOWS;MAKEOTFLIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir) + 536870912 + 536870912 + 32000000 + 32000000 + $(TargetPath) + true + Console + + MaxSpeed @@ -83,15 +140,35 @@ ProgramDatabase - ctutil.lib;dynarr.lib;hotconv.lib;pstoken.lib;typecomp.lib;cffread.lib;%(AdditionalDependencies) - ..\..\..\..\public\lib\lib\win\release;..\..\..\makeotf_lib\lib\win\release;%(AdditionalLibraryDirectories) + %(AdditionalDependencies) + $(OutDir) 8000000 8000000 - $(OutDir)$(TargetName)$(TargetExt) + $(TargetPath) Console MachineX86 + + + MaxSpeed + ..\..\..\source\include_files;..\..\..\makeotf_lib\api;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) + CDECL=__cdecl;WIN32;NDEBUG;_WINDOWS;MAKEOTFLIB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir) + 8000000 + 8000000 + $(TargetPath) + Console + + diff --git a/c/makeotf/makeotf_lib/build/cffread/win/visualstudio/cffread.vcxproj b/c/makeotf/makeotf_lib/build/cffread/win/visualstudio/cffread.vcxproj index f84f779d6..a89c2dc81 100755 --- a/c/makeotf/makeotf_lib/build/cffread/win/visualstudio/cffread.vcxproj +++ b/c/makeotf/makeotf_lib/build/cffread/win/visualstudio/cffread.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {00D7DB77-ABC2-440B-A2EB-7F8C51884E05} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) + CDECL=__cdecl;CFF_DEBUG=1;CFF_T13_SUPPORT=0;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) + CFF_T13_SUPPORT=0;CDECL=__cdecl;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/makeotf/makeotf_lib/build/hotconv/win/visualstudio/hotconv.vcxproj b/c/makeotf/makeotf_lib/build/hotconv/win/visualstudio/hotconv.vcxproj index f0b786e1a..1c057170d 100755 --- a/c/makeotf/makeotf_lib/build/hotconv/win/visualstudio/hotconv.vcxproj +++ b/c/makeotf/makeotf_lib/build/hotconv/win/visualstudio/hotconv.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {5D5223A6-5A8A-4F7E-B9B0-9F0567935CAD} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -61,6 +87,22 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;../../../hotpccts/pccts/h;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) + CDECL=__cdecl;HOT_FEAT_SUPPORT=1;HOT_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + true + + + %(ExportNamedFunctions) + + MaxSpeed @@ -77,6 +119,22 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;../../../hotpccts/pccts/h;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) + NDEBUG;CDECL=__cdecl;HOT_FEAT_SUPPORT=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + true + + + %(ExportNamedFunctions) + + diff --git a/c/makeotf/makeotf_lib/build/pstoken/win/visualstudio/pstoken.vcxproj b/c/makeotf/makeotf_lib/build/pstoken/win/visualstudio/pstoken.vcxproj index 1d072ce05..7dcb00cfb 100755 --- a/c/makeotf/makeotf_lib/build/pstoken/win/visualstudio/pstoken.vcxproj +++ b/c/makeotf/makeotf_lib/build/pstoken/win/visualstudio/pstoken.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {2B131B1A-B54A-48BF-9B5E-5B446E6C662C} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) + CDECL=__cdecl;PS_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) + NDEBUG;CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/makeotf/makeotf_lib/build/typecomp/win/visualstudio/typecomp.vcxproj b/c/makeotf/makeotf_lib/build/typecomp/win/visualstudio/typecomp.vcxproj index 8c4e7c3bc..5c882f6fa 100755 --- a/c/makeotf/makeotf_lib/build/typecomp/win/visualstudio/typecomp.vcxproj +++ b/c/makeotf/makeotf_lib/build/typecomp/win/visualstudio/typecomp.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {89D0CCF4-7829-42F6-A42A-8ADCE2D2F036} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) + CDECL=__cdecl;TC_HINT_CHECK=1;TC_DEBUG=1;TC_T13_SUPPORT=0;TC_EURO_SUPPORT=1;TC_SUBR_SUPPORT=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;../../../../../../public/lib/api;../../../../../../public/lib/resource;%(AdditionalIncludeDirectories) + NDEBUG;CDECL=__cdecl;TC_HINT_CHECK=1;TC_T13_SUPPORT=0;TC_EURO_SUPPORT=1;TC_SUBR_SUPPORT=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/mergefonts/build/win/visualstudio/mergeFonts.sln b/c/mergefonts/build/win/visualstudio/mergeFonts.sln index 4bf80c5b7..458c6f599 100644 --- a/c/mergefonts/build/win/visualstudio/mergeFonts.sln +++ b/c/mergefonts/build/win/visualstudio/mergeFonts.sln @@ -56,202 +56,202 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "varread", "..\..\..\..\publ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_bc|x86 = Debug_bc|x86 + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 - Release_bc|x86 = Release_bc|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {66C1C775-5375-41AC-BEC0-93173237700D}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {66C1C775-5375-41AC-BEC0-93173237700D}.Debug_bc|x86.Build.0 = Debug|Win32 + {66C1C775-5375-41AC-BEC0-93173237700D}.Debug|x64.ActiveCfg = Debug|x64 + {66C1C775-5375-41AC-BEC0-93173237700D}.Debug|x64.Build.0 = Debug|x64 {66C1C775-5375-41AC-BEC0-93173237700D}.Debug|x86.ActiveCfg = Debug|Win32 {66C1C775-5375-41AC-BEC0-93173237700D}.Debug|x86.Build.0 = Debug|Win32 - {66C1C775-5375-41AC-BEC0-93173237700D}.Release_bc|x86.ActiveCfg = Release|Win32 - {66C1C775-5375-41AC-BEC0-93173237700D}.Release_bc|x86.Build.0 = Release|Win32 + {66C1C775-5375-41AC-BEC0-93173237700D}.Release|x64.ActiveCfg = Release|x64 + {66C1C775-5375-41AC-BEC0-93173237700D}.Release|x64.Build.0 = Release|x64 {66C1C775-5375-41AC-BEC0-93173237700D}.Release|x86.ActiveCfg = Release|Win32 {66C1C775-5375-41AC-BEC0-93173237700D}.Release|x86.Build.0 = Release|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Debug_bc|x86.Build.0 = Debug|Win32 + {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x64.ActiveCfg = Debug|x64 + {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x64.Build.0 = Debug|x64 {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x86.ActiveCfg = Debug|Win32 {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x86.Build.0 = Debug|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Release_bc|x86.ActiveCfg = Release|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Release_bc|x86.Build.0 = Release|Win32 + {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x64.ActiveCfg = Release|x64 + {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x64.Build.0 = Release|x64 {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x86.ActiveCfg = Release|Win32 {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x86.Build.0 = Release|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug_bc|x86.Build.0 = Debug|Win32 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x64.ActiveCfg = Debug|x64 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x64.Build.0 = Debug|x64 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x86.ActiveCfg = Debug|Win32 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x86.Build.0 = Debug|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release_bc|x86.ActiveCfg = Release|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release_bc|x86.Build.0 = Release|Win32 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x64.ActiveCfg = Release|x64 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x64.Build.0 = Release|x64 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x86.ActiveCfg = Release|Win32 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x86.Build.0 = Release|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug_bc|x86.Build.0 = Debug|Win32 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x64.ActiveCfg = Debug|x64 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x64.Build.0 = Debug|x64 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x86.ActiveCfg = Debug|Win32 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x86.Build.0 = Debug|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release_bc|x86.ActiveCfg = Release|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release_bc|x86.Build.0 = Release|Win32 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x64.ActiveCfg = Release|x64 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x64.Build.0 = Release|x64 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x86.ActiveCfg = Release|Win32 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x86.Build.0 = Release|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug_bc|x86.Build.0 = Debug|Win32 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x64.ActiveCfg = Debug|x64 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x64.Build.0 = Debug|x64 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x86.ActiveCfg = Debug|Win32 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x86.Build.0 = Debug|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release_bc|x86.ActiveCfg = Release|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release_bc|x86.Build.0 = Release|Win32 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x64.ActiveCfg = Release|x64 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x64.Build.0 = Release|x64 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x86.ActiveCfg = Release|Win32 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x86.Build.0 = Release|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug_bc|x86.Build.0 = Debug|Win32 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.ActiveCfg = Debug|x64 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.Build.0 = Debug|x64 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.ActiveCfg = Debug|Win32 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.Build.0 = Debug|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release_bc|x86.ActiveCfg = Release|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release_bc|x86.Build.0 = Release|Win32 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.ActiveCfg = Release|x64 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.Build.0 = Release|x64 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.ActiveCfg = Release|Win32 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.Build.0 = Release|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug_bc|x86.Build.0 = Debug|Win32 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.ActiveCfg = Debug|x64 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.Build.0 = Debug|x64 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.ActiveCfg = Debug|Win32 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.Build.0 = Debug|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release_bc|x86.ActiveCfg = Release|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release_bc|x86.Build.0 = Release|Win32 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.ActiveCfg = Release|x64 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.Build.0 = Release|x64 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.ActiveCfg = Release|Win32 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.Build.0 = Release|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug_bc|x86.Build.0 = Debug|Win32 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x64.ActiveCfg = Debug|x64 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x64.Build.0 = Debug|x64 {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x86.ActiveCfg = Debug|Win32 {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x86.Build.0 = Debug|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Release_bc|x86.ActiveCfg = Release|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Release_bc|x86.Build.0 = Release|Win32 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x64.ActiveCfg = Release|x64 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x64.Build.0 = Release|x64 {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x86.ActiveCfg = Release|Win32 {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x86.Build.0 = Release|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug_bc|x86.Build.0 = Debug|Win32 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x64.ActiveCfg = Debug|x64 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x64.Build.0 = Debug|x64 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x86.ActiveCfg = Debug|Win32 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x86.Build.0 = Debug|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release_bc|x86.ActiveCfg = Release|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release_bc|x86.Build.0 = Release|Win32 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x64.ActiveCfg = Release|x64 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x64.Build.0 = Release|x64 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x86.ActiveCfg = Release|Win32 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x86.Build.0 = Release|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug_bc|x86.Build.0 = Debug|Win32 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x64.ActiveCfg = Debug|x64 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x64.Build.0 = Debug|x64 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x86.ActiveCfg = Debug|Win32 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x86.Build.0 = Debug|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release_bc|x86.ActiveCfg = Release|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release_bc|x86.Build.0 = Release|Win32 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x64.ActiveCfg = Release|x64 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x64.Build.0 = Release|x64 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x86.ActiveCfg = Release|Win32 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x86.Build.0 = Release|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Debug_bc|x86.Build.0 = Debug|Win32 + {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x64.ActiveCfg = Debug|x64 + {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x64.Build.0 = Debug|x64 {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x86.ActiveCfg = Debug|Win32 {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x86.Build.0 = Debug|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Release_bc|x86.ActiveCfg = Release|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Release_bc|x86.Build.0 = Release|Win32 + {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x64.ActiveCfg = Release|x64 + {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x64.Build.0 = Release|x64 {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x86.ActiveCfg = Release|Win32 {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x86.Build.0 = Release|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug_bc|x86.Build.0 = Debug|Win32 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x64.ActiveCfg = Debug|x64 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x64.Build.0 = Debug|x64 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x86.ActiveCfg = Debug|Win32 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x86.Build.0 = Debug|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release_bc|x86.ActiveCfg = Release|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release_bc|x86.Build.0 = Release|Win32 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x64.ActiveCfg = Release|x64 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x64.Build.0 = Release|x64 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x86.ActiveCfg = Release|Win32 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x86.Build.0 = Release|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug_bc|x86.Build.0 = Debug|Win32 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x64.ActiveCfg = Debug|x64 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x64.Build.0 = Debug|x64 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x86.ActiveCfg = Debug|Win32 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x86.Build.0 = Debug|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release_bc|x86.ActiveCfg = Release|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release_bc|x86.Build.0 = Release|Win32 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x64.ActiveCfg = Release|x64 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x64.Build.0 = Release|x64 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x86.ActiveCfg = Release|Win32 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x86.Build.0 = Release|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug_bc|x86.Build.0 = Debug|Win32 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x64.ActiveCfg = Debug|x64 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x64.Build.0 = Debug|x64 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x86.ActiveCfg = Debug|Win32 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x86.Build.0 = Debug|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release_bc|x86.ActiveCfg = Release|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release_bc|x86.Build.0 = Release|Win32 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x64.ActiveCfg = Release|x64 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x64.Build.0 = Release|x64 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x86.ActiveCfg = Release|Win32 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x86.Build.0 = Release|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug_bc|x86.Build.0 = Debug|Win32 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x64.ActiveCfg = Debug|x64 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x64.Build.0 = Debug|x64 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x86.ActiveCfg = Debug|Win32 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x86.Build.0 = Debug|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release_bc|x86.ActiveCfg = Release|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release_bc|x86.Build.0 = Release|Win32 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x64.ActiveCfg = Release|x64 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x64.Build.0 = Release|x64 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x86.ActiveCfg = Release|Win32 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x86.Build.0 = Release|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug_bc|x86.Build.0 = Debug|Win32 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x64.ActiveCfg = Debug|x64 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x64.Build.0 = Debug|x64 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x86.ActiveCfg = Debug|Win32 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x86.Build.0 = Debug|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release_bc|x86.ActiveCfg = Release|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release_bc|x86.Build.0 = Release|Win32 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x64.ActiveCfg = Release|x64 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x64.Build.0 = Release|x64 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x86.ActiveCfg = Release|Win32 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x86.Build.0 = Release|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug_bc|x86.Build.0 = Debug|Win32 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x64.ActiveCfg = Debug|x64 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x64.Build.0 = Debug|x64 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x86.ActiveCfg = Debug|Win32 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x86.Build.0 = Debug|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release_bc|x86.ActiveCfg = Release|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release_bc|x86.Build.0 = Release|Win32 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x64.ActiveCfg = Release|x64 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x64.Build.0 = Release|x64 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x86.ActiveCfg = Release|Win32 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x86.Build.0 = Release|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug_bc|x86.Build.0 = Debug|Win32 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x64.ActiveCfg = Debug|x64 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x64.Build.0 = Debug|x64 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x86.ActiveCfg = Debug|Win32 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x86.Build.0 = Debug|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release_bc|x86.ActiveCfg = Release|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release_bc|x86.Build.0 = Release|Win32 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x64.ActiveCfg = Release|x64 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x64.Build.0 = Release|x64 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x86.ActiveCfg = Release|Win32 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x86.Build.0 = Release|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug_bc|x86.Build.0 = Debug|Win32 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x64.ActiveCfg = Debug|x64 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x64.Build.0 = Debug|x64 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x86.ActiveCfg = Debug|Win32 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x86.Build.0 = Debug|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release_bc|x86.ActiveCfg = Release|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release_bc|x86.Build.0 = Release|Win32 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x64.ActiveCfg = Release|x64 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x64.Build.0 = Release|x64 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x86.ActiveCfg = Release|Win32 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x86.Build.0 = Release|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug_bc|x86.Build.0 = Debug|Win32 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x64.ActiveCfg = Debug|x64 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x64.Build.0 = Debug|x64 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x86.ActiveCfg = Debug|Win32 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x86.Build.0 = Debug|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release_bc|x86.ActiveCfg = Release|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release_bc|x86.Build.0 = Release|Win32 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x64.ActiveCfg = Release|x64 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x64.Build.0 = Release|x64 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x86.ActiveCfg = Release|Win32 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x86.Build.0 = Release|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug_bc|x86.Build.0 = Debug|Win32 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x64.ActiveCfg = Debug|x64 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x64.Build.0 = Debug|x64 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x86.ActiveCfg = Debug|Win32 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x86.Build.0 = Debug|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release_bc|x86.ActiveCfg = Release|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release_bc|x86.Build.0 = Release|Win32 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x64.ActiveCfg = Release|x64 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x64.Build.0 = Release|x64 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x86.ActiveCfg = Release|Win32 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x86.Build.0 = Release|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug_bc|x86.Build.0 = Debug|Win32 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x64.ActiveCfg = Debug|x64 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x64.Build.0 = Debug|x64 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x86.ActiveCfg = Debug|Win32 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x86.Build.0 = Debug|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release_bc|x86.ActiveCfg = Release|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release_bc|x86.Build.0 = Release|Win32 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x64.ActiveCfg = Release|x64 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x64.Build.0 = Release|x64 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x86.ActiveCfg = Release|Win32 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x86.Build.0 = Release|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug_bc|x86.Build.0 = Debug|Win32 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x64.ActiveCfg = Debug|x64 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x64.Build.0 = Debug|x64 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x86.ActiveCfg = Debug|Win32 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x86.Build.0 = Debug|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release_bc|x86.ActiveCfg = Release|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release_bc|x86.Build.0 = Release|Win32 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x64.ActiveCfg = Release|x64 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x64.Build.0 = Release|x64 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x86.ActiveCfg = Release|Win32 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x86.Build.0 = Release|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug_bc|x86.Build.0 = Debug|Win32 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x64.ActiveCfg = Debug|x64 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x64.Build.0 = Debug|x64 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x86.ActiveCfg = Debug|Win32 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x86.Build.0 = Debug|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release_bc|x86.ActiveCfg = Release|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release_bc|x86.Build.0 = Release|Win32 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x64.ActiveCfg = Release|x64 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x64.Build.0 = Release|x64 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x86.ActiveCfg = Release|Win32 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/c/mergefonts/build/win/visualstudio/mergeFonts.vcxproj b/c/mergefonts/build/win/visualstudio/mergeFonts.vcxproj index dc5b2f31a..28a212126 100755 --- a/c/mergefonts/build/win/visualstudio/mergeFonts.vcxproj +++ b/c/mergefonts/build/win/visualstudio/mergeFonts.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {66C1C775-5375-41AC-BEC0-93173237700D} @@ -21,36 +29,62 @@ MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + Application MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\..\..\exe\win\debug\ $(Configuration)\ true + true ..\..\..\exe\win\release\ $(Configuration)\ false + false $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) + + + ..\..\..\exe\win\release\ + + + ..\..\..\exe\win\debug\ Disabled - ../../../../public/lib/api;../../../../public/lib/resource;%(AdditionalIncludeDirectories) + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=DEVELOP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) MultiThreadedDebug @@ -59,17 +93,37 @@ EditAndContinue - ../../../../public/lib/lib/win/debug/dynarr.lib;../../../../public/lib/lib/win/debug/t1read.lib;../../../../public/lib/lib/win/debug/t1cstr.lib;../../../../public/lib/lib/win/debug/cffread.lib;../../../../public/lib/lib/win/debug/t2cstr.lib;../../../../public/lib/lib/win/debug/ttread.lib;../../../../public/lib/lib/win/debug/pstoken.lib;../../../../public/lib/lib/win/debug/absfont.lib;../../../../public/lib/lib/win/debug/ctutil.lib;../../../../public/lib/lib/win/debug/cffwrite.lib;../../../../public/lib/lib/win/debug/cfembed.lib;../../../../public/lib/lib/win/debug/pdfwrite.lib;../../../../public/lib/lib/win/debug/sfntread.lib;../../../../public/lib/lib/win/debug/sfntwrite.lib;../../../../public/lib/lib/win/debug/svgwrite.lib;../../../../public/lib/lib/win/debug/svread.lib;../../../../public/lib/lib/win/debug/sha1.lib;../../../../public/lib/lib/win/debug/t1write.lib;../../../../public/lib/lib/win/debug/support.lib;../../../../public/lib/lib/win/debug/uforead.lib;../../../../public/lib/lib/win/debug/ufowrite.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).exe + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) true Console MachineX86 + + + Disabled + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=DEVELOP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) + true + Console + + MaxSpeed - ../../../../public/lib/api;../../../../public/lib/resource;%(AdditionalIncludeDirectories) + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) NDEBUG;CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=EXPORT;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) MultiThreaded @@ -78,12 +132,31 @@ ProgramDatabase - ../../../../public/lib/lib/win/release/dynarr.lib;../../../../public/lib/lib/win/release/t1read.lib;../../../../public/lib/lib/win/release/t1cstr.lib;../../../../public/lib/lib/win/release/cffread.lib;../../../../public/lib/lib/win/release/t2cstr.lib;../../../../public/lib/lib/win/release/ttread.lib;../../../../public/lib/lib/win/release/pstoken.lib;../../../../public/lib/lib/win/release/absfont.lib;../../../../public/lib/lib/win/release/ctutil.lib;../../../../public/lib/lib/win/release/cffwrite.lib;../../../../public/lib/lib/win/release/cfembed.lib;../../../../public/lib/lib/win/release/pdfwrite.lib;../../../../public/lib/lib/win/release/sfntread.lib;../../../../public/lib/lib/win/release/sfntwrite.lib;../../../../public/lib/lib/win/release/svgwrite.lib;../../../../public/lib/lib/win/release/svread.lib;../../../../public/lib/lib/win/release/sha1.lib;../../../../public/lib/lib/win/release/t1write.lib;../../../../public/lib/lib/win/release/support.lib;../../../../public/lib/lib/win/release/uforead.lib;../../../../public/lib/lib/win/release/ufowrite.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).exe + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) Console MachineX86 + + + MaxSpeed + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=EXPORT;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) + Console + + diff --git a/c/public/lib/build/absfont/win/visualstudio/absfont.vcxproj b/c/public/lib/build/absfont/win/visualstudio/absfont.vcxproj index a2bdc2a7c..97171dba1 100755 --- a/c/public/lib/build/absfont/win/visualstudio/absfont.vcxproj +++ b/c/public/lib/build/absfont/win/visualstudio/absfont.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {5C96B932-078E-4696-86F2-49C60402F36C} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;ABF_DEBUG=1;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/cfembed/win/visualstudio/cfembed.vcxproj b/c/public/lib/build/cfembed/win/visualstudio/cfembed.vcxproj index da9bad572..8aa7f00da 100755 --- a/c/public/lib/build/cfembed/win/visualstudio/cfembed.vcxproj +++ b/c/public/lib/build/cfembed/win/visualstudio/cfembed.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;CFE_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/cffread/win/visualstudio/cffread.vcxproj b/c/public/lib/build/cffread/win/visualstudio/cffread.vcxproj index db6c0a0dc..f266228f2 100755 --- a/c/public/lib/build/cffread/win/visualstudio/cffread.vcxproj +++ b/c/public/lib/build/cffread/win/visualstudio/cffread.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;CFR_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/cffwrite/win/visualstudio/cffwrite.vcxproj b/c/public/lib/build/cffwrite/win/visualstudio/cffwrite.vcxproj index 7b6edd234..e91c53428 100755 --- a/c/public/lib/build/cffwrite/win/visualstudio/cffwrite.vcxproj +++ b/c/public/lib/build/cffwrite/win/visualstudio/cffwrite.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;CFW_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/ctutil/win/visualstudio/ctutil.vcxproj b/c/public/lib/build/ctutil/win/visualstudio/ctutil.vcxproj index c1e0ed364..799d9568d 100755 --- a/c/public/lib/build/ctutil/win/visualstudio/ctutil.vcxproj +++ b/c/public/lib/build/ctutil/win/visualstudio/ctutil.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;CTU_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/dynarr/win/visualstudio/dynarr.vcxproj b/c/public/lib/build/dynarr/win/visualstudio/dynarr.vcxproj index d741c3b3e..14ec75dfb 100755 --- a/c/public/lib/build/dynarr/win/visualstudio/dynarr.vcxproj +++ b/c/public/lib/build/dynarr/win/visualstudio/dynarr.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {41075538-EB2C-43DD-90DF-21C6ED004AB7} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/nameread/win/visualstudio/nameread.vcxproj b/c/public/lib/build/nameread/win/visualstudio/nameread.vcxproj index 35b2c9165..590a6b9b7 100644 --- a/c/public/lib/build/nameread/win/visualstudio/nameread.vcxproj +++ b/c/public/lib/build/nameread/win/visualstudio/nameread.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + @@ -24,20 +32,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -46,7 +70,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -63,6 +89,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -78,6 +119,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/pdfwrite/win/visualstudio/pdfwrite.vcxproj b/c/public/lib/build/pdfwrite/win/visualstudio/pdfwrite.vcxproj index ab694f64e..49862d68a 100755 --- a/c/public/lib/build/pdfwrite/win/visualstudio/pdfwrite.vcxproj +++ b/c/public/lib/build/pdfwrite/win/visualstudio/pdfwrite.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {F3843D68-B828-4F63-A5C1-031C86A04038} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;PDW_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/pstoken/win/visualstudio/pstoken.vcxproj b/c/public/lib/build/pstoken/win/visualstudio/pstoken.vcxproj index dbb00055d..f6df686cd 100755 --- a/c/public/lib/build/pstoken/win/visualstudio/pstoken.vcxproj +++ b/c/public/lib/build/pstoken/win/visualstudio/pstoken.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;PST_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/sfntread/win/visualstudio/sfntread.vcxproj b/c/public/lib/build/sfntread/win/visualstudio/sfntread.vcxproj index 3ea02a77b..63d44102f 100755 --- a/c/public/lib/build/sfntread/win/visualstudio/sfntread.vcxproj +++ b/c/public/lib/build/sfntread/win/visualstudio/sfntread.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {C77A732B-8F81-4F8E-B85F-EE859FE40736} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/sfntwrite/win/visualstudio/sfntwrite.vcxproj b/c/public/lib/build/sfntwrite/win/visualstudio/sfntwrite.vcxproj index 520872cc4..08d25c1b5 100755 --- a/c/public/lib/build/sfntwrite/win/visualstudio/sfntwrite.vcxproj +++ b/c/public/lib/build/sfntwrite/win/visualstudio/sfntwrite.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {D488CA62-0CAF-4157-A15E-C63923781596} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;PST_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/sha1/win/visualstudio/sha1.vcxproj b/c/public/lib/build/sha1/win/visualstudio/sha1.vcxproj index 8b0a5c25f..4a6a3c8a1 100755 --- a/c/public/lib/build/sha1/win/visualstudio/sha1.vcxproj +++ b/c/public/lib/build/sha1/win/visualstudio/sha1.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53} @@ -20,20 +28,35 @@ StaticLibrary $(DefaultPlatformToolset) + + StaticLibrary + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -42,7 +65,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -59,6 +84,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -74,6 +114,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/support/win/visualstudio/support.vcxproj b/c/public/lib/build/support/win/visualstudio/support.vcxproj index fd800bab3..77f54dcad 100755 --- a/c/public/lib/build/support/win/visualstudio/support.vcxproj +++ b/c/public/lib/build/support/win/visualstudio/support.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {830EC20F-4C6D-4794-9B9F-281C5642E687} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + STAGE=DEVELOP;CTL_CDECL=__cdecl;CDECL=__cdecl;OS=os_windowsNT;ISP=isp_i80486;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;STAGE=RELEASE;CTL_CDECL=__cdecl;CDECL=__cdecl;OS=os_windowsNT;ISP=isp_i80486;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/svgwrite/win/visualstudio/svgwrite.vcxproj b/c/public/lib/build/svgwrite/win/visualstudio/svgwrite.vcxproj index dd2b17b0e..ab2416442 100755 --- a/c/public/lib/build/svgwrite/win/visualstudio/svgwrite.vcxproj +++ b/c/public/lib/build/svgwrite/win/visualstudio/svgwrite.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {21E79438-A176-40EC-B8D0-A506D6A8E295} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/svread/win/visualstudio/svread.vcxproj b/c/public/lib/build/svread/win/visualstudio/svread.vcxproj index 8db6469c2..7134f1d5c 100755 --- a/c/public/lib/build/svread/win/visualstudio/svread.vcxproj +++ b/c/public/lib/build/svread/win/visualstudio/svread.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/t1cstr/win/visualstudio/t1cstr.vcxproj b/c/public/lib/build/t1cstr/win/visualstudio/t1cstr.vcxproj index cee9c8b16..fa7fc0820 100755 --- a/c/public/lib/build/t1cstr/win/visualstudio/t1cstr.vcxproj +++ b/c/public/lib/build/t1cstr/win/visualstudio/t1cstr.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {0796DE6B-1E78-4275-936B-24BAACBF528C} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;T1C_DEBUG=1;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/t1read/win/visualstudio/t1read.vcxproj b/c/public/lib/build/t1read/win/visualstudio/t1read.vcxproj index 226e1e642..91271c8cf 100755 --- a/c/public/lib/build/t1read/win/visualstudio/t1read.vcxproj +++ b/c/public/lib/build/t1read/win/visualstudio/t1read.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;T1R_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/t1write/win/visualstudio/t1write.vcxproj b/c/public/lib/build/t1write/win/visualstudio/t1write.vcxproj index 54e8dc240..661d86809 100755 --- a/c/public/lib/build/t1write/win/visualstudio/t1write.vcxproj +++ b/c/public/lib/build/t1write/win/visualstudio/t1write.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {90065FFD-75BD-4085-B2E6-9E4146F69287} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;T1R_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/t2cstr/win/visualstudio/t2cstr.vcxproj b/c/public/lib/build/t2cstr/win/visualstudio/t2cstr.vcxproj index ad83460c0..eb471473b 100755 --- a/c/public/lib/build/t2cstr/win/visualstudio/t2cstr.vcxproj +++ b/c/public/lib/build/t2cstr/win/visualstudio/t2cstr.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;T2C_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/ttread/win/visualstudio/ttread.vcxproj b/c/public/lib/build/ttread/win/visualstudio/ttread.vcxproj index 5a1044f76..84003dde7 100755 --- a/c/public/lib/build/ttread/win/visualstudio/ttread.vcxproj +++ b/c/public/lib/build/ttread/win/visualstudio/ttread.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;TTR_DEBUG=1;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/uforead/win/visualstudio/uforead.vcxproj b/c/public/lib/build/uforead/win/visualstudio/uforead.vcxproj index 33c76e48f..dcc925ea7 100755 --- a/c/public/lib/build/uforead/win/visualstudio/uforead.vcxproj +++ b/c/public/lib/build/uforead/win/visualstudio/uforead.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,13 +67,21 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) AllRules.ruleset + AllRules.ruleset + + AllRules.ruleset + AllRules.ruleset + + @@ -66,6 +98,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -81,6 +128,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/ufowrite/win/visualstudio/ufowrite.vcxproj b/c/public/lib/build/ufowrite/win/visualstudio/ufowrite.vcxproj index c62cce808..d30f7a742 100755 --- a/c/public/lib/build/ufowrite/win/visualstudio/ufowrite.vcxproj +++ b/c/public/lib/build/ufowrite/win/visualstudio/ufowrite.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11} @@ -21,20 +29,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -43,7 +67,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -60,6 +86,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -75,6 +116,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/public/lib/build/varread/win/visualstudio/varread.vcxproj b/c/public/lib/build/varread/win/visualstudio/varread.vcxproj index 22012ab4c..4196da386 100644 --- a/c/public/lib/build/varread/win/visualstudio/varread.vcxproj +++ b/c/public/lib/build/varread/win/visualstudio/varread.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + @@ -24,20 +32,36 @@ MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + StaticLibrary MultiByte $(DefaultPlatformToolset) + + StaticLibrary + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 @@ -46,7 +70,9 @@ ../../../../lib/win/release/ $(Configuration)\ $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) @@ -63,6 +89,21 @@ %(ExportNamedFunctions) + + + Disabled + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + MaxSpeed @@ -78,6 +119,21 @@ %(ExportNamedFunctions) + + + MaxSpeed + ../../../../api;../../../../resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(ExportNamedFunctions) + + diff --git a/c/rotatefont/build/win/visualstudio/rotateFont.sln b/c/rotatefont/build/win/visualstudio/rotateFont.sln index cd2fe6ac6..9f03d0886 100644 --- a/c/rotatefont/build/win/visualstudio/rotateFont.sln +++ b/c/rotatefont/build/win/visualstudio/rotateFont.sln @@ -56,202 +56,202 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "varread", "..\..\..\..\publ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_bc|x86 = Debug_bc|x86 + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 - Release_bc|x86 = Release_bc|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {66C1C775-5375-41AC-BEC0-93173237700D}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {66C1C775-5375-41AC-BEC0-93173237700D}.Debug_bc|x86.Build.0 = Debug|Win32 + {66C1C775-5375-41AC-BEC0-93173237700D}.Debug|x64.ActiveCfg = Debug|x64 + {66C1C775-5375-41AC-BEC0-93173237700D}.Debug|x64.Build.0 = Debug|x64 {66C1C775-5375-41AC-BEC0-93173237700D}.Debug|x86.ActiveCfg = Debug|Win32 {66C1C775-5375-41AC-BEC0-93173237700D}.Debug|x86.Build.0 = Debug|Win32 - {66C1C775-5375-41AC-BEC0-93173237700D}.Release_bc|x86.ActiveCfg = Release|Win32 - {66C1C775-5375-41AC-BEC0-93173237700D}.Release_bc|x86.Build.0 = Release|Win32 + {66C1C775-5375-41AC-BEC0-93173237700D}.Release|x64.ActiveCfg = Release|x64 + {66C1C775-5375-41AC-BEC0-93173237700D}.Release|x64.Build.0 = Release|x64 {66C1C775-5375-41AC-BEC0-93173237700D}.Release|x86.ActiveCfg = Release|Win32 {66C1C775-5375-41AC-BEC0-93173237700D}.Release|x86.Build.0 = Release|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Debug_bc|x86.Build.0 = Debug|Win32 + {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x64.ActiveCfg = Debug|x64 + {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x64.Build.0 = Debug|x64 {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x86.ActiveCfg = Debug|Win32 {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x86.Build.0 = Debug|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Release_bc|x86.ActiveCfg = Release|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Release_bc|x86.Build.0 = Release|Win32 + {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x64.ActiveCfg = Release|x64 + {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x64.Build.0 = Release|x64 {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x86.ActiveCfg = Release|Win32 {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x86.Build.0 = Release|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug_bc|x86.Build.0 = Debug|Win32 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x64.ActiveCfg = Debug|x64 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x64.Build.0 = Debug|x64 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x86.ActiveCfg = Debug|Win32 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x86.Build.0 = Debug|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release_bc|x86.ActiveCfg = Release|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release_bc|x86.Build.0 = Release|Win32 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x64.ActiveCfg = Release|x64 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x64.Build.0 = Release|x64 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x86.ActiveCfg = Release|Win32 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x86.Build.0 = Release|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug_bc|x86.Build.0 = Debug|Win32 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x64.ActiveCfg = Debug|x64 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x64.Build.0 = Debug|x64 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x86.ActiveCfg = Debug|Win32 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x86.Build.0 = Debug|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release_bc|x86.ActiveCfg = Release|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release_bc|x86.Build.0 = Release|Win32 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x64.ActiveCfg = Release|x64 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x64.Build.0 = Release|x64 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x86.ActiveCfg = Release|Win32 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x86.Build.0 = Release|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug_bc|x86.Build.0 = Debug|Win32 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x64.ActiveCfg = Debug|x64 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x64.Build.0 = Debug|x64 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x86.ActiveCfg = Debug|Win32 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x86.Build.0 = Debug|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release_bc|x86.ActiveCfg = Release|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release_bc|x86.Build.0 = Release|Win32 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x64.ActiveCfg = Release|x64 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x64.Build.0 = Release|x64 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x86.ActiveCfg = Release|Win32 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x86.Build.0 = Release|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug_bc|x86.Build.0 = Debug|Win32 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.ActiveCfg = Debug|x64 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.Build.0 = Debug|x64 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.ActiveCfg = Debug|Win32 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.Build.0 = Debug|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release_bc|x86.ActiveCfg = Release|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release_bc|x86.Build.0 = Release|Win32 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.ActiveCfg = Release|x64 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.Build.0 = Release|x64 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.ActiveCfg = Release|Win32 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.Build.0 = Release|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug_bc|x86.Build.0 = Debug|Win32 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.ActiveCfg = Debug|x64 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.Build.0 = Debug|x64 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.ActiveCfg = Debug|Win32 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.Build.0 = Debug|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release_bc|x86.ActiveCfg = Release|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release_bc|x86.Build.0 = Release|Win32 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.ActiveCfg = Release|x64 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.Build.0 = Release|x64 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.ActiveCfg = Release|Win32 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.Build.0 = Release|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug_bc|x86.Build.0 = Debug|Win32 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x64.ActiveCfg = Debug|x64 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x64.Build.0 = Debug|x64 {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x86.ActiveCfg = Debug|Win32 {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x86.Build.0 = Debug|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Release_bc|x86.ActiveCfg = Release|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Release_bc|x86.Build.0 = Release|Win32 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x64.ActiveCfg = Release|x64 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x64.Build.0 = Release|x64 {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x86.ActiveCfg = Release|Win32 {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x86.Build.0 = Release|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug_bc|x86.Build.0 = Debug|Win32 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x64.ActiveCfg = Debug|x64 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x64.Build.0 = Debug|x64 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x86.ActiveCfg = Debug|Win32 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x86.Build.0 = Debug|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release_bc|x86.ActiveCfg = Release|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release_bc|x86.Build.0 = Release|Win32 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x64.ActiveCfg = Release|x64 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x64.Build.0 = Release|x64 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x86.ActiveCfg = Release|Win32 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x86.Build.0 = Release|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug_bc|x86.Build.0 = Debug|Win32 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x64.ActiveCfg = Debug|x64 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x64.Build.0 = Debug|x64 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x86.ActiveCfg = Debug|Win32 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x86.Build.0 = Debug|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release_bc|x86.ActiveCfg = Release|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release_bc|x86.Build.0 = Release|Win32 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x64.ActiveCfg = Release|x64 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x64.Build.0 = Release|x64 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x86.ActiveCfg = Release|Win32 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x86.Build.0 = Release|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Debug_bc|x86.Build.0 = Debug|Win32 + {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x64.ActiveCfg = Debug|x64 + {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x64.Build.0 = Debug|x64 {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x86.ActiveCfg = Debug|Win32 {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x86.Build.0 = Debug|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Release_bc|x86.ActiveCfg = Release|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Release_bc|x86.Build.0 = Release|Win32 + {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x64.ActiveCfg = Release|x64 + {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x64.Build.0 = Release|x64 {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x86.ActiveCfg = Release|Win32 {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x86.Build.0 = Release|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug_bc|x86.Build.0 = Debug|Win32 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x64.ActiveCfg = Debug|x64 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x64.Build.0 = Debug|x64 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x86.ActiveCfg = Debug|Win32 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x86.Build.0 = Debug|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release_bc|x86.ActiveCfg = Release|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release_bc|x86.Build.0 = Release|Win32 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x64.ActiveCfg = Release|x64 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x64.Build.0 = Release|x64 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x86.ActiveCfg = Release|Win32 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x86.Build.0 = Release|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug_bc|x86.Build.0 = Debug|Win32 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x64.ActiveCfg = Debug|x64 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x64.Build.0 = Debug|x64 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x86.ActiveCfg = Debug|Win32 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x86.Build.0 = Debug|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release_bc|x86.ActiveCfg = Release|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release_bc|x86.Build.0 = Release|Win32 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x64.ActiveCfg = Release|x64 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x64.Build.0 = Release|x64 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x86.ActiveCfg = Release|Win32 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x86.Build.0 = Release|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug_bc|x86.Build.0 = Debug|Win32 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x64.ActiveCfg = Debug|x64 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x64.Build.0 = Debug|x64 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x86.ActiveCfg = Debug|Win32 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x86.Build.0 = Debug|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release_bc|x86.ActiveCfg = Release|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release_bc|x86.Build.0 = Release|Win32 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x64.ActiveCfg = Release|x64 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x64.Build.0 = Release|x64 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x86.ActiveCfg = Release|Win32 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x86.Build.0 = Release|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug_bc|x86.Build.0 = Debug|Win32 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x64.ActiveCfg = Debug|x64 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x64.Build.0 = Debug|x64 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x86.ActiveCfg = Debug|Win32 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x86.Build.0 = Debug|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release_bc|x86.ActiveCfg = Release|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release_bc|x86.Build.0 = Release|Win32 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x64.ActiveCfg = Release|x64 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x64.Build.0 = Release|x64 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x86.ActiveCfg = Release|Win32 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x86.Build.0 = Release|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug_bc|x86.Build.0 = Debug|Win32 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x64.ActiveCfg = Debug|x64 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x64.Build.0 = Debug|x64 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x86.ActiveCfg = Debug|Win32 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x86.Build.0 = Debug|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release_bc|x86.ActiveCfg = Release|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release_bc|x86.Build.0 = Release|Win32 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x64.ActiveCfg = Release|x64 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x64.Build.0 = Release|x64 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x86.ActiveCfg = Release|Win32 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x86.Build.0 = Release|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug_bc|x86.Build.0 = Debug|Win32 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x64.ActiveCfg = Debug|x64 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x64.Build.0 = Debug|x64 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x86.ActiveCfg = Debug|Win32 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x86.Build.0 = Debug|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release_bc|x86.ActiveCfg = Release|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release_bc|x86.Build.0 = Release|Win32 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x64.ActiveCfg = Release|x64 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x64.Build.0 = Release|x64 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x86.ActiveCfg = Release|Win32 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x86.Build.0 = Release|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug_bc|x86.Build.0 = Debug|Win32 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x64.ActiveCfg = Debug|x64 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x64.Build.0 = Debug|x64 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x86.ActiveCfg = Debug|Win32 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x86.Build.0 = Debug|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release_bc|x86.ActiveCfg = Release|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release_bc|x86.Build.0 = Release|Win32 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x64.ActiveCfg = Release|x64 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x64.Build.0 = Release|x64 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x86.ActiveCfg = Release|Win32 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x86.Build.0 = Release|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug_bc|x86.Build.0 = Debug|Win32 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x64.ActiveCfg = Debug|x64 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x64.Build.0 = Debug|x64 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x86.ActiveCfg = Debug|Win32 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x86.Build.0 = Debug|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release_bc|x86.ActiveCfg = Release|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release_bc|x86.Build.0 = Release|Win32 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x64.ActiveCfg = Release|x64 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x64.Build.0 = Release|x64 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x86.ActiveCfg = Release|Win32 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x86.Build.0 = Release|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug_bc|x86.Build.0 = Debug|Win32 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x64.ActiveCfg = Debug|x64 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x64.Build.0 = Debug|x64 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x86.ActiveCfg = Debug|Win32 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x86.Build.0 = Debug|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release_bc|x86.ActiveCfg = Release|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release_bc|x86.Build.0 = Release|Win32 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x64.ActiveCfg = Release|x64 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x64.Build.0 = Release|x64 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x86.ActiveCfg = Release|Win32 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x86.Build.0 = Release|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug_bc|x86.Build.0 = Debug|Win32 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x64.ActiveCfg = Debug|x64 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x64.Build.0 = Debug|x64 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x86.ActiveCfg = Debug|Win32 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x86.Build.0 = Debug|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release_bc|x86.ActiveCfg = Release|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release_bc|x86.Build.0 = Release|Win32 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x64.ActiveCfg = Release|x64 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x64.Build.0 = Release|x64 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x86.ActiveCfg = Release|Win32 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x86.Build.0 = Release|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug_bc|x86.Build.0 = Debug|Win32 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x64.ActiveCfg = Debug|x64 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x64.Build.0 = Debug|x64 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x86.ActiveCfg = Debug|Win32 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x86.Build.0 = Debug|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release_bc|x86.ActiveCfg = Release|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release_bc|x86.Build.0 = Release|Win32 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x64.ActiveCfg = Release|x64 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x64.Build.0 = Release|x64 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x86.ActiveCfg = Release|Win32 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x86.Build.0 = Release|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug_bc|x86.Build.0 = Debug|Win32 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x64.ActiveCfg = Debug|x64 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x64.Build.0 = Debug|x64 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x86.ActiveCfg = Debug|Win32 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x86.Build.0 = Debug|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release_bc|x86.ActiveCfg = Release|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release_bc|x86.Build.0 = Release|Win32 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x64.ActiveCfg = Release|x64 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x64.Build.0 = Release|x64 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x86.ActiveCfg = Release|Win32 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x86.Build.0 = Release|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug_bc|x86.Build.0 = Debug|Win32 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x64.ActiveCfg = Debug|x64 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x64.Build.0 = Debug|x64 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x86.ActiveCfg = Debug|Win32 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x86.Build.0 = Debug|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release_bc|x86.ActiveCfg = Release|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release_bc|x86.Build.0 = Release|Win32 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x64.ActiveCfg = Release|x64 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x64.Build.0 = Release|x64 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x86.ActiveCfg = Release|Win32 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/c/rotatefont/build/win/visualstudio/rotateFont.vcxproj b/c/rotatefont/build/win/visualstudio/rotateFont.vcxproj index 96b85cc2c..d8ea2aa64 100755 --- a/c/rotatefont/build/win/visualstudio/rotateFont.vcxproj +++ b/c/rotatefont/build/win/visualstudio/rotateFont.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {66C1C775-5375-41AC-BEC0-93173237700D} @@ -21,36 +29,62 @@ MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + Application MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\..\..\exe\win\debug\ $(Configuration)\ true + true ..\..\..\exe\win\release\ $(Configuration)\ false + false $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) + + + ..\..\..\exe\win\release\ + + + ..\..\..\exe\win\debug\ Disabled - ../../../../public/lib/api;../../../../public/lib/resource;%(AdditionalIncludeDirectories) + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=DEVELOP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) MultiThreadedDebug @@ -59,17 +93,37 @@ EditAndContinue - ../../../../public/lib/lib/win/debug/dynarr.lib;../../../../public/lib/lib/win/debug/t1read.lib;../../../../public/lib/lib/win/debug/t1cstr.lib;../../../../public/lib/lib/win/debug/cffread.lib;../../../../public/lib/lib/win/debug/t2cstr.lib;../../../../public/lib/lib/win/debug/ttread.lib;../../../../public/lib/lib/win/debug/pstoken.lib;../../../../public/lib/lib/win/debug/absfont.lib;../../../../public/lib/lib/win/debug/ctutil.lib;../../../../public/lib/lib/win/debug/cffwrite.lib;../../../../public/lib/lib/win/debug/cfembed.lib;../../../../public/lib/lib/win/debug/pdfwrite.lib;../../../../public/lib/lib/win/debug/sfntread.lib;../../../../public/lib/lib/win/debug/sfntwrite.lib;../../../../public/lib/lib/win/debug/svgwrite.lib;../../../../public/lib/lib/win/debug/svread.lib;../../../../public/lib/lib/win/debug/sha1.lib;../../../../public/lib/lib/win/debug/t1write.lib;../../../../public/lib/lib/win/debug/support.lib;../../../../public/lib/lib/win/debug/uforead.lib;../../../../public/lib/lib/win/debug/ufowrite.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).exe + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) true Console MachineX86 + + + Disabled + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=DEVELOP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) + true + Console + + MaxSpeed - ../../../../public/lib/api;../../../../public/lib/resource;%(AdditionalIncludeDirectories) + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) NDEBUG;CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=EXPORT;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) MultiThreaded @@ -78,12 +132,31 @@ ProgramDatabase - ../../../../public/lib/lib/win/release/dynarr.lib;../../../../public/lib/lib/win/release/t1read.lib;../../../../public/lib/lib/win/release/t1cstr.lib;../../../../public/lib/lib/win/release/cffread.lib;../../../../public/lib/lib/win/release/t2cstr.lib;../../../../public/lib/lib/win/release/ttread.lib;../../../../public/lib/lib/win/release/pstoken.lib;../../../../public/lib/lib/win/release/absfont.lib;../../../../public/lib/lib/win/release/ctutil.lib;../../../../public/lib/lib/win/release/cffwrite.lib;../../../../public/lib/lib/win/release/cfembed.lib;../../../../public/lib/lib/win/release/pdfwrite.lib;../../../../public/lib/lib/win/release/sfntread.lib;../../../../public/lib/lib/win/release/sfntwrite.lib;../../../../public/lib/lib/win/release/svgwrite.lib;../../../../public/lib/lib/win/release/svread.lib;../../../../public/lib/lib/win/release/sha1.lib;../../../../public/lib/lib/win/release/t1write.lib;../../../../public/lib/lib/win/release/support.lib;../../../../public/lib/lib/win/release/uforead.lib;../../../../public/lib/lib/win/release/ufowrite.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).exe + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) Console MachineX86 + + + MaxSpeed + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=EXPORT;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) + Console + + diff --git a/c/sfntdiff/build/win/visualstudio/sfntdiff.sln b/c/sfntdiff/build/win/visualstudio/sfntdiff.sln index e249c99c1..38cfc0db3 100644 --- a/c/sfntdiff/build/win/visualstudio/sfntdiff.sln +++ b/c/sfntdiff/build/win/visualstudio/sfntdiff.sln @@ -6,12 +6,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfntdiff", "sfntdiff.vcxpro EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28687ACA-7D08-4E78-AD57-F27869C7E102}.Debug|x64.ActiveCfg = Debug|x64 + {28687ACA-7D08-4E78-AD57-F27869C7E102}.Debug|x64.Build.0 = Debug|x64 {28687ACA-7D08-4E78-AD57-F27869C7E102}.Debug|x86.ActiveCfg = Debug|Win32 {28687ACA-7D08-4E78-AD57-F27869C7E102}.Debug|x86.Build.0 = Debug|Win32 + {28687ACA-7D08-4E78-AD57-F27869C7E102}.Release|x64.ActiveCfg = Release|x64 + {28687ACA-7D08-4E78-AD57-F27869C7E102}.Release|x64.Build.0 = Release|x64 {28687ACA-7D08-4E78-AD57-F27869C7E102}.Release|x86.ActiveCfg = Release|Win32 {28687ACA-7D08-4E78-AD57-F27869C7E102}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/c/sfntdiff/build/win/visualstudio/sfntdiff.vcxproj b/c/sfntdiff/build/win/visualstudio/sfntdiff.vcxproj index 4061e03cb..05ec3e8a7 100755 --- a/c/sfntdiff/build/win/visualstudio/sfntdiff.vcxproj +++ b/c/sfntdiff/build/win/visualstudio/sfntdiff.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {28687ACA-7D08-4E78-AD57-F27869C7E102} @@ -21,31 +29,57 @@ MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + Application MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\..\..\exe\win\debug\ $(Configuration)\ true + true ..\..\..\exe\win\release\ $(Configuration)\ false + false $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) + + + ..\..\..\exe\win\release\ + + + ..\..\..\exe\win\debug\ @@ -59,12 +93,31 @@ EditAndContinue - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) true Console MachineX86 + + + Disabled + ..\..\..\..\spot\sfnt_includes;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) + _CONSOLE;WIN32;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + true + Console + + MaxSpeed @@ -77,11 +130,29 @@ ProgramDatabase - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) Console MachineX86 + + + MaxSpeed + ..\..\..\..\spot\sfnt_includes;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) + WIN32;_CONSOLE;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + Console + + diff --git a/c/sfntedit/build/win/visualstudio/sfntedit.sln b/c/sfntedit/build/win/visualstudio/sfntedit.sln index 360902ee2..e3e80292c 100644 --- a/c/sfntedit/build/win/visualstudio/sfntedit.sln +++ b/c/sfntedit/build/win/visualstudio/sfntedit.sln @@ -6,12 +6,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfntedit", "sfntedit.vcxpro EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {404F9020-BDA3-4943-B674-E1207D8ADFD7}.Debug|x64.ActiveCfg = Debug|x64 + {404F9020-BDA3-4943-B674-E1207D8ADFD7}.Debug|x64.Build.0 = Debug|x64 {404F9020-BDA3-4943-B674-E1207D8ADFD7}.Debug|x86.ActiveCfg = Debug|Win32 {404F9020-BDA3-4943-B674-E1207D8ADFD7}.Debug|x86.Build.0 = Debug|Win32 + {404F9020-BDA3-4943-B674-E1207D8ADFD7}.Release|x64.ActiveCfg = Release|x64 + {404F9020-BDA3-4943-B674-E1207D8ADFD7}.Release|x64.Build.0 = Release|x64 {404F9020-BDA3-4943-B674-E1207D8ADFD7}.Release|x86.ActiveCfg = Release|Win32 {404F9020-BDA3-4943-B674-E1207D8ADFD7}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/c/sfntedit/build/win/visualstudio/sfntedit.vcxproj b/c/sfntedit/build/win/visualstudio/sfntedit.vcxproj index 137b5d765..bb85dc642 100755 --- a/c/sfntedit/build/win/visualstudio/sfntedit.vcxproj +++ b/c/sfntedit/build/win/visualstudio/sfntedit.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {404F9020-BDA3-4943-B674-E1207D8ADFD7} @@ -21,37 +29,63 @@ MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + Application MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\..\..\exe\win\debug\ $(Configuration)\ true + true ..\..\..\exe\win\release\ $(Configuration)\ false + false $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) + + + ..\..\..\exe\win\release\ + + + ..\..\..\exe\win\debug\ Disabled ..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) - FDK_DEBUG=1;_CONSOLE;WIN32;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + _CONSOLE;WIN32;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) MultiThreadedDebug @@ -59,12 +93,31 @@ EditAndContinue - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) true Console MachineX86 + + + Disabled + ..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) + _CONSOLE;WIN32;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + true + Console + + MaxSpeed @@ -77,11 +130,29 @@ ProgramDatabase - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) Console MachineX86 + + + MaxSpeed + ..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) + WIN32;_CONSOLE;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + Console + + diff --git a/c/spot/build/win/visualstudio/spot.sln b/c/spot/build/win/visualstudio/spot.sln index 2fe43c78e..27e92d345 100755 --- a/c/spot/build/win/visualstudio/spot.sln +++ b/c/spot/build/win/visualstudio/spot.sln @@ -6,12 +6,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spot", "spot.vcxproj", "{A3 EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A37482DC-DFD6-4FB5-87A4-D785F7C2D8CA}.Debug|x64.ActiveCfg = Debug|x64 + {A37482DC-DFD6-4FB5-87A4-D785F7C2D8CA}.Debug|x64.Build.0 = Debug|x64 {A37482DC-DFD6-4FB5-87A4-D785F7C2D8CA}.Debug|x86.ActiveCfg = Debug|Win32 {A37482DC-DFD6-4FB5-87A4-D785F7C2D8CA}.Debug|x86.Build.0 = Debug|Win32 + {A37482DC-DFD6-4FB5-87A4-D785F7C2D8CA}.Release|x64.ActiveCfg = Release|x64 + {A37482DC-DFD6-4FB5-87A4-D785F7C2D8CA}.Release|x64.Build.0 = Release|x64 {A37482DC-DFD6-4FB5-87A4-D785F7C2D8CA}.Release|x86.ActiveCfg = Release|Win32 {A37482DC-DFD6-4FB5-87A4-D785F7C2D8CA}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/c/spot/build/win/visualstudio/spot.vcxproj b/c/spot/build/win/visualstudio/spot.vcxproj index a52099791..9def9d9b8 100755 --- a/c/spot/build/win/visualstudio/spot.vcxproj +++ b/c/spot/build/win/visualstudio/spot.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {A37482DC-DFD6-4FB5-87A4-D785F7C2D8CA} @@ -21,31 +29,57 @@ MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + Application MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\..\..\exe\win\debug\ $(Configuration)\ true + true ..\..\..\exe\win\release\ $(Configuration)\ false + false $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) + + + ..\..\..\exe\win\release\ + + + ..\..\..\exe\win\debug\ @@ -59,12 +93,31 @@ EditAndContinue - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) true Console MachineX86 + + + Disabled + ..\..\..\source;..\..\..\sfnt_includes;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) + DEBUG=1;_WINDOWs;_CONSOLE;AUTOSCRIPT=1;__STDC__;WIN32;EXECUTABLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + true + Console + + MaxSpeed @@ -77,11 +130,29 @@ ProgramDatabase - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) Console MachineX86 + + + MaxSpeed + ..\..\..\source;..\..\..\sfnt_includes;..\..\..\..\public\lib\api;%(AdditionalIncludeDirectories) + _WINDOWS;_CONSOLE;AUTOSCRIPT=1;;__STDC__;WIN32;EXECUTABLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + Console + + diff --git a/c/tx/build/win/visualstudio/tx.sln b/c/tx/build/win/visualstudio/tx.sln index 57e5fca96..9584f236d 100644 --- a/c/tx/build/win/visualstudio/tx.sln +++ b/c/tx/build/win/visualstudio/tx.sln @@ -52,202 +52,202 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nameread", "..\..\..\..\pub EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug_bc|x86 = Debug_bc|x86 + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 - Release_bc|x86 = Release_bc|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Debug_bc|x86.Build.0 = Debug|Win32 + {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Debug|x64.ActiveCfg = Debug|x64 + {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Debug|x64.Build.0 = Debug|x64 {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Debug|x86.ActiveCfg = Debug|Win32 {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Debug|x86.Build.0 = Debug|Win32 - {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Release_bc|x86.ActiveCfg = Release|Win32 - {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Release_bc|x86.Build.0 = Release|Win32 + {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Release|x64.ActiveCfg = Release|x64 + {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Release|x64.Build.0 = Release|x64 {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Release|x86.ActiveCfg = Release|Win32 {724EF7F1-8890-4571-8A39-FFF69187DA5A}.Release|x86.Build.0 = Release|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Debug_bc|x86.Build.0 = Debug|Win32 + {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x64.ActiveCfg = Debug|x64 + {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x64.Build.0 = Debug|x64 {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x86.ActiveCfg = Debug|Win32 {5C96B932-078E-4696-86F2-49C60402F36C}.Debug|x86.Build.0 = Debug|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Release_bc|x86.ActiveCfg = Release|Win32 - {5C96B932-078E-4696-86F2-49C60402F36C}.Release_bc|x86.Build.0 = Release|Win32 + {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x64.ActiveCfg = Release|x64 + {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x64.Build.0 = Release|x64 {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x86.ActiveCfg = Release|Win32 {5C96B932-078E-4696-86F2-49C60402F36C}.Release|x86.Build.0 = Release|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug_bc|x86.Build.0 = Debug|Win32 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x64.ActiveCfg = Debug|x64 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x64.Build.0 = Debug|x64 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x86.ActiveCfg = Debug|Win32 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Debug|x86.Build.0 = Debug|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release_bc|x86.ActiveCfg = Release|Win32 - {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release_bc|x86.Build.0 = Release|Win32 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x64.ActiveCfg = Release|x64 + {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x64.Build.0 = Release|x64 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x86.ActiveCfg = Release|Win32 {BC26009F-9C35-4B6F-92D9-0FBC4AD69FF4}.Release|x86.Build.0 = Release|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug_bc|x86.Build.0 = Debug|Win32 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x64.ActiveCfg = Debug|x64 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x64.Build.0 = Debug|x64 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x86.ActiveCfg = Debug|Win32 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Debug|x86.Build.0 = Debug|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release_bc|x86.ActiveCfg = Release|Win32 - {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release_bc|x86.Build.0 = Release|Win32 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x64.ActiveCfg = Release|x64 + {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x64.Build.0 = Release|x64 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x86.ActiveCfg = Release|Win32 {AC6F25D9-E7D2-4829-AC3D-455B1D12DCB4}.Release|x86.Build.0 = Release|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug_bc|x86.Build.0 = Debug|Win32 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x64.ActiveCfg = Debug|x64 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x64.Build.0 = Debug|x64 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x86.ActiveCfg = Debug|Win32 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Debug|x86.Build.0 = Debug|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release_bc|x86.ActiveCfg = Release|Win32 - {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release_bc|x86.Build.0 = Release|Win32 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x64.ActiveCfg = Release|x64 + {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x64.Build.0 = Release|x64 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x86.ActiveCfg = Release|Win32 {C3DB8942-A9C8-455B-B816-EDC2C0B4408A}.Release|x86.Build.0 = Release|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug_bc|x86.Build.0 = Debug|Win32 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.ActiveCfg = Debug|x64 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x64.Build.0 = Debug|x64 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.ActiveCfg = Debug|Win32 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Debug|x86.Build.0 = Debug|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release_bc|x86.ActiveCfg = Release|Win32 - {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release_bc|x86.Build.0 = Release|Win32 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.ActiveCfg = Release|x64 + {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x64.Build.0 = Release|x64 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.ActiveCfg = Release|Win32 {6F3528C4-AD05-4CB9-BC94-F09BF41B415A}.Release|x86.Build.0 = Release|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug_bc|x86.Build.0 = Debug|Win32 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.ActiveCfg = Debug|x64 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x64.Build.0 = Debug|x64 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.ActiveCfg = Debug|Win32 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Debug|x86.Build.0 = Debug|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release_bc|x86.ActiveCfg = Release|Win32 - {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release_bc|x86.Build.0 = Release|Win32 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.ActiveCfg = Release|x64 + {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x64.Build.0 = Release|x64 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.ActiveCfg = Release|Win32 {41075538-EB2C-43DD-90DF-21C6ED004AB7}.Release|x86.Build.0 = Release|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug_bc|x86.Build.0 = Debug|Win32 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x64.ActiveCfg = Debug|x64 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x64.Build.0 = Debug|x64 {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x86.ActiveCfg = Debug|Win32 {F3843D68-B828-4F63-A5C1-031C86A04038}.Debug|x86.Build.0 = Debug|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Release_bc|x86.ActiveCfg = Release|Win32 - {F3843D68-B828-4F63-A5C1-031C86A04038}.Release_bc|x86.Build.0 = Release|Win32 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x64.ActiveCfg = Release|x64 + {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x64.Build.0 = Release|x64 {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x86.ActiveCfg = Release|Win32 {F3843D68-B828-4F63-A5C1-031C86A04038}.Release|x86.Build.0 = Release|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug_bc|x86.Build.0 = Debug|Win32 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x64.ActiveCfg = Debug|x64 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x64.Build.0 = Debug|x64 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x86.ActiveCfg = Debug|Win32 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Debug|x86.Build.0 = Debug|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release_bc|x86.ActiveCfg = Release|Win32 - {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release_bc|x86.Build.0 = Release|Win32 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x64.ActiveCfg = Release|x64 + {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x64.Build.0 = Release|x64 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x86.ActiveCfg = Release|Win32 {52333A05-95FF-4BEF-AC4A-2C82BB9E282F}.Release|x86.Build.0 = Release|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug_bc|x86.Build.0 = Debug|Win32 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x64.ActiveCfg = Debug|x64 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x64.Build.0 = Debug|x64 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x86.ActiveCfg = Debug|Win32 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Debug|x86.Build.0 = Debug|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release_bc|x86.ActiveCfg = Release|Win32 - {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release_bc|x86.Build.0 = Release|Win32 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x64.ActiveCfg = Release|x64 + {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x64.Build.0 = Release|x64 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x86.ActiveCfg = Release|Win32 {C77A732B-8F81-4F8E-B85F-EE859FE40736}.Release|x86.Build.0 = Release|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Debug_bc|x86.Build.0 = Debug|Win32 + {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x64.ActiveCfg = Debug|x64 + {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x64.Build.0 = Debug|x64 {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x86.ActiveCfg = Debug|Win32 {D488CA62-0CAF-4157-A15E-C63923781596}.Debug|x86.Build.0 = Debug|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Release_bc|x86.ActiveCfg = Release|Win32 - {D488CA62-0CAF-4157-A15E-C63923781596}.Release_bc|x86.Build.0 = Release|Win32 + {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x64.ActiveCfg = Release|x64 + {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x64.Build.0 = Release|x64 {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x86.ActiveCfg = Release|Win32 {D488CA62-0CAF-4157-A15E-C63923781596}.Release|x86.Build.0 = Release|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug_bc|x86.Build.0 = Debug|Win32 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x64.ActiveCfg = Debug|x64 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x64.Build.0 = Debug|x64 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x86.ActiveCfg = Debug|Win32 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Debug|x86.Build.0 = Debug|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release_bc|x86.ActiveCfg = Release|Win32 - {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release_bc|x86.Build.0 = Release|Win32 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x64.ActiveCfg = Release|x64 + {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x64.Build.0 = Release|x64 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x86.ActiveCfg = Release|Win32 {AC1F08BF-24E6-47D6-9F5E-46178E5C2A53}.Release|x86.Build.0 = Release|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug_bc|x86.Build.0 = Debug|Win32 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x64.ActiveCfg = Debug|x64 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x64.Build.0 = Debug|x64 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x86.ActiveCfg = Debug|Win32 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Debug|x86.Build.0 = Debug|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release_bc|x86.ActiveCfg = Release|Win32 - {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release_bc|x86.Build.0 = Release|Win32 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x64.ActiveCfg = Release|x64 + {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x64.Build.0 = Release|x64 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x86.ActiveCfg = Release|Win32 {830EC20F-4C6D-4794-9B9F-281C5642E687}.Release|x86.Build.0 = Release|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug_bc|x86.Build.0 = Debug|Win32 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x64.ActiveCfg = Debug|x64 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x64.Build.0 = Debug|x64 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x86.ActiveCfg = Debug|Win32 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Debug|x86.Build.0 = Debug|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release_bc|x86.ActiveCfg = Release|Win32 - {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release_bc|x86.Build.0 = Release|Win32 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x64.ActiveCfg = Release|x64 + {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x64.Build.0 = Release|x64 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x86.ActiveCfg = Release|Win32 {21E79438-A176-40EC-B8D0-A506D6A8E295}.Release|x86.Build.0 = Release|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug_bc|x86.Build.0 = Debug|Win32 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x64.ActiveCfg = Debug|x64 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x64.Build.0 = Debug|x64 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x86.ActiveCfg = Debug|Win32 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Debug|x86.Build.0 = Debug|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release_bc|x86.ActiveCfg = Release|Win32 - {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release_bc|x86.Build.0 = Release|Win32 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x64.ActiveCfg = Release|x64 + {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x64.Build.0 = Release|x64 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x86.ActiveCfg = Release|Win32 {FCCC49B4-8490-43CB-832C-6BB0B94B4DFA}.Release|x86.Build.0 = Release|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug_bc|x86.Build.0 = Debug|Win32 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x64.ActiveCfg = Debug|x64 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x64.Build.0 = Debug|x64 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x86.ActiveCfg = Debug|Win32 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Debug|x86.Build.0 = Debug|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release_bc|x86.ActiveCfg = Release|Win32 - {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release_bc|x86.Build.0 = Release|Win32 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x64.ActiveCfg = Release|x64 + {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x64.Build.0 = Release|x64 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x86.ActiveCfg = Release|Win32 {0796DE6B-1E78-4275-936B-24BAACBF528C}.Release|x86.Build.0 = Release|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug_bc|x86.Build.0 = Debug|Win32 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x64.ActiveCfg = Debug|x64 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x64.Build.0 = Debug|x64 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x86.ActiveCfg = Debug|Win32 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Debug|x86.Build.0 = Debug|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release_bc|x86.ActiveCfg = Release|Win32 - {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release_bc|x86.Build.0 = Release|Win32 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x64.ActiveCfg = Release|x64 + {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x64.Build.0 = Release|x64 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x86.ActiveCfg = Release|Win32 {936B98CA-BCD1-45F0-9959-1CAEA7FA4DEF}.Release|x86.Build.0 = Release|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug_bc|x86.Build.0 = Debug|Win32 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x64.ActiveCfg = Debug|x64 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x64.Build.0 = Debug|x64 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x86.ActiveCfg = Debug|Win32 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Debug|x86.Build.0 = Debug|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release_bc|x86.ActiveCfg = Release|Win32 - {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release_bc|x86.Build.0 = Release|Win32 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x64.ActiveCfg = Release|x64 + {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x64.Build.0 = Release|x64 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x86.ActiveCfg = Release|Win32 {90065FFD-75BD-4085-B2E6-9E4146F69287}.Release|x86.Build.0 = Release|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug_bc|x86.Build.0 = Debug|Win32 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x64.ActiveCfg = Debug|x64 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x64.Build.0 = Debug|x64 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x86.ActiveCfg = Debug|Win32 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Debug|x86.Build.0 = Debug|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release_bc|x86.ActiveCfg = Release|Win32 - {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release_bc|x86.Build.0 = Release|Win32 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x64.ActiveCfg = Release|x64 + {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x64.Build.0 = Release|x64 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x86.ActiveCfg = Release|Win32 {48ECD7E5-CB2D-4D89-B1A5-BFBC2214E6BD}.Release|x86.Build.0 = Release|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug_bc|x86.Build.0 = Debug|Win32 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x64.ActiveCfg = Debug|x64 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x64.Build.0 = Debug|x64 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x86.ActiveCfg = Debug|Win32 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Debug|x86.Build.0 = Debug|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release_bc|x86.ActiveCfg = Release|Win32 - {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release_bc|x86.Build.0 = Release|Win32 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x64.ActiveCfg = Release|x64 + {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x64.Build.0 = Release|x64 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x86.ActiveCfg = Release|Win32 {0E9D40D8-C144-4760-ADC1-22D0E23A72EB}.Release|x86.Build.0 = Release|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug_bc|x86.Build.0 = Debug|Win32 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x64.ActiveCfg = Debug|x64 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x64.Build.0 = Debug|x64 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x86.ActiveCfg = Debug|Win32 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Debug|x86.Build.0 = Debug|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release_bc|x86.ActiveCfg = Release|Win32 - {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release_bc|x86.Build.0 = Release|Win32 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x64.ActiveCfg = Release|x64 + {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x64.Build.0 = Release|x64 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x86.ActiveCfg = Release|Win32 {2E122640-3CD7-4064-9AA3-9C685EE1A4DA}.Release|x86.Build.0 = Release|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug_bc|x86.Build.0 = Debug|Win32 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x64.ActiveCfg = Debug|x64 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x64.Build.0 = Debug|x64 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x86.ActiveCfg = Debug|Win32 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Debug|x86.Build.0 = Debug|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release_bc|x86.ActiveCfg = Release|Win32 - {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release_bc|x86.Build.0 = Release|Win32 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x64.ActiveCfg = Release|x64 + {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x64.Build.0 = Release|x64 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x86.ActiveCfg = Release|Win32 {65BCCE6E-3601-428C-8403-2F1AFC8B6E11}.Release|x86.Build.0 = Release|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug_bc|x86.Build.0 = Debug|Win32 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x64.ActiveCfg = Debug|x64 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x64.Build.0 = Debug|x64 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x86.ActiveCfg = Debug|Win32 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Debug|x86.Build.0 = Debug|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release_bc|x86.ActiveCfg = Release|Win32 - {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release_bc|x86.Build.0 = Release|Win32 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x64.ActiveCfg = Release|x64 + {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x64.Build.0 = Release|x64 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x86.ActiveCfg = Release|Win32 {0F6C5C6E-5B6D-463D-81DF-CCEB1271C759}.Release|x86.Build.0 = Release|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug_bc|x86.ActiveCfg = Debug|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug_bc|x86.Build.0 = Debug|Win32 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x64.ActiveCfg = Debug|x64 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x64.Build.0 = Debug|x64 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x86.ActiveCfg = Debug|Win32 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Debug|x86.Build.0 = Debug|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release_bc|x86.ActiveCfg = Release|Win32 - {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release_bc|x86.Build.0 = Release|Win32 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x64.ActiveCfg = Release|x64 + {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x64.Build.0 = Release|x64 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x86.ActiveCfg = Release|Win32 {DA4450E3-E694-4F89-AEB3-D1A5498BD6F5}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/c/tx/build/win/visualstudio/tx.vcxproj b/c/tx/build/win/visualstudio/tx.vcxproj index 12a18a147..5e27f03a1 100755 --- a/c/tx/build/win/visualstudio/tx.vcxproj +++ b/c/tx/build/win/visualstudio/tx.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {724EF7F1-8890-4571-8A39-FFF69187DA5A} @@ -21,42 +29,74 @@ MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + Application MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\..\..\exe\win\debug\ $(Configuration)\ true + true ..\..\..\exe\win\release\ $(Configuration)\ false + false $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) AllRules.ruleset + AllRules.ruleset + + AllRules.ruleset + AllRules.ruleset + + + + + ..\..\..\exe\win\release\ + + + ..\..\..\exe\win\debug\ Disabled - ../../../../public/lib/api;../../../../public/lib/resource;%(AdditionalIncludeDirectories) + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=DEVELOP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) MultiThreadedDebug @@ -65,17 +105,37 @@ EditAndContinue - ../../../../public/lib/lib/win/debug/dynarr.lib;../../../../public/lib/lib/win/debug/t1read.lib;../../../../public/lib/lib/win/debug/t1cstr.lib;../../../../public/lib/lib/win/debug/cffread.lib;../../../../public/lib/lib/win/debug/t2cstr.lib;../../../../public/lib/lib/win/debug/ttread.lib;../../../../public/lib/lib/win/debug/pstoken.lib;../../../../public/lib/lib/win/debug/absfont.lib;../../../../public/lib/lib/win/debug/ctutil.lib;../../../../public/lib/lib/win/debug/cffwrite.lib;../../../../public/lib/lib/win/debug/cfembed.lib;../../../../public/lib/lib/win/debug/pdfwrite.lib;../../../../public/lib/lib/win/debug/sfntread.lib;../../../../public/lib/lib/win/debug/sfntwrite.lib;../../../../public/lib/lib/win/debug/svgwrite.lib;../../../../public/lib/lib/win/debug/svread.lib;../../../../public/lib/lib/win/debug/sha1.lib;../../../../public/lib/lib/win/debug/t1write.lib;../../../../public/lib/lib/win/debug/support.lib;../../../../public/lib/lib/win/debug/uforead.lib;../../../../public/lib/lib/win/debug/ufowrite.lib;../../../../public/lib/lib/win/debug/nameread.lib;../../../../public/lib/lib/win/debug/varread.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).exe + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) true Console MachineX86 + + + Disabled + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) + CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=DEVELOP;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) + true + Console + + MaxSpeed - ../../../../public/lib/api;../../../../public/lib/resource;%(AdditionalIncludeDirectories) + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) NDEBUG;CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=EXPORT;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) MultiThreaded @@ -84,12 +144,31 @@ ProgramDatabase - ../../../../public/lib/lib/win/release/dynarr.lib;../../../../public/lib/lib/win/release/t1read.lib;../../../../public/lib/lib/win/release/t1cstr.lib;../../../../public/lib/lib/win/release/cffread.lib;../../../../public/lib/lib/win/release/t2cstr.lib;../../../../public/lib/lib/win/release/ttread.lib;../../../../public/lib/lib/win/release/pstoken.lib;../../../../public/lib/lib/win/release/absfont.lib;../../../../public/lib/lib/win/release/ctutil.lib;../../../../public/lib/lib/win/release/cffwrite.lib;../../../../public/lib/lib/win/release/cfembed.lib;../../../../public/lib/lib/win/release/pdfwrite.lib;../../../../public/lib/lib/win/release/sfntread.lib;../../../../public/lib/lib/win/release/sfntwrite.lib;../../../../public/lib/lib/win/release/svgwrite.lib;../../../../public/lib/lib/win/release/svread.lib;../../../../public/lib/lib/win/release/sha1.lib;../../../../public/lib/lib/win/release/t1write.lib;../../../../public/lib/lib/win/release/support.lib;../../../../public/lib/lib/win/release/uforead.lib;../../../../public/lib/lib/win/release/ufowrite.lib;../../../../public/lib/lib/win/release/nameread.lib;../../../../public/lib/lib/win/release/varread.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).exe + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) Console MachineX86 + + + MaxSpeed + ..\..\..\..\public\lib\api;..\..\..\..\public\lib\resource;%(AdditionalIncludeDirectories) + NDEBUG;CTL_CDECL=__cdecl;PLAT_WIN=1;OS=os_windowsNT;ISP=isp_i80486;STAGE=EXPORT;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + %(AdditionalDependencies) + $(OutDir) + $(TargetPath) + Console + + diff --git a/c/type1/build/win/visualstudio/type1.sln b/c/type1/build/win/visualstudio/type1.sln index 5cff31a4c..b116f4db2 100644 --- a/c/type1/build/win/visualstudio/type1.sln +++ b/c/type1/build/win/visualstudio/type1.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27703.2047 @@ -7,12 +6,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "type1", "type1.vcxproj", "{ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x64.ActiveCfg = Debug|x64 + {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x64.Build.0 = Debug|x64 {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x86.ActiveCfg = Debug|Win32 {BBE0C559-C528-4619-9449-AB466605C1C8}.Debug|x86.Build.0 = Debug|Win32 + {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x64.ActiveCfg = Release|x64 + {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x64.Build.0 = Release|x64 {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x86.ActiveCfg = Release|Win32 {BBE0C559-C528-4619-9449-AB466605C1C8}.Release|x86.Build.0 = Release|Win32 EndGlobalSection diff --git a/c/type1/build/win/visualstudio/type1.vcxproj b/c/type1/build/win/visualstudio/type1.vcxproj index 0698595a4..95a0e0dc5 100644 --- a/c/type1/build/win/visualstudio/type1.vcxproj +++ b/c/type1/build/win/visualstudio/type1.vcxproj @@ -1,14 +1,22 @@ - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {BBE0C559-C528-4619-9449-AB466605C1C8} @@ -21,31 +29,57 @@ MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + Application MultiByte $(DefaultPlatformToolset) + + Application + MultiByte + $(DefaultPlatformToolset) + + + + + + + <_ProjectFileVersion>10.0.30319.1 ..\..\..\exe\win\debug\ $(Configuration)\ true + true ..\..\..\exe\win\release\ $(Configuration)\ false + false $(ProjectName) + $(ProjectName) $(ProjectName) + $(ProjectName) + + + ..\..\..\exe\win\release\ + + + ..\..\..\exe\win\debug\ @@ -59,12 +93,31 @@ EditAndContinue - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) true Console MachineX86 + + + Disabled + %(AdditionalIncludeDirectories) + _CONSOLE;WIN32;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + true + Console + + MaxSpeed @@ -77,11 +130,29 @@ ProgramDatabase - $(OutDir)$(TargetName).exe + $(OutDir) + $(TargetPath) Console MachineX86 + + + MaxSpeed + %(AdditionalIncludeDirectories) + WIN32;_CONSOLE;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + $(OutDir) + $(TargetPath) + Console + + From 291ba86d7eec37b742625b656ba21d91b0b687b0 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Tue, 11 Sep 2018 23:45:42 -0700 Subject: [PATCH 08/26] Rename Windows build files It's a misnomer and totally confusing to name these things 'BuildAll' --- .gitignore | 6 ++--- c/buildall.cmd | 22 +++++++++---------- .../visualstudio/{BuildAll.cmd => build.cmd} | 0 .../visualstudio/{BuildAll.cmd => build.cmd} | 0 .../visualstudio/{BuildAll.cmd => build.cmd} | 0 .../visualstudio/{BuildAll.cmd => build.cmd} | 0 .../visualstudio/{BuildAll.cmd => build.cmd} | 0 .../visualstudio/{BuildAll.cmd => build.cmd} | 0 .../visualstudio/{BuildAll.cmd => build.cmd} | 0 .../visualstudio/{BuildAll.cmd => build.cmd} | 0 .../visualstudio/{BuildAll.cmd => build.cmd} | 0 11 files changed, 13 insertions(+), 15 deletions(-) rename c/detype1/build/win/visualstudio/{BuildAll.cmd => build.cmd} (100%) mode change 100755 => 100644 rename c/makeotf/build/win/visualstudio/{BuildAll.cmd => build.cmd} (100%) mode change 100755 => 100644 rename c/mergefonts/build/win/visualstudio/{BuildAll.cmd => build.cmd} (100%) mode change 100755 => 100644 rename c/rotatefont/build/win/visualstudio/{BuildAll.cmd => build.cmd} (100%) mode change 100755 => 100644 rename c/sfntdiff/build/win/visualstudio/{BuildAll.cmd => build.cmd} (100%) mode change 100755 => 100644 rename c/sfntedit/build/win/visualstudio/{BuildAll.cmd => build.cmd} (100%) mode change 100755 => 100644 rename c/spot/build/win/visualstudio/{BuildAll.cmd => build.cmd} (100%) mode change 100755 => 100644 rename c/tx/build/win/visualstudio/{BuildAll.cmd => build.cmd} (100%) mode change 100755 => 100644 rename c/type1/build/win/visualstudio/{BuildAll.cmd => build.cmd} (100%) diff --git a/.gitignore b/.gitignore index a2809d820..25b266326 100644 --- a/.gitignore +++ b/.gitignore @@ -17,15 +17,13 @@ dist/* htmlcov .pytest_cache -# ignore the OSX and linux compiled programs +# ignore the compiled programs c/build_all/* !c/build_all/this_folder_intentionally_left_empty # ignore the temp build directories and files *.o *.a -*.exe -*.pyc exe/ # Xcode files @@ -38,4 +36,4 @@ xcuserdata/ *vcxproj.user **/visualstudio/Debug/* **/visualstudio/Release/* -*.lib +**/visualstudio/x64/* diff --git a/c/buildall.cmd b/c/buildall.cmd index 6dde8b6a9..66191fff5 100755 --- a/c/buildall.cmd +++ b/c/buildall.cmd @@ -11,38 +11,38 @@ if %do_target%==0 ( echo " " echo "Building detype1..." -call %~dp0detype1\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 +call %~dp0detype1\build\win\visualstudio\build.cmd %1 || EXIT /B 1 echo " " echo "Building makeotf..." -call %~dp0makeotf\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 +call %~dp0makeotf\build\win\visualstudio\build.cmd %1 || EXIT /B 1 echo " " echo "Building mergefonts..." -call %~dp0mergefonts\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 +call %~dp0mergefonts\build\win\visualstudio\build.cmd %1 || EXIT /B 1 echo " " echo "Building rotatefont..." -call %~dp0rotatefont\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 +call %~dp0rotatefont\build\win\visualstudio\build.cmd %1 || EXIT /B 1 echo " " echo "Building sfntdiff..." -call %~dp0sfntdiff\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 +call %~dp0sfntdiff\build\win\visualstudio\build.cmd %1 || EXIT /B 1 echo " " echo "Building sfntedit..." -call %~dp0sfntedit\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 +call %~dp0sfntedit\build\win\visualstudio\build.cmd %1 || EXIT /B 1 echo " " echo "Building spot..." -call %~dp0spot\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 +call %~dp0spot\build\win\visualstudio\build.cmd %1 || EXIT /B 1 echo " " -echo "Building type1..." -call %~dp0type1\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 +echo "Building tx..." +call %~dp0tx\build\win\visualstudio\build.cmd %1 || EXIT /B 1 echo " " -echo "Building tx..." -call %~dp0tx\build\win\visualstudio\BuildAll.cmd %1 || EXIT /B 1 +echo "Building type1..." +call %~dp0type1\build\win\visualstudio\build.cmd %1 || EXIT /B 1 cd %~dp0 diff --git a/c/detype1/build/win/visualstudio/BuildAll.cmd b/c/detype1/build/win/visualstudio/build.cmd old mode 100755 new mode 100644 similarity index 100% rename from c/detype1/build/win/visualstudio/BuildAll.cmd rename to c/detype1/build/win/visualstudio/build.cmd diff --git a/c/makeotf/build/win/visualstudio/BuildAll.cmd b/c/makeotf/build/win/visualstudio/build.cmd old mode 100755 new mode 100644 similarity index 100% rename from c/makeotf/build/win/visualstudio/BuildAll.cmd rename to c/makeotf/build/win/visualstudio/build.cmd diff --git a/c/mergefonts/build/win/visualstudio/BuildAll.cmd b/c/mergefonts/build/win/visualstudio/build.cmd old mode 100755 new mode 100644 similarity index 100% rename from c/mergefonts/build/win/visualstudio/BuildAll.cmd rename to c/mergefonts/build/win/visualstudio/build.cmd diff --git a/c/rotatefont/build/win/visualstudio/BuildAll.cmd b/c/rotatefont/build/win/visualstudio/build.cmd old mode 100755 new mode 100644 similarity index 100% rename from c/rotatefont/build/win/visualstudio/BuildAll.cmd rename to c/rotatefont/build/win/visualstudio/build.cmd diff --git a/c/sfntdiff/build/win/visualstudio/BuildAll.cmd b/c/sfntdiff/build/win/visualstudio/build.cmd old mode 100755 new mode 100644 similarity index 100% rename from c/sfntdiff/build/win/visualstudio/BuildAll.cmd rename to c/sfntdiff/build/win/visualstudio/build.cmd diff --git a/c/sfntedit/build/win/visualstudio/BuildAll.cmd b/c/sfntedit/build/win/visualstudio/build.cmd old mode 100755 new mode 100644 similarity index 100% rename from c/sfntedit/build/win/visualstudio/BuildAll.cmd rename to c/sfntedit/build/win/visualstudio/build.cmd diff --git a/c/spot/build/win/visualstudio/BuildAll.cmd b/c/spot/build/win/visualstudio/build.cmd old mode 100755 new mode 100644 similarity index 100% rename from c/spot/build/win/visualstudio/BuildAll.cmd rename to c/spot/build/win/visualstudio/build.cmd diff --git a/c/tx/build/win/visualstudio/BuildAll.cmd b/c/tx/build/win/visualstudio/build.cmd old mode 100755 new mode 100644 similarity index 100% rename from c/tx/build/win/visualstudio/BuildAll.cmd rename to c/tx/build/win/visualstudio/build.cmd diff --git a/c/type1/build/win/visualstudio/BuildAll.cmd b/c/type1/build/win/visualstudio/build.cmd similarity index 100% rename from c/type1/build/win/visualstudio/BuildAll.cmd rename to c/type1/build/win/visualstudio/build.cmd From 1381bfadcdfe04cee0eb0e32ec5755d8b709af03 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Tue, 11 Sep 2018 23:56:51 -0700 Subject: [PATCH 09/26] Generate x64 Windows wheel --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index e59d8a1a7..0ba9d529f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,7 +2,7 @@ image: Visual Studio 2017 environment: global: - CIBW_SKIP: cp33-* cp34-* cp35-* cp37-* *-win_amd64 + CIBW_SKIP: cp33-* cp34-* cp35-* cp37-* cp27-win_amd64 cp36-win32 CIBW_TEST_REQUIRES: pytest-cov==2.5.1 codecov subprocess32 CIBW_TEST_COMMAND: cd {project} && pytest --cov -v && coverage combine && codecov && pip uninstall --yes afdko TWINE_USERNAME: afdko-travis From cb7864f67c3025635551d33ca7d5ac300eda1194 Mon Sep 17 00:00:00 2001 From: ReadRoberts Date: Wed, 12 Sep 2018 13:51:37 -0700 Subject: [PATCH 10/26] [makeotfexe] Fix old bug in setting Unicode values. If a font has no glyphs which are assigned a Unicode value, either implicitly from having ASCII range characters, or via the GOADB file, a pointer is set to reference to whatever is in memory just before the array which is supposed to contain the UVs. On the Mac, and I imagine in prior build environments, the referenced value happens to 0, when running under 64 bit Windows, this memory os non-zero, and causes a crash. The fix is simply to skip the logic that process the array of Unicode values, when there aren't any. The bug was in in map.c::setOS_2Fields(). --- c/makeotf/makeotf_lib/source/hotconv/map.c | 84 +++++++++++----------- 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/c/makeotf/makeotf_lib/source/hotconv/map.c b/c/makeotf/makeotf_lib/source/hotconv/map.c index 5ff1afa6a..f3e7dedfd 100644 --- a/c/makeotf/makeotf_lib/source/hotconv/map.c +++ b/c/makeotf/makeotf_lib/source/hotconv/map.c @@ -1701,6 +1701,8 @@ static void setOS_2Fields(hotCtx g) { } } OS_2SetCharIndexRange(g, minBMP, maxBMP); + + /* Xcode compiler kept complaining about signed/unsigned mistmach - can't figure out why. */ /* OS_2SetCharIndexRange(g, (unsigned short)( (uvCnt == (unsigned)0) ? UV_UNDEF : h->minBmpUV), (unsigned short)( ((uvCnt == (unsigned)0) || (h->nSuppUV > (unsigned)0)) ? UV_UNDEF : h->maxBmpUV)); */ @@ -1708,47 +1710,49 @@ static void setOS_2Fields(hotCtx g) { unicodeRange[0] = unicodeRange[1] = unicodeRange[2] = unicodeRange[3] = 0; - /* Loop thru sorted UV array (saves bsearches for primary UVs). Addl */ - /* UVs have already been recorded by calls to addToBlock, which does */ - /* use bsearch */ - p = uvarray; - for (i = 0; i < ARRAY_LEN(unicodeBlock); i++) { - UnicodeBlock *block = &unicodeBlock[i]; - unsigned long numRequired; - - for (; p <= &uvarray[uvCnt - 1] && (*p)->uv < block->first; p++) { - } - if (p <= &uvarray[uvCnt - 1] && (*p)->uv <= block->last) { - /* p now points at the first UV candidate for this block */ - for (q = p; (q + 1) <= &uvarray[uvCnt - 1] && - (*(q + 1))->uv <= block->last; - q++) { + if (uvCnt != 0) { + /* Loop thru sorted UV array (saves bsearches for primary UVs). Addl */ + /* UVs have already been recorded by calls to addToBlock, which does */ + /* use bsearch */ + p = uvarray; + for (i = 0; i < ARRAY_LEN(unicodeBlock); i++) { + UnicodeBlock *block = &unicodeBlock[i]; + unsigned long numRequired; + + for (; p <= &uvarray[uvCnt - 1] && (*p)->uv < block->first; p++) { } - block->numFound += q - p + 1; - p = q + 1; - } - numRequired = 1 + block->numEssential / 3; - - /* This is a hack. The numEssential field is set for each block in */ - /* uniblock. This is currently the number of entries in the range */ - /* from min UV to max UV of the block. This is already not right, */ - /* as in most blocks, not all UV's in the range are valid. However, */ - /* most of these ranges include a lot of archaic and unusual */ - /* glyphs not really needed for useful support of the script. I am */ - /* going to just say that if at least third of the entry range is */ - /* included in the font, the designer was making a reasonable */ - /* effort to support this block */ - - if (block->numFound >= numRequired) { - block->isSupported = 1; - SET_BIT_ARR(unicodeRange, block->bitNum); - } - /* - else if (block->numFound > 0) - { - printf(" %4d %4d, name %s.\n", block->numFound, block->numEssential, block->name); - } - */ + if (p <= &uvarray[uvCnt - 1] && (*p)->uv <= block->last) { + /* p now points at the first UV candidate for this block */ + for (q = p; (q + 1) <= &uvarray[uvCnt - 1] && + (*(q + 1))->uv <= block->last; + q++) { + } + block->numFound += q - p + 1; + p = q + 1; + } + numRequired = 1 + block->numEssential / 3; + + /* This is a hack. The numEssential field is set for each block in */ + /* uniblock. This is currently the number of entries in the range */ + /* from min UV to max UV of the block. This is already not right, */ + /* as in most blocks, not all UV's in the range are valid. However, */ + /* most of these ranges include a lot of archaic and unusual */ + /* glyphs not really needed for useful support of the script. I am */ + /* going to just say that if at least third of the entry range is */ + /* included in the font, the designer was making a reasonable */ + /* effort to support this block */ + + if (block->numFound >= numRequired) { + block->isSupported = 1; + SET_BIT_ARR(unicodeRange, block->bitNum); + } + /* + else if (block->numFound > 0) + { + printf(" %4d %4d, name %s.\n", block->numFound, block->numEssential, block->name); + } + */ + } } if (h->nSuppUV > 0) { SET_BIT_ARR(unicodeRange, SUPP_UV_BITNUM); From ebbfe08e59e3af09900e6c50205cc28aa18d72d2 Mon Sep 17 00:00:00 2001 From: ReadRoberts Date: Tue, 11 Sep 2018 11:34:31 -0700 Subject: [PATCH 11/26] [makeotfexe] Fix return codes. makeotfexe should return 0 with the options -u and -h. It should return 1 if a the source font file or source feature file is not found. It is valid to not provide any arguments: this is the same as providing a source font file of 'font.ps', and a feature file of 'features'. --- c/makeotf/source/cb.c | 8 ++------ c/makeotf/source/main.c | 8 ++++---- tests/makeotfexe_test.py | 22 ++++++++++++++++++++++ tests/runner.py | 2 +- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/c/makeotf/source/cb.c b/c/makeotf/source/cb.c index 71904c0ae..2664b0e1b 100644 --- a/c/makeotf/source/cb.c +++ b/c/makeotf/source/cb.c @@ -1762,15 +1762,11 @@ void cbConvert(cbCtx h, int flags, char *clientVers, } if (!fileExists(pfbpath)) { - char buf[1024]; - sprintf(buf, "Specified source font file not found: %s \n", pfbpath); - message(h, hotERROR, buf); + cbFatal(h, "Source font file not found: %s \n", pfbpath); return; } if ((featurefile != NULL) && (!fileExists(featurefile))) { - char buf[1024]; - sprintf(buf, "Specified feature file not found: %s \n", featurefile); - message(h, hotERROR, buf); + cbFatal(h, "Feature file not found: %s \n", featurefile); return; } diff --git a/c/makeotf/source/main.c b/c/makeotf/source/main.c index a2cfb4d47..d4c7bc8d1 100644 --- a/c/makeotf/source/main.c +++ b/c/makeotf/source/main.c @@ -30,8 +30,8 @@ jmp_buf mark; -#define MAKEOTF_VERSION "2.5.65593" -/*Warning: this string is now part of heuristic used by CoolType to identify the +#define MAKEOTF_VERSION "2.5.65594" +/* 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 the regex: @@ -264,13 +264,13 @@ static void printUsage(void) { /* Show usage information */ static void showUsage(void) { printUsage(); - exit(1); + exit(0); } /* Show usage and help information */ static void showHelp(void) { printUsage(); - exit(1); + exit(0); } extern char *sep(); diff --git a/tests/makeotfexe_test.py b/tests/makeotfexe_test.py index 1d4c8303d..485147702 100755 --- a/tests/makeotfexe_test.py +++ b/tests/makeotfexe_test.py @@ -3,6 +3,7 @@ import os import pytest import tempfile +import subprocess32 as subprocess from fontTools.ttLib import TTFont @@ -40,6 +41,27 @@ def _generate_ttx_dump(font_path, tables=None): # Tests # ----- +def test_exit_no_option(): + # It's valid to run 'makeotfexe' without using any options, + # but if a default-named font file ('font.ps') is NOT found + # in the current directory, the tool exits with an error + with pytest.raises(subprocess.CalledProcessError) as err: + subprocess.check_call([TOOL]) + assert err.value.returncode == 1 + + +@pytest.mark.parametrize('arg', ['-h', '-u']) +def test_exit_known_option(arg): + assert subprocess.check_call([TOOL, arg]) == 0 + + +@pytest.mark.parametrize('arg', ['j', 'bogus']) +def test_exit_unknown_option(arg): + with pytest.raises(subprocess.CalledProcessError) as err: + runner(CMD + ['-n', '-o', arg]) + assert err.value.returncode == 1 + + @pytest.mark.parametrize('caret_format', [ 'bypos', 'byindex', 'mixed', 'mixed2', 'double', 'double2']) def test_GDEF_LigatureCaret_bug155(caret_format): diff --git a/tests/runner.py b/tests/runner.py index a2e64d48c..773ac9dc9 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -106,7 +106,7 @@ def _check_tool(tool_name): tool_name += '.exe' # XXX start hack to bypass this issue # https://github.com/adobe-type-tools/afdko/issues/348 - if tool_name.split('.')[0] in ('sfntdiff', 'sfntedit', 'makeotfexe'): + if tool_name.split('.')[0] in ('sfntdiff', 'sfntedit'): return tool_name # XXX end hack try: From 3cf95a2fcb9d22e7f1c3a288609ffc25ef4ab90b Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Thu, 13 Sep 2018 01:40:24 -0700 Subject: [PATCH 12/26] [makeotf test] Validate glyph renaming --- .../expected_output/bug497/opts-gf-ga-nga.ttx | 10 +++++----- .../makeotf_data/expected_output/bug497/opts-gf-ga.ttx | 10 +++++----- .../expected_output/bug497/opts-r-ga-gf.ttx | 10 +++++----- .../makeotf_data/expected_output/bug497/opts-r-gf.ttx | 10 +++++----- tests/makeotf_data/input/bug497/goadb.txt | 2 +- tests/makeotf_test.py | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/makeotf_data/expected_output/bug497/opts-gf-ga-nga.ttx b/tests/makeotf_data/expected_output/bug497/opts-gf-ga-nga.ttx index de036d163..ff8bef801 100644 --- a/tests/makeotf_data/expected_output/bug497/opts-gf-ga-nga.ttx +++ b/tests/makeotf_data/expected_output/bug497/opts-gf-ga-nga.ttx @@ -4,7 +4,7 @@ - + @@ -156,14 +156,14 @@ - + - + @@ -254,7 +254,7 @@ -42 -47 -38 -23 -47 hhcurveto endchar - + 0 endchar @@ -268,7 +268,7 @@ - + diff --git a/tests/makeotf_data/expected_output/bug497/opts-gf-ga.ttx b/tests/makeotf_data/expected_output/bug497/opts-gf-ga.ttx index de036d163..ff8bef801 100644 --- a/tests/makeotf_data/expected_output/bug497/opts-gf-ga.ttx +++ b/tests/makeotf_data/expected_output/bug497/opts-gf-ga.ttx @@ -4,7 +4,7 @@ - + @@ -156,14 +156,14 @@ - + - + @@ -254,7 +254,7 @@ -42 -47 -38 -23 -47 hhcurveto endchar - + 0 endchar @@ -268,7 +268,7 @@ - + diff --git a/tests/makeotf_data/expected_output/bug497/opts-r-ga-gf.ttx b/tests/makeotf_data/expected_output/bug497/opts-r-ga-gf.ttx index 0b6a00f40..0f30973ed 100644 --- a/tests/makeotf_data/expected_output/bug497/opts-r-ga-gf.ttx +++ b/tests/makeotf_data/expected_output/bug497/opts-r-ga-gf.ttx @@ -4,7 +4,7 @@ - + @@ -156,14 +156,14 @@ - + - + @@ -254,7 +254,7 @@ -42 -47 -38 -23 -47 hhcurveto endchar - + 0 endchar @@ -268,7 +268,7 @@ - + diff --git a/tests/makeotf_data/expected_output/bug497/opts-r-gf.ttx b/tests/makeotf_data/expected_output/bug497/opts-r-gf.ttx index 0b6a00f40..0f30973ed 100644 --- a/tests/makeotf_data/expected_output/bug497/opts-r-gf.ttx +++ b/tests/makeotf_data/expected_output/bug497/opts-r-gf.ttx @@ -4,7 +4,7 @@ - + @@ -156,14 +156,14 @@ - + - + @@ -254,7 +254,7 @@ -42 -47 -38 -23 -47 hhcurveto endchar - + 0 endchar @@ -268,7 +268,7 @@ - + diff --git a/tests/makeotf_data/input/bug497/goadb.txt b/tests/makeotf_data/input/bug497/goadb.txt index 618fd963d..afc0b7e3d 100644 --- a/tests/makeotf_data/input/bug497/goadb.txt +++ b/tests/makeotf_data/input/bug497/goadb.txt @@ -1,3 +1,3 @@ .notdef .notdef -negative negative uni200B +evitagen negative uni200B a a diff --git a/tests/makeotf_test.py b/tests/makeotf_test.py index 74d486b34..5bbbb6bbe 100755 --- a/tests/makeotf_test.py +++ b/tests/makeotf_test.py @@ -481,7 +481,7 @@ def test_cid_keyed_cff_bug470(args, font, fontinfo): ['bit7y', 'bit8n', 'bit9n'], ['bit7y', 'bit8n', 'bit7n', 'bit8y'], ]) -def test_bug497(opts): +def test_GOADB_options_bug497(opts): font_path = _get_input_path(T1PFA_NAME) feat_path = _get_input_path('bug497/feat.fea') fmndb_path = _get_input_path('bug497/fmndb.txt') From 6d22f9f092bdd39de6cf89fcfa8271d3a42a6023 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Thu, 13 Sep 2018 03:05:10 -0700 Subject: [PATCH 13/26] Simplify testing exit codes --- tests/detype1_test.py | 13 ++----------- tests/makeotf_test.py | 20 +++++++++++--------- tests/makeotfexe_test.py | 6 ++---- tests/mergefonts_test.py | 13 ++----------- tests/rotatefont_test.py | 13 ++----------- tests/spot_test.py | 15 +++++++++++++-- tests/stemhist_test.py | 13 ++----------- tests/tx_test.py | 17 ++++++++++++++++- tests/type1_test.py | 13 ++----------- 9 files changed, 52 insertions(+), 71 deletions(-) diff --git a/tests/detype1_test.py b/tests/detype1_test.py index 191fa4774..5429d9cce 100755 --- a/tests/detype1_test.py +++ b/tests/detype1_test.py @@ -1,7 +1,6 @@ from __future__ import print_function, division, absolute_import import os -import platform import pytest import subprocess32 as subprocess @@ -23,20 +22,12 @@ def _get_expected_path(file_name): @pytest.mark.parametrize('arg', ['-h']) def test_exit_known_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 0 + assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['-v', '-u']) def test_exit_unknown_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 1 + assert subprocess.call([TOOL, arg]) == 1 def test_run_on_pfa_data(): diff --git a/tests/makeotf_test.py b/tests/makeotf_test.py index 5bbbb6bbe..8759f9e3e 100755 --- a/tests/makeotf_test.py +++ b/tests/makeotf_test.py @@ -3,7 +3,6 @@ from __future__ import print_function, division, absolute_import import os -import platform import pytest from shutil import copy2, copytree, rmtree import subprocess32 as subprocess @@ -80,20 +79,23 @@ def _generate_ttx_dump(font_path, tables=None): # Tests # ----- +def test_exit_no_option(): + # It's valid to run 'makeotf' without using any options, + # but if a default-named font file is NOT found in the + # current directory, the tool exits with an error + with pytest.raises(subprocess.CalledProcessError) as err: + subprocess.check_call([TOOL]) + assert err.value.returncode == 1 + + @pytest.mark.parametrize('arg', ['-v', '-h', '-u']) def test_exit_known_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.check_call([tool_name, arg]) == 0 + assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['j', 'bogus']) def test_exit_unknown_option(arg): - with pytest.raises(subprocess.CalledProcessError) as err: - runner(CMD + ['-n', '-o', arg]) - assert err.value.returncode == 1 + assert subprocess.call([TOOL, arg]) == 1 @pytest.mark.parametrize('arg, input_filename, ttx_filename', [ diff --git a/tests/makeotfexe_test.py b/tests/makeotfexe_test.py index 485147702..08607cbe3 100755 --- a/tests/makeotfexe_test.py +++ b/tests/makeotfexe_test.py @@ -52,14 +52,12 @@ def test_exit_no_option(): @pytest.mark.parametrize('arg', ['-h', '-u']) def test_exit_known_option(arg): - assert subprocess.check_call([TOOL, arg]) == 0 + assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['j', 'bogus']) def test_exit_unknown_option(arg): - with pytest.raises(subprocess.CalledProcessError) as err: - runner(CMD + ['-n', '-o', arg]) - assert err.value.returncode == 1 + assert subprocess.call([TOOL, arg]) == 1 @pytest.mark.parametrize('caret_format', [ diff --git a/tests/mergefonts_test.py b/tests/mergefonts_test.py index 25aa0f4df..067c5cfc3 100755 --- a/tests/mergefonts_test.py +++ b/tests/mergefonts_test.py @@ -1,7 +1,6 @@ from __future__ import print_function, division, absolute_import import os -import platform import pytest import subprocess32 as subprocess import tempfile @@ -35,20 +34,12 @@ def _get_temp_file_path(): @pytest.mark.parametrize('arg', ['-h', '-v', '-u']) def test_exit_known_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 0 + assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['-z', '-foo']) def test_exit_unknown_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 1 + assert subprocess.call([TOOL, arg]) == 1 def test_convert_to_cid(): diff --git a/tests/rotatefont_test.py b/tests/rotatefont_test.py index 5fccb3aeb..ed952e1d7 100755 --- a/tests/rotatefont_test.py +++ b/tests/rotatefont_test.py @@ -1,7 +1,6 @@ from __future__ import print_function, division, absolute_import import os -import platform import pytest import subprocess32 as subprocess @@ -28,20 +27,12 @@ def _get_input_path(file_name): @pytest.mark.parametrize('arg', ['-h', '-v', '-u']) def test_exit_known_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 0 + assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['-z', '-foo']) def test_exit_unknown_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 1 + assert subprocess.call([TOOL, arg]) == 1 @pytest.mark.parametrize('i, matrix', [ diff --git a/tests/spot_test.py b/tests/spot_test.py index 7911f9b1f..a170ceede 100755 --- a/tests/spot_test.py +++ b/tests/spot_test.py @@ -2,6 +2,7 @@ import os import pytest +import subprocess32 as subprocess from .runner import main as runner from .differ import main as differ @@ -21,6 +22,16 @@ def _get_expected_path(file_name): # Tests # ----- +@pytest.mark.parametrize('arg', ['-h', '-u']) +def test_exit_known_option(arg): + assert subprocess.call([TOOL, arg]) == 0 + + +@pytest.mark.parametrize('arg', ['-z', '-foo']) +def test_exit_unknown_option(arg): + assert subprocess.call([TOOL, arg]) == 1 + + @pytest.mark.parametrize('args, exp_filename', [ (['T'], 'list_tables.txt'), (['F'], 'list_features.txt'), @@ -80,14 +91,14 @@ def test_options(args, exp_filename): @pytest.mark.parametrize('font_format', ['otf', 'ttf']) -def test_bug373(font_format): +def test_long_glyph_name_bug373(font_format): file_name = 'long_glyph_name.' + font_format actual_path = runner(CMD + ['-r', '-o', 't', '_GSUB=7', '-f', file_name]) expected_path = _get_expected_path('bug373_{}.txt'.format(font_format)) assert differ([expected_path, actual_path]) -def test_bug465(): +def test_buffer_overrun_bug465(): """ Fix bug where a fixed length string buffer was overrun. The test font was built by building an otf from makeotf_data/input/t1pfa.pfa, dumping this to ttx, and then hand-editing the ttx file to have diff --git a/tests/stemhist_test.py b/tests/stemhist_test.py index 978e15cbd..7ba76946f 100755 --- a/tests/stemhist_test.py +++ b/tests/stemhist_test.py @@ -1,7 +1,6 @@ from __future__ import print_function, division, absolute_import import os -import platform import pytest import subprocess32 as subprocess import tempfile @@ -35,20 +34,12 @@ def _get_temp_file_path(): @pytest.mark.parametrize('arg', ['-h', '-u']) def test_exit_known_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 0 + assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['-z', '-foo']) def test_exit_unknown_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 1 + assert subprocess.call([TOOL, arg]) == 1 @pytest.mark.parametrize('arg', ([], ['a'], ['all'])) diff --git a/tests/tx_test.py b/tests/tx_test.py index c131f3dfc..859dec323 100755 --- a/tests/tx_test.py +++ b/tests/tx_test.py @@ -2,6 +2,7 @@ import os import pytest +import subprocess32 as subprocess import tempfile from .runner import main as runner @@ -46,6 +47,20 @@ def _get_extension(in_format): ] +# ----------- +# Basic tests +# ----------- + +@pytest.mark.parametrize('arg', ['-h', '-v', '-u']) +def test_exit_known_option(arg): + assert subprocess.call([TOOL, arg]) == 0 + + +@pytest.mark.parametrize('arg', ['-z', '-foo']) +def test_exit_unknown_option(arg): + assert subprocess.call([TOOL, arg]) == 1 + + # ------------- # Convert tests # ------------- @@ -251,7 +266,7 @@ def test_non_varying_glyphs_bug356(): assert differ([expected_path, stderr_path, '-l', '1']) -def test_bug473(): +def test_illegal_chars_in_glyph_name_bug473(): save_path = os.path.join(_get_temp_dir_path(), 'bug473.ufo') ufo_path = runner(CMD + ['-o', 'ufo', '-f', 'bug473.ufo', '-s', save_path]) expected_path = _get_expected_path('bug473.ufo') diff --git a/tests/type1_test.py b/tests/type1_test.py index 2efd7167b..0cbc9d9e5 100755 --- a/tests/type1_test.py +++ b/tests/type1_test.py @@ -1,7 +1,6 @@ from __future__ import print_function, division, absolute_import import os -import platform import pytest import subprocess32 as subprocess @@ -23,20 +22,12 @@ def _get_expected_path(file_name): @pytest.mark.parametrize('arg', ['-h']) def test_exit_known_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 0 + assert subprocess.call([TOOL, arg]) == 0 @pytest.mark.parametrize('arg', ['-v', '-u']) def test_exit_unknown_option(arg): - if platform.system() == 'Windows': - tool_name = TOOL + '.exe' - else: - tool_name = TOOL - assert subprocess.call([tool_name, arg]) == 1 + assert subprocess.call([TOOL, arg]) == 1 def test_run_on_txt_data(): From 7436ae0433fe030546af3da3a263077943bafdb6 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Thu, 13 Sep 2018 03:18:48 -0700 Subject: [PATCH 14/26] Move makeotf tests that belong to makeotfexe --- tests/makeotf_test.py | 53 ---- .../expected_output/bug196.ttx | 0 .../expected_output/bug416.ttx | 0 .../expected_output/bug438.ttx | 269 ++++++++++++++++++ .../input/bug196/feat.fea} | 0 .../input/bug196/font.pfa} | 0 .../input/bug416/feat.fea} | 0 .../input/bug416/font.pfa} | 0 .../input/bug438/feat.fea | 0 tests/makeotfexe_data/input/bug438/font.pfa | 65 +++++ tests/makeotfexe_test.py | 56 +++- 11 files changed, 389 insertions(+), 54 deletions(-) rename tests/{makeotf_data => makeotfexe_data}/expected_output/bug196.ttx (100%) rename tests/{makeotf_data => makeotfexe_data}/expected_output/bug416.ttx (100%) create mode 100644 tests/makeotfexe_data/expected_output/bug438.ttx rename tests/{makeotf_data/input/bug196/bug196.fea => makeotfexe_data/input/bug196/feat.fea} (100%) rename tests/{makeotf_data/input/bug196/bug196.pfa => makeotfexe_data/input/bug196/font.pfa} (100%) rename tests/{makeotf_data/input/bug416/bug416.fea => makeotfexe_data/input/bug416/feat.fea} (100%) rename tests/{makeotf_data/input/bug416/bug416.pfa => makeotfexe_data/input/bug416/font.pfa} (100%) rename tests/{makeotf_data => makeotfexe_data}/input/bug438/feat.fea (100%) create mode 100644 tests/makeotfexe_data/input/bug438/font.pfa diff --git a/tests/makeotf_test.py b/tests/makeotf_test.py index 8759f9e3e..70b4cb6f6 100755 --- a/tests/makeotf_test.py +++ b/tests/makeotf_test.py @@ -394,45 +394,6 @@ def test_build_options_cs_cl_bug459(args, input_filename, ttx_filename): assert differ([expected_ttx, actual_ttx, '-s', ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SourceSans + + + Regular + + + 1.000;ADBE;SourceSans-Test + + + SourceSans + + + Version 1.000;hotconv 1.0.108;makeotfexe 2.5.65593 DEVELOPMENT + + + SourceSans-Test + + + Test + + + SourceSans + + + Regular + + + 1.000;ADBE;SourceSans-Test + + + SourceSans + + + Version 1.000;hotconv 1.0.108;makeotfexe 2.5.65593 DEVELOPMENT + + + SourceSans-Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 653 0 58 542 60 hstem + 89 65 344 67 vstem + 89 hmoveto + 476 660 -476 hlineto + 108 -602 rmoveto + 74 132 54 103 rlineto + 4 hlineto + 52 -103 73 -132 rlineto + -129 329 rmoveto + -50 94 -66 119 rlineto + 235 hlineto + -66 -119 -49 -94 rlineto + -175 -277 rmoveto + 462 vlineto + 127 -232 rlineto + 217 -230 rmoveto + -126 230 126 232 rlineto + endchar + + + 504 194 -12 rmoveto + 61 54 32 38 46 hvcurveto + 3 hlineto + 7 -58 rlineto + 68 298 hlineto + 121 -50 79 -119 -78 -68 -34 -29 -45 vhcurveto + 32 -57 rlineto + 26 38 51 26 56 hhcurveto + 80 20 -60 -62 hvcurveto + -207 -23 -91 -53 -106 vvcurveto + -87 61 -51 81 vhcurveto + 24 66 rmoveto + -48 -38 23 55 62 56 40 162 20 hvcurveto + -135 vlineto + -42 -47 -38 -23 -47 hhcurveto + endchar + + + 0 endchar + + + + + + + + + + + + + + + + diff --git a/tests/makeotf_data/input/bug196/bug196.fea b/tests/makeotfexe_data/input/bug196/feat.fea similarity index 100% rename from tests/makeotf_data/input/bug196/bug196.fea rename to tests/makeotfexe_data/input/bug196/feat.fea diff --git a/tests/makeotf_data/input/bug196/bug196.pfa b/tests/makeotfexe_data/input/bug196/font.pfa similarity index 100% rename from tests/makeotf_data/input/bug196/bug196.pfa rename to tests/makeotfexe_data/input/bug196/font.pfa diff --git a/tests/makeotf_data/input/bug416/bug416.fea b/tests/makeotfexe_data/input/bug416/feat.fea similarity index 100% rename from tests/makeotf_data/input/bug416/bug416.fea rename to tests/makeotfexe_data/input/bug416/feat.fea diff --git a/tests/makeotf_data/input/bug416/bug416.pfa b/tests/makeotfexe_data/input/bug416/font.pfa similarity index 100% rename from tests/makeotf_data/input/bug416/bug416.pfa rename to tests/makeotfexe_data/input/bug416/font.pfa diff --git a/tests/makeotf_data/input/bug438/feat.fea b/tests/makeotfexe_data/input/bug438/feat.fea similarity index 100% rename from tests/makeotf_data/input/bug438/feat.fea rename to tests/makeotfexe_data/input/bug438/feat.fea diff --git a/tests/makeotfexe_data/input/bug438/font.pfa b/tests/makeotfexe_data/input/bug438/font.pfa new file mode 100644 index 000000000..4ac04bd76 --- /dev/null +++ b/tests/makeotfexe_data/input/bug438/font.pfa @@ -0,0 +1,65 @@ +%!FontType1-1.1: SourceSans-Test 2.20 +%ADOt1write: (1.0.34) +%%BeginResource: font SourceSans-Test +12 dict dup begin +/FontType 1 def +/FontName /SourceSans-Test def +/FontInfo 8 dict dup begin +/version (2.20) def +/Notice (Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.) def +/Copyright (Copyright 2010, 2012, 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'.) def +/FamilyName (Source Sans) def +/UnderlinePosition -75 def +end def +/PaintType 0 def +/FontMatrix [0.001 0 0 0.001 0 0] def +/Encoding StandardEncoding def +/FontBBox {52 -12 565 660} def +end +currentfile eexec BAB431EA06BB0A1031E1AA11919E714AC69FC4EA3B6672 +ABF3FDE103443FF5321890FEA3C9361761AC3B607C4C960F4D385045AB5EBCA8 +90FBA7C10718659A90ABF027E30B88E7D14F8D16AC4F74C85733B7705F6CF5C8 +EBAB2E0E40F736110B62422F3D642359FA764B81D9A72049DBFF40187C41455E +5378378702658031C363F2CD4F37345F8FA78044A0491D8AE5B00254A201ADC9 +30CA211B7CAA4782B90547B9664E61F24869CF78DB4E8687FFFE91F16C9E5FF1 +186F31A78B27F54E1C146EDF26271FB25D6AD6FEF7C6577CD58340BEADDE6FFC +AA900264B944E40145476E80CCD21E6143836F5909D71062CC93959AE79B8E83 +83907879DE05209C61D11D1236219DB0524104110DAFF742B28B499F14E126FD +A0B725194ECC86E08F6388D0444BA0297C3D0DEB2E3B1C8EEAF8712C66B0B663 +F560C0CC421487AA0FF3D43F6D48F457D378DC3FDC3FBFE182735FEE782B8801 +D71B6BBB5D42EDB9CF55722C3867223F258B86586AE360694E1980B8BF6B3EC4 +08D39C47787B894DA23EA2DAC3297E0D49C2CAF9BC9F44E24F07AE4F5B3826E9 +F6406BEAEE900804BF3FE8C42804115163753BBA67420C52696A6BD7AFEF9266 +733FB27A68B5D05F4C091ECD0262FD43CB49605B04E19CCB129439ABE1EFA11B +705FCA0AC57C815EA8E7E65644FDC17369A707D15D5A4D2E1596BFE6917189A8 +A2711DC2D996CA9970006BB5EF58211349AAD9B49C2D377C07024428552D8168 +2D2031300451A384F73FCFDCDF5C29A00C657B7CFC409A30E2BF2AC1944EB028 +23EC388C2A1D6B20D52EC2E817E0A063AE48AA7CFBFFD30E7BACEDCA93995CB1 +66379EA794F61F3DFFB4D9FC7C25DD5ACC48DD8EE6BBB6DE526717BDED470F33 +321CED8A2958D6F8490D834DA175A70D0F759ABD27B37C6FFE6BC0590D470A32 +91F4374CD9C6471A21BCFBC97625E3C4116D9B0C6ADF60E1F47F0B76080F725D +53B5ADFC880200B5CFA40536E83FC0FF61BB5D5B86B115A68D95CEEAD85B8C9D +A1E6931780781FA3FB0FDB5A575C95FED4BB91F2154DCF699885C4585B2A4AD9 +25FAD160F60F34F298B5F65386E4CBA229C37569A7BD7C58F64E20D225C8A925 +ECA90B51A3EB7E335F5FE4D6E9A6D6F8F5CC5106984801198FA2D1E43219FA92 +C8AD14E7B1610DAA215E8D63216A90D9992C5106349C40967149FDAD08EE9638 +485B07609C18C971ADCC2E04FC4A51D6B6FC0E77918C9EC1F5D0651432D84B35 +9FD0F6C03F4826D53A2DDEC99DB19EA1ACD2E040E85D07C68E7A4FE59DAE50AF +DF8F1B67C27F14450C52EB5BE7B7232C1E35D8CDC5612A7C4DCE98767FF7059E +6680989C0671CBACC8E7EF04DD0C9CB3B3E2B29564EE440C4119AB58E893D38D +7136FAC9AA14E9A26AF56A31DAA71EBF7508559349A63354E5105465E83DDDE6 +E78A4D81F3995CD991B70281C228E34F6084A4D4E76BAF6CFB86EF73706910DB +AC7EB1793FB658C9AF0288258A8D370AE2A694AB571B793BE22436C0B1A35111 +C3039ED8C9EA63598025A5EDA8DDFC3A972B982F1D1B2E7F24AF925331B9F762 +0A07166437AD880584C5D4F39C +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +%%EndResource +%%EOF diff --git a/tests/makeotfexe_test.py b/tests/makeotfexe_test.py index 08607cbe3..3ea0b74f3 100755 --- a/tests/makeotfexe_test.py +++ b/tests/makeotfexe_test.py @@ -2,13 +2,14 @@ import os import pytest -import tempfile import subprocess32 as subprocess +import tempfile from fontTools.ttLib import TTFont from .runner import main as runner from .differ import main as differ +from .differ import SPLIT_MARKER TOOL = 'makeotfexe' CMD = ['-t', TOOL] @@ -74,3 +75,56 @@ def test_GDEF_LigatureCaret_bug155(caret_format): actual_ttx = _generate_ttx_dump(actual_path, ['GDEF']) expected_ttx = _get_expected_path(ttx_filename) assert differ([expected_ttx, actual_ttx, '-l', '2']) + + +def test_useMarkFilteringSet_flag_bug196(): + input_filename = "bug196/font.pfa" + feat_filename = "bug196/feat.fea" + actual_path = _get_temp_file_path() + ttx_filename = "bug196.ttx" + runner(CMD + ['-n', '-o', + 'f', '_{}'.format(_get_input_path(input_filename)), + 'ff', '_{}'.format(_get_input_path(feat_filename)), + 'o', '_{}'.format(actual_path)]) + actual_ttx = _generate_ttx_dump(actual_path, ['GSUB']) + expected_ttx = _get_expected_path(ttx_filename) + assert differ([expected_ttx, actual_ttx, '-s', ' Date: Thu, 13 Sep 2018 17:02:17 -0700 Subject: [PATCH 15/26] [runner] Allow capturing error message --- tests/runner.py | 17 +++++++++++++---- tests/runner_test.py | 7 +++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/runner.py b/tests/runner.py index 773ac9dc9..0a7606bdb 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -17,7 +17,7 @@ import sys import tempfile -__version__ = '0.5.4' +__version__ = '0.5.5' logger = logging.getLogger('runner') @@ -38,6 +38,12 @@ def _get_input_dir_path(tool_path): return os.path.abspath(os.path.realpath(input_dir)) +def _get_temp_file_path(): + file_descriptor, path = tempfile.mkstemp() + os.close(file_descriptor) + return path + + def run_tool(opts): """ Runs the tool using the parameters provided. @@ -72,8 +78,7 @@ def run_tool(opts): save_loc = opts.save_path else: # '--save' option was NOT used. Create a temporary file - file_descriptor, save_loc = tempfile.mkstemp() - os.close(file_descriptor) + save_loc = _get_temp_file_path() args.append(save_loc) stderr = None @@ -83,7 +88,7 @@ def run_tool(opts): logger.debug( "About to run the command below\n==>{}<==".format(' '.join(args))) try: - if opts.no_save_path: + if opts.no_save_path and stderr is None: return subprocess.check_call(args, timeout=TIMEOUT) else: output = subprocess.check_output(args, stderr=stderr, @@ -92,6 +97,10 @@ def run_tool(opts): _write_file(save_loc, output) return save_loc except (subprocess.CalledProcessError, OSError) as err: + if stderr: + save_err_loc = _get_temp_file_path() + _write_file(save_err_loc, err.output) + return save_err_loc logger.error(err) raise diff --git a/tests/runner_test.py b/tests/runner_test.py index fcce689bc..5b36f1fe7 100755 --- a/tests/runner_test.py +++ b/tests/runner_test.py @@ -26,3 +26,10 @@ def test_check_tool_unhacked(tool_name): if platform.system() == 'Windows': expected_name += '.exe' assert _check_tool(tool_name) == expected_name + + +def test_capture_error_message(): + output_path = runner(['-t', 'makeotfexe', '-n', '-e']) + with open(output_path, 'rb') as f: + output = f.read() + assert b"[FATAL] Source font file not found: font.ps" in output From 2c4e7ba33381cb96b59af322b808851c6e195027 Mon Sep 17 00:00:00 2001 From: Christopher Chapman Date: Fri, 14 Sep 2018 15:47:57 -0700 Subject: [PATCH 16/26] add Visual Studio Code directory to .gitignore [skip ci] --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 25b266326..6f52a3523 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ dist/* # PyCharm directory .idea/ +# Visual Studio Code directory +.vscode/ + # coverage data # DO NOT use '.coverage*' because that matches '.coveragerc' .coverage From 52bade4db95f2a84ab77684c4c858eabb4be99b2 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Fri, 14 Sep 2018 15:57:01 -0700 Subject: [PATCH 17/26] [runner] Overhaul save options Revised the '-s' option logic, and removed the '-n' and '-r' options. When runner.py was originally developed, its save option was modeled after the way the 'tx' tool handles the command-line arguments. In the meantime, it has become clear that that handling is an exception across the various AFDKO tools, rather than the norm. This resulted in very unwieldy save options as support for running other tools got added overtime. These changes streamline the save option and make its usage significantly more intuitive. --- tests/autohint_test.py | 2 +- tests/buildcff2vf_test.py | 2 +- tests/buildmasterotfs_test.py | 2 +- tests/checkoutlinesufo_test.py | 2 +- tests/comparefamily_test.py | 2 +- tests/detype1_test.py | 2 +- tests/makeinstancesufo_test.py | 2 +- tests/makeotf_test.py | 34 +++---- tests/makeotfexe_test.py | 28 +++--- tests/mergefonts_test.py | 2 +- tests/proofpdf_test.py | 6 +- tests/rotatefont_test.py | 30 ++++-- tests/runner.py | 95 +++++++----------- tests/runner_test.py | 4 +- tests/sfntdiff_test.py | 2 +- tests/sfntedit_test.py | 26 ++--- tests/spot_test.py | 6 +- tests/stemhist_test.py | 2 +- tests/ttfcomponentizer_test.py | 4 +- tests/ttxn_test.py | 2 +- .../SourceCodeVar-Roman_CFF2_subr | Bin 127796 -> 126959 bytes tests/tx_test.py | 90 ++++++++++------- tests/type1_test.py | 2 +- 23 files changed, 180 insertions(+), 167 deletions(-) diff --git a/tests/autohint_test.py b/tests/autohint_test.py index b1efea556..b401a3f8b 100755 --- a/tests/autohint_test.py +++ b/tests/autohint_test.py @@ -101,7 +101,7 @@ def test_basic_hinting(font_filename, opt): diff_mode = ['-m', 'bin'] break - runner(CMD + ['-n', '-f', _get_input_path(font_filename), + runner(CMD + ['-f', _get_input_path(font_filename), '-o', 'o', '_{}'.format(actual_path)] + arg) skip = [] diff --git a/tests/buildcff2vf_test.py b/tests/buildcff2vf_test.py index 3b68e4ebc..55636b4d6 100755 --- a/tests/buildcff2vf_test.py +++ b/tests/buildcff2vf_test.py @@ -39,7 +39,7 @@ def test_cjk_vf(): temp_dir = os.path.join(tempfile.mkdtemp(), 'CJKVar') copytree(input_dir, temp_dir) ds_path = os.path.join(temp_dir, 'CJKVar.designspace') - runner(CMD + ['-n', '-o', 'p', '_{}'.format(ds_path)]) + runner(CMD + ['-o', 'p', '_{}'.format(ds_path)]) actual_path = os.path.join(temp_dir, 'CJKVar.otf') actual_ttx = _generate_ttx_dump(actual_path, ['CFF2', 'HVAR', 'avar', 'fvar']) diff --git a/tests/buildmasterotfs_test.py b/tests/buildmasterotfs_test.py index 6de71c2ec..e9759f7ca 100755 --- a/tests/buildmasterotfs_test.py +++ b/tests/buildmasterotfs_test.py @@ -43,7 +43,7 @@ def test_cjk_var(): temp_dir = os.path.join(tempfile.mkdtemp(), 'CJKVar') copytree(input_dir, temp_dir) ds_path = os.path.join(temp_dir, 'CJKVar.designspace') - runner(CMD + ['-n', '-o', '_{}'.format(ds_path)]) + runner(CMD + ['-o', '_{}'.format(ds_path)]) otf1_path = os.path.join( temp_dir, 'Normal', 'Master_8', 'MasterSet_Kanji-w600.00.otf') diff --git a/tests/checkoutlinesufo_test.py b/tests/checkoutlinesufo_test.py index d85bfe9f5..cbcb00389 100644 --- a/tests/checkoutlinesufo_test.py +++ b/tests/checkoutlinesufo_test.py @@ -70,7 +70,7 @@ def test_remove_tiny_sub_paths_small_contour(): def test_remove_overlap(args, ufo_filename, expct_label): actual_path = os.path.join(tempfile.mkdtemp(), ufo_filename) copytree(_get_input_path(ufo_filename), actual_path) - runner(CMD + ['-n', '-f', actual_path, '-o'] + args) + runner(CMD + ['-f', actual_path, '-o'] + args) expct_filename = '{}-{}'.format(ufo_filename[:-4], expct_label) expected_path = _get_expected_path(expct_filename) assert differ([expected_path, actual_path]) diff --git a/tests/comparefamily_test.py b/tests/comparefamily_test.py index 8eac4e681..09a8bc473 100755 --- a/tests/comparefamily_test.py +++ b/tests/comparefamily_test.py @@ -36,7 +36,7 @@ def _get_temp_file_path(): def test_report(font_family, font_format): input_dir = os.path.join(_get_input_path(font_family), font_format) log_path = _get_temp_file_path() - runner(CMD + ['-n', '-o', 'd', '_{}'.format(input_dir), 'tolerance', '_3', + runner(CMD + ['-o', 'd', '_{}'.format(input_dir), 'tolerance', '_3', 'rm', 'rn', 'rp', 'l', '_{}'.format(log_path)]) expected_path = _get_expected_path('{}_{}.txt'.format( font_family, font_format)) diff --git a/tests/detype1_test.py b/tests/detype1_test.py index 5429d9cce..9d6076b22 100755 --- a/tests/detype1_test.py +++ b/tests/detype1_test.py @@ -31,6 +31,6 @@ def test_exit_unknown_option(arg): def test_run_on_pfa_data(): - actual_path = runner(['-t', TOOL, '-f', 'type1.pfa']) + actual_path = runner(['-t', TOOL, '-s', '-f', 'type1.pfa']) expected_path = _get_expected_path('type1.txt') assert differ([expected_path, actual_path]) diff --git a/tests/makeinstancesufo_test.py b/tests/makeinstancesufo_test.py index d2c24629c..83f463a93 100755 --- a/tests/makeinstancesufo_test.py +++ b/tests/makeinstancesufo_test.py @@ -41,7 +41,7 @@ def teardown_module(module): (['_5', 'a', 'c', 'n'], 'black.ufo', 0), # round only ]) def test_options(args, ufo_filename, num): - runner(['-t', TOOL, '-n', '-o', 'd', + runner(['-t', TOOL, '-o', 'd', '_{}'.format(_get_input_path('font.designspace')), 'i'] + args) if num: expct_filename = '{}{}.ufo'.format(ufo_filename[:-4], num) diff --git a/tests/makeotf_test.py b/tests/makeotf_test.py index 70b4cb6f6..e9ab448be 100755 --- a/tests/makeotf_test.py +++ b/tests/makeotf_test.py @@ -114,9 +114,8 @@ def test_input_formats(arg, input_filename, ttx_filename): if 'gf' in arg: arg.append('_{}'.format(_get_input_path('GOADB.txt'))) actual_path = _get_temp_file_path() - runner(CMD + ['-n', '-o', - 'f', '_{}'.format(_get_input_path(input_filename)), - 'o', '_{}'.format(actual_path)] + arg) + runner(CMD + ['-o', 'f', '_{}'.format(_get_input_path(input_filename)), + 'o', '_{}'.format(actual_path)] + arg) actual_ttx = _generate_ttx_dump(actual_path) expected_ttx = _get_expected_path(ttx_filename) assert differ([expected_ttx, actual_ttx, @@ -150,7 +149,7 @@ def test_path_with_non_ascii_chars_bug222(input_filename): copy2(input_path, temp_path) expected_path = os.path.join(temp_dir, OTF_NAME) assert os.path.exists(expected_path) is False - runner(CMD + ['-n', '-o', 'f', '_{}'.format(temp_path)]) + runner(CMD + ['-o', 'f', '_{}'.format(temp_path)]) assert os.path.isfile(expected_path) @@ -161,7 +160,7 @@ def test_ufo_with_trailing_slash_bug280(input_filename): temp_dir = tempfile.mkdtemp() tmp_ufo_path = os.path.join(temp_dir, input_filename) copytree(ufo_path, tmp_ufo_path) - runner(CMD + ['-n', '-o', 'f', '_{}{}'.format(tmp_ufo_path, os.sep)]) + runner(CMD + ['-o', 'f', '_{}{}'.format(tmp_ufo_path, os.sep)]) expected_path = os.path.join(temp_dir, OTF_NAME) assert os.path.isfile(expected_path) @@ -174,8 +173,8 @@ def test_output_is_folder_only_bug281(input_filename): temp_dir = tempfile.mkdtemp() expected_path = os.path.join(temp_dir, OTF_NAME) assert os.path.exists(expected_path) is False - runner(CMD + ['-n', '-o', 'f', '_{}'.format(input_path), - 'o', '_{}'.format(temp_dir)]) + runner(CMD + ['-o', 'f', '_{}'.format(input_path), + 'o', '_{}'.format(temp_dir)]) assert os.path.isfile(expected_path) @@ -188,7 +187,7 @@ def test_output_is_folder_only_bug281(input_filename): def test_no_postscript_name_bug282(input_filename): # makeotf will fail for both UFO and Type 1 inputs with pytest.raises(subprocess.CalledProcessError) as err: - runner(CMD + ['-n', '-o', 'f', '_{}'.format(input_filename)]) + runner(CMD + ['-o', 'f', '_{}'.format(input_filename)]) assert err.value.returncode == 1 @@ -386,9 +385,8 @@ def test_makeRelativePath_win_only(cur_dir, target_path, result): ]) def test_build_options_cs_cl_bug459(args, input_filename, ttx_filename): actual_path = _get_temp_file_path() - runner(CMD + ['-n', '-o', - 'f', '_{}'.format(_get_input_path(input_filename)), - 'o', '_{}'.format(actual_path)] + args) + runner(CMD + ['-o', 'f', '_{}'.format(_get_input_path(input_filename)), + 'o', '_{}'.format(actual_path)] + args) actual_ttx = _generate_ttx_dump(actual_path, ['cmap']) expected_ttx = _get_expected_path(ttx_filename) assert differ([expected_ttx, actual_ttx, '-s', '{}<==".format(' '.join(args))) try: - if opts.no_save_path and stderr is None: - return subprocess.check_call(args, timeout=TIMEOUT) - else: + if opts.save_path: output = subprocess.check_output(args, stderr=stderr, timeout=TIMEOUT) - if opts.redirect: - _write_file(save_loc, output) - return save_loc + _write_file(opts.save_path, output) + return opts.save_path + else: + return subprocess.check_call(args, timeout=TIMEOUT) except (subprocess.CalledProcessError, OSError) as err: - if stderr: - save_err_loc = _get_temp_file_path() - _write_file(save_err_loc, err.output) - return save_err_loc + if opts.save_path: + _write_file(opts.save_path, err.output) + return opts.save_path logger.error(err) raise @@ -127,18 +112,18 @@ def _check_tool(tool_name): def _check_save_path(path_str): - test_path = os.path.abspath(os.path.realpath(path_str)) + check_path = os.path.abspath(os.path.realpath(path_str)) del_test_file = True try: - if os.path.exists(test_path): + if os.path.exists(check_path): del_test_file = False - open(test_path, 'a').close() + open(check_path, 'a').close() if del_test_file: - os.remove(test_path) + os.remove(check_path) except (IOError, OSError): raise argparse.ArgumentTypeError( - "{} is not a valid path to write to.".format(test_path)) - return test_path + "{} is not a valid path to write to.".format(check_path)) + return check_path def get_options(args): @@ -188,7 +173,7 @@ def get_options(args): nargs='+', metavar='FILE_NAME/PATH', help='names or full paths of the files to provide to the tool\n' - "The files will be sourced from the 'input' folder inside the " + "The files will be sourced from the 'input' folder inside the\n" "'{tool_name}_data' directory, unless the option '--abs-paths' " "is used." ) @@ -200,33 +185,21 @@ def get_options(args): "(instead of deriving them from the tool's name)" ) parser.add_argument( - '-r', - '--redirect', - action='store_true', - help="redirect the tool's output to a file" - ) - parser.add_argument( - '-e', - '--std-error', - action='store_true', - help="capture stderr instead of stdout" - ) - save_parser = parser.add_mutually_exclusive_group() - save_parser.add_argument( '-s', '--save', dest='save_path', + nargs='?', + default=False, type=_check_save_path, - metavar='PATH', - help="path to save the tool's output to\n" + metavar='blank or PATH', + help="path to save the tool's standard output (stdout) to\n" 'The default is to use a temporary location.' ) - save_parser.add_argument( - '-n', - '--no-save', - dest='no_save_path', + parser.add_argument( + '-e', + '--std-error', action='store_true', - help="don't set a path to save the tool's output to" + help="capture stderr instead of stdout" ) options = parser.parse_args(args) @@ -238,6 +211,14 @@ def get_options(args): level = "DEBUG" logging.basicConfig(level=level) + if options.save_path is None: + # runner.py was called with '-s' but the option is NOT followed by + # a command-line argument; this means a temp file must be created. + # When option '-s' is NOT used, the value of options.save_path is False + file_descriptor, temp_path = tempfile.mkstemp() + os.close(file_descriptor) + options.save_path = temp_path + if isinstance(options.tool, tuple): parser.error("'{}' is an unknown command.".format(options.tool[0])) diff --git a/tests/runner_test.py b/tests/runner_test.py index 5b36f1fe7..b669c0202 100755 --- a/tests/runner_test.py +++ b/tests/runner_test.py @@ -12,7 +12,7 @@ def test_bad_tx_cmd(): # Trigger a fatal error from a command line tool, to make sure # it is handled correctly. with pytest.raises(subprocess.CalledProcessError): - runner(['-t', 'tx', '-n', '-o', 'bad_opt']) + runner(['-t', 'tx', '-o', 'bad_opt']) @pytest.mark.parametrize('tool_name', ['not_a_tool']) @@ -29,7 +29,7 @@ def test_check_tool_unhacked(tool_name): def test_capture_error_message(): - output_path = runner(['-t', 'makeotfexe', '-n', '-e']) + output_path = runner(['-t', 'makeotfexe', '-s', '-e']) with open(output_path, 'rb') as f: output = f.read() assert b"[FATAL] Source font file not found: font.ps" in output diff --git a/tests/sfntdiff_test.py b/tests/sfntdiff_test.py index 85d28ac46..fea24f811 100755 --- a/tests/sfntdiff_test.py +++ b/tests/sfntdiff_test.py @@ -32,6 +32,6 @@ def test_diff(args, txt_filename): if args: args.insert(0, '-o') actual_path = runner( - ['-t', TOOL, '-r', '-f', 'regular.otf', 'bold.otf'] + args) + ['-t', TOOL, '-s', '-f', 'regular.otf', 'bold.otf'] + args) expected_path = _get_expected_path(txt_filename) assert differ([expected_path, actual_path, '-l', '1-4']) diff --git a/tests/sfntedit_test.py b/tests/sfntedit_test.py index c82ebdc4d..c0af4aac0 100755 --- a/tests/sfntedit_test.py +++ b/tests/sfntedit_test.py @@ -55,9 +55,8 @@ def _font_has_table(font_path, table_tag): def test_extract_table(): - save_path = _get_temp_file_path() - actual_path = runner(CMD + ['-o', 'x', '_GDEF={}'.format(save_path), - '-f', LIGHT, '-s', save_path]) + actual_path = _get_temp_file_path() + runner(CMD + ['-o', 'x', '_GDEF={}'.format(actual_path), '-f', LIGHT]) expected_path = _get_expected_path('GDEF_light.tb') assert differ([expected_path, actual_path, '-m', 'bin']) @@ -71,22 +70,25 @@ def test_extract_table(): def test_add_table(): - input_path = _get_input_path('GDEF_italic.tb') - assert _font_has_table(_get_input_path(ITALIC), 'GDEF') is False - actual_path = runner(CMD + ['-o', 'a', '_GDEF={}'.format(input_path), - '-f', ITALIC]) + table_path = _get_input_path('GDEF_italic.tb') + font_path = _get_input_path(ITALIC) + actual_path = _get_temp_file_path() + assert _font_has_table(font_path, 'GDEF') is False + runner(CMD + ['-a', '-o', 'a', '_GDEF={}'.format(table_path), + '-f', font_path, actual_path]) expected_path = _get_expected_path('italic_w_GDEF.otf') assert differ([expected_path, actual_path, '-m', 'bin']) is False assert _font_has_table(actual_path, 'GDEF') actual_ttx = _generate_ttx_dump(actual_path) expected_ttx = _generate_ttx_dump(expected_path) - assert differ([expected_ttx, actual_ttx, - '-s', ' L6lmKU7K|@Lr_Ru+7jzl`oot|!GjtjboxX!k9CRko*$g`Oh0cSZ zvpaMi1)Zlr=Q+^15;|8ym#NTY9(0L-F6*F65_HLiE^6qahc4T|q(7KAfyl%QOvZvq z1ej!li3&`Lz+^X=JOYzfVDb}~d;r=RXb+&)K!*bL1$qSN1)#TqJ^}g)=ucp34W>iE zbQqXU0Mi*@Iv-3Uz;r#BCWGmFF#Qe8D46vDGkY*|2eVONHW|!jfms-stpzhtBAA^3 zvo?z4+Qg2FkcGhtHFFTm}i2y3e1baycWzG!TczgUjXx4VE!1)zX9`~!2EaU zItjYYg04%UTX*PY1>FWiw^`6F1-cyvi#}lC1{NM*F$ydufkh}-Tm_4}(7iKsH-YZG zpnH`Fy6=MSEztcGbiV@K??LxB(4B=IM$p3?dh~@JD(Iny9$TTuUg&WMdTxWB4bbx- z^gIJSuR+fT(8~^bxk9fI&?^9X1w*d|&}#+sS_i!np_dqXX`uHI=sgK~$3XAx(EB>{ z{v3Kghu$xs_YctfR}fit0L!jm*$*rSgQXW(js?ppU^xpcmx5(9SjK^6Dp*RvG7l_E z!Ey&!9stV|V0jrV?}6oWu>2k@-$I`l=(863nnB-g&{qw8Peb1~(60~lvxk1}(60>o z)j_{q(60&leGOKQ(0>^8p9uXcpugw}^f$nOxiH{+ur>ngAz&Q});qywBG}9Tn_#e6 z3^q|<>kGCM!FDFt&Ij8_uw4(fNifg_29AJ%lVG3@?83n=2JGU%E(7coU{?rsHDI>~ z>}P}hGO%9__VHk!0rq>r{t*oFgF&ZZ(0y>|A_9k=;9v_5&fqW%9E!nV8#wF-hhyMy z5gcxV!xM0L4Guqo!*4JcV6X`c?g4|XVek+b>;r?x!QiPdcpeN6hrzKhI1L78z+eRo zE`-4~FnBLGnu22=a2y1V9^g0%97DlzDLCeWV@SmIi3N>>)`k+ICTQ29^hmH zPR`&o9Gv{Y=?FMo0H<5v^cbAJ0jHn9>30}n3PWbV(BUw2JPe%%Lz7_W4sa&mTn5hj z!NnY0#(~QOaG4G+3&153T-Jlj7H~-d7YVpFgX;-!Z3EZ4;QA%Fz5zE8fSW0}S%RBA zxVeE_6}Z)bTNAjQ0Jk=9F9G*M;C>F=Z-Dz3;QlqZzXSJ=;4u_Dyuo8McuWS5+2FAZ zJXV88Ja}Y)ha5Z@@azhnF5o!}JafTwKX@Jk&x_#M2A;RU^C5V?1kWGA^CNhfh`_5S zcv*wj5b*K=uLdhluiuhZal4ZJ=F?_=Pz1bkkA z&r9&_0=@@em>CRv1H&s}L@N080>2k9avzM!hS4rC+6_kg!02Hx#tX*wfU&(`?3XaE zJB%L>qVfJP{xwYa8YXsviCbVI2LU%B;0^>DL*N()41&N$2s{dthQlO1OpbubSr9Y` zf-b<61u*4jm>Lh$I>NM0Fzp;ncZBJ4VR{&x z*21ixVRkjl@qszzFjtfV^G3nET`<2Z%s&bXM6mE9EV>Gdzl0@Gu;dLa)xa`OSf+;M z6JYrZSpE{0{|I3NAj}EE${}nggtb7}*AVs=!bK2%3c{~K_s&_Lu6h#U)% zg%J4ztVn{D17PKBSQQGZ@P9h2IwyivH(=F6h#C)3(;#XgM6H0RRS*>oQLzw}3Q^*h^mLE7Kl0pQCA`AK16*5(UuV152E`+bRa~phvgyXt+37=)_KCZqpa`8 zYhjZJV*5i}ABgJ*ac>~*dx%#+d@gKW1e@Q%=AR&8J!~n1Euuf;3M^r;u(2=|4h7f5;dN8D5Yv8Zv?)V=iQ*LxvnO7|6H=qRx;`L+*W0Wq{fm)I&k-1L~)segm5ApxFtUdeAh1rUkU;LAMliUxV%~ z=srMRC&&wiyeE+N4D!{G{}nKHP#}SVA}EZ2B2Oq1LlFZ-g`l?qz33ejCqnVpQ2Yvt z-$O|-l!QXbVklV(CDBk42PK=KL^FcKO@L&H>Pm<|mKpK!XArEqB42K@V;dD4GhQpu1;d^joJsi0MM=ju}1dg7B zV-w-nGdLas$M3-j(Rw&>08XBSQ2%_xY!Jr9N|&`TuOsWJK@rMXd5Jgws>gU25l@{wuj5>;qp1S{0J`p1Xpa}$}qUH z6|VMzs}i_c16NPNwOY8I3)k!6`f0fS3~o@kkqtL$;ieJX8Vk2_;nrceJs585;r3Cu zeI4!`gU{;Wvo`qbHQY6WyY6szBiuazcW=Yp_i)byME7jr-a)uO6du^agCp=oFL-DH zk4)jw40v=39-W0p7vNDFJg$N#mhi+5p18u3U*V}SJnaTg`@vHOcI* zzr!;M&obdzE<7uOFIU2s8{x}j_)-jCYT(Oa_;M>eC-8g)JYNUT6XCfi9iBJASHs~2 zz>Asi;%E5!5WECepn7asNe@Jyd4K`x57JXc=rqZmz%Pe@ zT?w2C81T;*48!49ANaKletiJHz6ZV=@I&E42z>N{j|<@=2fq!6-(JJ-w+W~S+#^Ix zj0O;+XQaayq+>o28HbWiQ%I+kq;r4LnI&DSNtbVlNfj}9PfR`#+L2H*LWdA~jL-*! zz9*(#h-p7!I+U1BBBtTQbTcv45z`uCdVrYTAg0fV>1$&8D>3U!%zTMi88K@hW-p1^ zYhoTu%r6u3d&K-((zOfeI+JwGBV9$`lWtQ;Hx=pjm{`mt77K~R7sTQN>26KBr<3lL zq(>9!Ih6EtB|Vpto(j@4m-Jdhdi_9pdz0QWVrfJyjfrJvVwp=U&yYUmq)#O2lS}$~ zlfEBGzs;oIQDS96tR@gE5wW^P`u8XOqe=e*WPmLhpd$m`h=_G4vA#iULW#{wVmp-B z?j*Kni7iJ429SXp$iP@Ku!IaOCj-xsffvcZcVysuVmE-;jU#qTiQP}cejl+vMC^|c z`{Ts^B(XnD?9UPV3&g&S*k2(ID~UrCafl%fYl*{p;;@l8#FD{|WH3jZdJrca5jp)z zoIa8vK!$W6L*|nq^<>B$GISsrI+YAPOopB&L)*wuta(hFjfrzN;@pQg+Y;v>;yjf& z&mqpsh;uk`jv>zLh;ssQPAATp#PuU_GbV1`h+7ZhW<}f_h?^U68$sOsiCX}1n@rq7 ziQ8i0wvxDsHW0U1;+9CBrt~r>PTQ63A{oA-;zm`OzKG{d6G#} zL}b!zGAWu&l8{MNWYS$S>31^OkxZUVCdZJ;5;D1(Og>2_KOsS#NRTTD8cl*0lc3ck zXbTC_k)Re5^q2&_B~#4Elrdz=S~8`SOgTrUydqQ0$<%pd>IO2kf=slbPMg zOiMD;jm#WRW-cc)W64YvnW-l;o5;-DWadv~CP!v|B*C3YaCZ`HNrDHGU}q9MoCN!m z;9wHGgaof9!3iWdn*?h~a489{C&AZ9@H-MB>PBxE=V2_zxGBqV}_ zY$hS8Bt$_%%K!Kabta*%B-EXRdXi9Y66#Arhm+8eByY zI)j7;lh9BSI-7((C$lQZY&$Z$kj&PT**nSXr(`xy=J+!Adw3XezcF2U+8WhS#<}Mp z;VZPKqiZ-lx+Gy=O>`Y)d$4KS!}d>aqaPwBu-#P_o%tSYa_qszV6}zuP&%IuXKH(n zvO7iN=`lK!x>0Aki?XLg>OVoi$@a|$!6^Tb(YI*a~Z)QPI;49YrFKblH?=xS<5FVbOjE_I}=6XnKS z=l3P3}co&TaBttkk{5YN-*D70(?ZC$=>Yp7Bs%aiA6q;efDhVN{jQ>aj} zKQVoK+nDC6RTiCOUTT?PEHl3M0OKKa1iiOal(NP>EmtknzHMz z#J8}G`SyK9lX2{GoLtJpw!EgXSGI?-jkLag__wR0zV;DSrEV`WOr@3UvdRpj|Jsm^ zI+Ic_DQ2hA!{OV;YSap8fmqLOrCKpJiXM|!E7fcUjpr8797dthS=bb=&Q%wswEfo* zb@ZESDy3S+6xv&K97fq68MD592Rx!H4fa%;SG7i^MD92w-O`|uw$VDZoL$I_?Q3n{ zNPl6;{6<&aqO zM$j?raFwo1k5}ki8=sJ{H>P516tdcw9HoXmL)qaT3!ctu!l#m-Z_TP%#Fa7${TxL* zX{@Ml^RBeI%!(}i+H;JBt#{HPWRv++%uAXB&iaVxaO%Ua*}7^Y7GeyGbmHR8Yq7|i z7?$J|6(vo>@?t~e&ZXL%NGwVXYZRKokU^cvq$eHMRZ z@#3SS&$x={8pg_s`sdK*O_j@vlq&pav^m^zx?Ps1vbbYB&k#gcxG?E?qBeR?u2Wfv zs|d z2oY8NO_-&<^nh73z}ECJWxKqR<)!Y#JF$C^HB&R7cklJog-Q$&TJi1n!Wyj@SHxTy zU}yOlD{dH8@rMBaR#XYj^M~*SS*xHd?rtiQx_%HD^+LQ|4G37rT%{wFn?+Ie=1=99O7RJ7}5VEU~v6>M?-fRbH;rdWjp@n zs1=vQ+fxtxY%p}o&phY67K?R;Zjz#N&J|evbK@TLjG@0qdd^vG(fi_o!w)p#;>-$- zEOCz#WuNUF?e2LBZ5s`jChIlnWQe&+jbWf)cx zf5!cv7_`F^`h>YMs2NWw)4>i;X{*C{BP*(3GMiWvD~1fV>eq-mf+ZX3d2^Dk>i5hh{g|19ZF}aTGG+KMwM<|Y&I+}hmJtoUCEU+Bjv)iMr6EG4yxm?{ zVnAhWhsBA8FnNA{2D=!`%MFpc779{`jc4XMZ4JP?P<@22Ub^vU(ypCLD%WW(I)%_d zEaa-wx8bu6pM<0^L18r52F>krM2=r zl~SS6SoCLmGq;?F2$$-E^Qa-XfympuCHHvzM~C>9@Xr$V9vO3Zyeu!zq7&Pj@>{fG zm4)F)_8JrB($cjbEl3xa>bDdpGHC`I{mC@qII16I(!{03iTW)C=>{8`UBaY^s>>{F z?dT{DwcX*dYIXq4p{%lEy~;wAMcHP0AvOSi%(U zHln}L6-rH6Y#WX+pVO=4t${yKR(yTUIca_!eam)Qyw{gEYuIR*PHQ96w@HffvQp}} zg1@%jaJ?Z^Xxy;Ni8Waq&33{&>Oiq=ac!hNAy35p^4HdE>{WbPM~@U8t~`~oRiu&| zmecHVorTrW@U3Gtxe95%v;ggtJaNUwHhNr9nGvf{rIlk4_6eWg-nm$MJ4HYd-5ZK6JPF*${@JT%`7lpV(+ z-O-Smexz#u37uRgE>+1A8{}HN_u<;gHG(wQC>5tCuG*kbv!--uV$=euM#`iqG}SR0 z8MbPbCGAnmxbw8QYJa^-j>=cf)OfgbtW2w|W3GExnHSJts$)q}5>`;=WP-J6Fx|v< z$j{8I!r!)@Lq@mJ)AE{(ShZZG%*)2@Z4qtCF^s4A;v$8?pGN1ZIgak2-!+{*A!B5D zYMG>1YmsLdNb~UMWLpM_4$+)8x{&*w<~7avPL`+8${6JItE{aqTdu34$7&i+=%h?m zg4JAXz-y`tJ}A9M7sHaMvlgu!J4Y%YyvWH;>R7^ z!&GOfD}Hz%?m=p8UY1lSZ{rM%vzMv07Pa(G->|-{L*O@jpV>1vEDzI2xb3t!tCXu@ zmU!6{Cnm$IuW<27yc~@SQ;~6*GhTtBihy=Rfh4Da1<*#LB4M)Qrk=biLXv;TjsEOuK_A};mf`G)4E!Zh{~v%$y3dBQBg)p_GX1nWthQ~`#KDWqN-d;p^Oo+K9u+6ec3Ku9cF}))+y6c|m;c9Y=ir|&J9mIO z{mZ-l->>@cKkqu;i2vZCrw@1OfSQYWI@X4{G<-OUvx@!V5>ZVX)t^MT4XLYt6GR-C z#UuKV0ZiP8VDgGNJz|;>OBgdh2McAp%X?$P5v3{xi$|CVetu*mlkA5$3iFkpJsJ<4 zM%vCnE!FYb)jD=I3mZ=J!#IChzG3~z>@qF|bu-_PQxJ1jZE+qgf{JyhWX@A|8GBr! zFO9QDx0%i4uC8d)=17HdA@^)kb73mhGsz>rvumT1KcutUaD^0~d;1kf<2t$jrw0bLEu4=Z0aTxtrq{M;Na{9v5 zLldI0XwMZYRfi`0TYUDH*8c{Z{iXF^xJ)D{m49Zl|Cr1E9Q!}kDItPV`R|POC!hVt zI%VqEAm{gVp=9lXX%ckuq)d7ZH=Ised-8-Nt6a*IAke`6P8W!`hiS!lsgI7e|2t=f zxKnqOrA$Wkkug#%{&~Du{_}*~=}E3!CqC%!kF|U)`j|@kC4SiP+_##1MY@!-p=Z;# zt+<6EXy&-Ff*e^ zSvKCQBU)ivCU1O1N2Lnw!ib5)M{hlwbRoSMuL->@M^e5k+j-qa!5S(|EsZPQtWV(j zF-seaAl|yW#?R9wCTvo>$~UucMJ(Ff`SZ{1$T~}%!vHk-MX{>cEp7F+JA2U zCOVQzxCfgX*?CxExF<}yphdXZXlc!zIC;T0^xnCqbI0Ubtt4NhmK){^CYQDoGhCLJ zUD`(HuZ;+womnL=(Pk?(sM%K2$&^oFhu5r1-i`OO>Ih%8G_E;mS8Zgwi9DG)uqH~C zVG8qZqEnYTdSk^6wB7XkXONyY;nd}`^&4JmbMiAw;)}Pa(Teaeo=m-2ljwT-qLhKziYqx~F;Fhx$0 zq)1#MDUuXRii$04(W=0ywa*pmf;8-YbCPAxIvTU6w0XHipSCS8yJT}(t${MXPO>rO z_E4@5KfN@Lvtpbk59)iAY84s;h_=%w?5malCVl>k{7fxp%S2B037ShQc1U*RqFJq0 zS9_)_Xv-q`S@sdkdv7)`r`chl)98U)}P4dVlg0V=`j^>B~6I80gcP zK5A}Fi#!-tNpYVrr%7Fu&i|GaWIWi97gIebI znZtzI5y4BXRCGs`LZh-M)|V<(3Z2@*HsN4iX2L#v+<m!Lk&&%_-Uu&o)@>yP6UpUrY2510?L z`u5V&FRs@gXx7Li=t<=w9)~>2IL=-yY)3qMRF69PCipFKDZ7-LTN+!4a4U0bww-qb zO+1vbJLxdrk*$z2=t`*62urJFaV-tAxhBeneVALaIjg*l9^*^bonSI>PRBXAj)>d$ zW)9DpDvWMCcS@HwT2Nf3Lkn>JTrv5a`C{&>L5O)xOx}$r$DN?;v-vMd;?6PoyYsB@=8;Pw==Uex5rvjg=l*(LP zJFn~5J1v?@VB2(BudPT9U}R9XDa^@v~uw(&|)Sxm*YW!w>3FQBW_ z`KZ!O8_|zvE10YE{mC1q>jHQ5P=A>9oj|QUY{7lL*Ws~kRQn-f#xGdK58=9rs*1PN z(W9sN32f2Eqiatl?Ay6aYhmnr%2((U&0m#k5V#*hk z%-n@O9a8G*7{$UOVF3F@BS|B(bkRK0!W>xSX}zE3PnYWi@9`R!vZ75~f+iNXl8@NF zK8{gCpQecv>bNnh}=Bwou-WZo`zw3MMaw*|=+G)r76sDrq`1<~_&rdKW*dRYcq2&fJ6P8;Et6R3buW$-U%V(2L%$4PV zh_hLQ^+DO5v3hm(Qn^;jAV95_6mv1CsvBk@rQe;u+4xyuvVMzBtdq2Rqk3ry8EfKA z#cXG-)DXawgxRAlek@FGW(Y+6mp}hSR-r(M@ZrLYs&FUat2KPI@b&&vrCWs4fI3=_ zaujc_MP7cn5|s$bs?;_nJ^CUpFfPJHSZ8&FEjh%TikKq&FpUfrzLrMz6Glpkv=+Xu zMvVF6*|0X6xc@-LX;egbi`4Q=A=Ji3a#B>DjWl>^Myf`llL&T|)*{TdB3P_%oFNRi zA{L2oeMLWEm~U5XM74SS*xu8J(MFSNW$GMt4!57?jaTI56k>xdD`)q|3;F2EhqU

_`OD66NgBM(>9`#XjfRhJwSo7UuA_h^7FQRH4n2DHx4H zmM8S?6unWHBPn`t`(Rt6mkU2Ttez}<%~(AU$6CMIMYu73qAKCWAX6hoQOWFDZ7(#r zv3i0)zaBB|9hSr_G~%u@EisKF+UU~b*Os!z8dRmSd|4i11V~4Zd=awMk$rpjRTre@ zW$BZ&N_57#zBGT9JU_Jx2drGvM;Q0eni0adKdzZ6d`(=t(+YJ#Lv!3UC8~Y7Mw(xk zBaHV*E&#P1*G)$4ylZt>`C_?NlarUN%GF5mF|%ylEb<$(Z=Jonme%hoDAbT1^}~(B{-L_(Ca->}S)4=v_RY@K)-6=1+vqZR`kD<( zW1j}*6ms8F{o7R1kN!^2$Tyr&p=@K~;)VqcppA3^gYnLP&;Mavan>@9$yKxlqSD-E zSSu-RM_hl1bHKyX|F(}y8lE1Y6ix>N^omkO-h>ZR@_J8cf{%a?8dQ~OwN znD7*<$jNkt5a`-cn5<&Q2<2pcZAP^aCtE?^8usb3g+LeE>o;j~y$}^#LI1{&D~VMh zy1atEV7JP3d;f~4tv}8CBBEBYas5ezsu5AkVY8XXDJRU(PTbC3sgAB&j7z9XZMPF& zrVevLGqB(M7lo;x48g@u*dQt-)UZN$9z)lwsr-|;^iMn8uEIK}5Ai_zbLchRNKlw7 zKRRTU$q>31vTkl^b1*r93%~s#+|Y~OW7~Au?bC&)_q9NoJmdC<8CdU3*ZAW&T4ax&fzqebi?jtrTLjvF~X8FV$sidYH%3w(P06$ zI4QLFf^ii&wJ&R-$hl`5b-m6T3#*Fy=n#8QSQVoe4I)1?M@9bl|6}|A@tG5P{wzel zjSXQ+%|gn)Mbkq|nf%P1BQfY;d7sS)yI+)q7A`xM8&$bRQrt!-9GZZ``t$RX7bGoA zS+w!++LKZSEzNuxBSpc?MKJMM&b>S-U(EGO-_{WNGsgE88N#wE7Bc&@4t4q&uRkYd zHf9I(#w?9nP5VyYDM}R3`8=^!f*~U2Vz!$=1vb0gJXk395q@dJdbCm;B?|>LmnGRO zd~p&-(`w2^^E0FcYFQmKB}{7blg_1%PWx-i}gy40^xqN12Qk` zvV~-YbBe$Ym?6bbP8``uDLANAwh6uItQW6SGpN~)pS31Bd3t{#lswF*fQ^H zwTz9S8PtWlk+>IYGbq27dsC2B5+5KCyM|LH*SAb!W0>f?VYXE$hqxQ*HJ{q0b3c{F z6{NkTpCx3Mrfx?QL03o|EZ@>)lsD#ns$Tuyo|(O+TreLZs#Ga)twZw12um)J&iQ9H z^6Ma2&+bgC>EEfOLn^&xl-@Ha#`4gYv$+<#;+g>Bv4i=b+DN4auk5_9k--$KiQ)|l zYMC}$t;oyfer6g9yo70<7kCJi=~d`qhF0+B?9$@R`(|PNtitw7AS-mWzJu(|zB(`s zef?8hea_bV8dI5y~t(eW#M>dU&_`~8D$4i_WR5VJgXh$y8Kd6wX{H~ zk!x}a{=$pFMawg{?9nPsaK>N1Swvah&^oWk00&V%vOJ7Ac9ncjWH6=5l?7beW)#?)AD{{NVYe9OrB~ge_vv|5`C7)SbVGn( zmy6Y!ER`}BJ#^cYarqgC#-Z$zRFn&zqFkr3P*i7DqPss6)zv5cf@x=J8bR5EkL5Zc zW$J0^5HgMFQs(4XM|tzmo2&`j`NCD!eDi^{>hg8PaiyC}x0J8jx)PJ!b_%Iv%)Bx; zR9g29W5$0R^LLfRFlC+tFVmahpCL;Zu()~wOh3+d3EUrZe*g5=iA*|og?V1)M20i8 zys7hLdTqrGb~AIXd;!`L11f&P{}z=#C>{bUM+&@@SveU|xR5h9R=-foh{6zGo5Q~$SuaP)*bKiyxLvl zyZr5gdMPyqUs}Y-<@tz`Y7vrCvA;7TwogT`Ics~nmfE*{kl6^zHgJ!(haVY(6FlAC z*T^u4F>Lqoj>T0!YvVOx$73oE&p|hEq)d^ASw-Bz#u><-7uK9XcJvLbj5)t+Ve3R> z*(=QQ9qqtN@(x$b#o4jL7DWr=5|=h8NMdw*q7UG*A$B1U0+DKoY%dNKEb zK5Az~K8mx5InTYPJYnlF^`|thV*No(`@vJN35u>Kamr?;tSup4p$6o3hucVsJbA zSQ!mG5OcmMsC6P{C0}87?oR9IM}MLE_5MV_iS%CAiDO5#0%zH<$9mK) z`WcFsSBCgpnP5>nQxAh(S?oF2_4GTG6Jmp?C{d`7pr;LC5VtlM)TQRhjkwv)3?G7W5i^Dzsf0GrP55D>V-I8W?&dmr zm)^});^hc$2(_O^y98z@tcyuQq(p()OPq>k=b&6us4diLiGVmTw;GNkgKPKMQ$*?z zVn({0V2&ms&rfkzB~#!g6SwV5-66{>P+$@{ribCx zeR%r~JCb!-@WyNH+SG)2wM>d2`iw?vZ)DrR(R|?c6~{wjn{f4Nf2CH9;6+tJT-h46 zI9rXeAQ|G{7X8NrB80BMwDXEad*pWBBklmARH1C?y5@LHg=6kCPB4}Tu`$6r zVfWS$Q5dyNMa+30zGEN}P-J9Qq7Oa_{4KiNjttXvQm zEYV8~rFoJ%6$ozOPOW4(xLy;X7_-+96@KF0GR)<|oUm^SXvrkbmSuvr9S6b=lt!1C1ASg6U zLtDal#Az@5p>6MV?eH?BzsnJSfhHS|3`F3n>~4-e;uiiaJu(iN^7AA8DPmAlKBQod z*fr+2BLkd}DUN?gsa(^ZcEN7pM#%DZ%|~$qiv)1AfE6oM?N)f;(Q%eo{iu!CM%<05 zI5HQ>H!eq-#GYYFjt;PzNI&cnVlwQ6-d`>dg3IsOO}pk+B;eFHkM>8_`&7#hVjDB7 zlec5_??-J+k&y?oIc2dJerJXpTP4WjODnFRJZ@n->65puz-BeaB29Jl=JE%h_RMrW z-fut)nilCmn==*Z)O1IZJsX;-r)9QT&}J2a+?)rIXf!#?sM8M+lva_?l0h;#=07`^Qcur<_M|*C-#6 zQYV1j2@RoW7*6PYd-*-=$gn6wgm{qF~et>EqJ z2Q?8@C(d#2ER-@1rx#o5C=P)q$hac1*W3Ls07Yomol3n2IyD#-BX8lV|1*Kwjv+dPE@KE3H;iEP&X8 zpJT=M(@626d7QPyZXst^qwS>57O5l{dXg1l?C=vne)(*62f_FZKIdaB*P$F@B%h!stOEEDjU(x<1$gqnpj&JFL_?G$w zZM3oF%#Mp1IcGsv22Yu_fOje1RJ<9n$*mb%xkyHKu^mYN_M+RM7xcsQ+27*P7&_3; zSsT{IS)!L?2Bt!*mLc$O(Z-oGqb?0|#hgTo{;%5>`gjM-F)XHOTNC#t?MbOmuIGv< z`el3Oa|0=R7ZcMd_mI(FnoRmIPc990K8Wd=Ou7bRJ(!c6RkB%yCW2PXM$n_rpI$g~ z|NW&AycZwiInm(Gc(r*TNmsR;-|#t#8ZZ-1PY5=6a059$EGi? z&K736=GONh%~cmB=Vi+nW$s@$%cNZ!-|GflDQpeT1h*FU$JXv%YfnV#eO=hW@atnb zFa2X{$=B`3ai;A0bgX}MeUybOjZnx}%Jb0?Q?$!}&l|(ZeJ1+G1Z2j#8#Wz;cY&_l z5IA6de9NwdZFIlD0k{_n8aaK^ta*QMKvnwI^liui);AsOuA^$JS%nwkbAyBTlE>Pd zyL>kk(fsWXBf~z6ZAH?oxal>rJ%>OMtqfB}VKTW~Fh_NWeRTP-Sb&iPwt0vK^T1DR zg9eV^cjsALMz* zK6&u{H*=dOH6Zuua*@ll61g^~NRE+vfij-AN0Tp^b+=;#o%!IlKXRwl9f3O)8Ybhf z+^NN2Dst!X7tb%8NAC2&ysu536OcRC-x-WY_!sV6`o|IOxg(s^^*eopp})B!9Hhx- z;|E}0m^Ima0F&Md#Knd&%*xL~h9N6S3kogzZCj98zGE4xu~Y2# ztTnwu-xj3fjt=bFb@0%-T`O0uUAH`J_qzS*TV?r%zRb6u4abBSySu{wg?H_7PQ7Ov z=@oLBs@;nCzbWwjkL==w&rq4{f$&$V6o6@(5^;zXv zWm#p6D7(yHOAAs9@xvnUq337pST01gnP+zc$rdL3{=hC$HoYn)X;&RH?Vf8N;h?k< zOeo6M$S}L?*z!$>Y9ovKVWFf*mY-Rn(0;NbKipfJV^fZWzSrA(A}mUU(VvURIJlVYAMUI@8o$xZcHTz)Gq&j+F zFW(arsCu#^S2pl&yid}edOxPFhB35*=Vx3U^9}j5o`_KEZ{ZHzX{<;Vvtir?8?;lq+fSrOyn()V&QEt#5 z|Bo9!}>U)~s%xj1TX(u4>!Th>t=Z*&$5->D>m+_H~rpgb0vCvVx;M&%zmsFdyg=)rpl`=T!6P!}HAiRviEjnOv1 zO#H(cHE}40H2gh$D`ERG%tAr|jmyiZsSU^DIr$)0SsVFh`|0e%goenQ*#1LDY=1D| zQ+r%-LPPW9HmZ7-tBSmd<_{0-^3?5B(Ky7q-GYbA1CJGnxF#+@^fqH_@n&2&`v3=t zJtz#)i9gH_s|_#SBGBY8k2}<(mCA*Fkz8LBg-y8**cAQp_NEVc++TIH&=iZ2H>+`; z$a~eRg$?q{Sc19Du%)4NQ}t?mdxKxU?v$W)T-nZOuCtUq#=Ly2Awf*S6K{JZri=Av z$FeSmp0HN=8Iod+L;yw5aEx!(CvIs(&c5_yurFq4U`?bxu{x@a`mt85%W`(Cpd%#3 z!aGr@ued-yaL-(gtd1UT*>EgrH+Hmp>MdNL`A>cOB7fVm@C=!JUcM-&P%BlcKAA!_ zPY29F8d>qiZG0boOz{@H^J$qC_#O^FW+v9)193@qX=X)6weZ%3&Ebd*$12w%VZNY- zd^Y+BU!Srgu60Y}@nO|bajoT>@-05T?ZiE5>hbIy>Cv7}%05!44VVc3s6DRG~OXT zv#828B10y9)sERUf7KpI`0!PGhKAjXz~1Q3?OHK+`&6Y`rO3;a6?}RfB!FNT{rP&ScOsN^V4KgsQ7|5xPpx3nBVStU&?OcA7b zCaY+d*qB-P^>_r5_HM5&-d&PVkY12-_#awwJ=k=1CjIMU)CxGzCw0IdVQuKQ^siNH zC04O@Y`R(|?17p7GSv8!-COx`u^>zMm+cf7`D%i|UTLq^36+0)^%A+vkl*?-Km7PG zX~Ci|@$D9i&fm3zuCKpw5!&>5J=gLJ%JrQ3iDzoV_fOYZe3*#*!eqVfWx@hwUd!^> zpP7o+L;t`Z+FpAKlYDsXfxagl_;bnTGBgu?zinSZ+_&C@Www7CYmb48Tg@3;8QeZz z<%UT*iMXVV9u|^sIxTyG*|Gu5sK0sp)Y0oZi<0uPFu%3FC_O15RkVpo7p{>MGmLT= zwNhGuKymv!$DLksMtFVmnX13}+9RL?^bQ|V61(nH8*LGx`Pf&Aqi%kd4{PHcDf7i7&Gq{6s213Mt5#Du?TPoph; zzu@m;>Lrc2o($zAwLXC+UpE_Y;Lfn)ki00~$83lT{d?`+N7QhLZ|4nzc9SMxnbj z54-RAei`47iQjDA0zGqqkKD$yknld?PnE6Ss%l9bMkqgkKdog zm%%mi?P2(yxPX)Nco#tYnECGl`b@`n-#Od7tkO+vXUZPudMZ_=n{dqi@8$|@)aAz| zE9cSrbL(#8WyvwUO85x2{`Z(Io{oJGm^;b!R4Ge0Jw-(HQ}0WZ&E;%MgfK?L_i%&HY!+9uq$?r6?>1p7eEC?MMQe9%kI))X$uU!2q=Obumn_$F@{*v z)u=JOnQD@`n+wVNox7-cN}k{EdEY z{1yu?-;P=5Y^68)96t2M&$h#brp;z+>T=iQ!& zo$w?>*T;$*-HOMy1C?i9@%1^wg2l{*4Lv`U9eQ9J?~S#iyatAB!+@VADutb4_~UVV zrNHvS3=MFxqQLSR`1=Zv+h+wP8w@vov9=UNlh>pqWk!jjnbN&s_~REFOHl$jiv<^W z|5FL3{BKJ@;iYE7v*oPlVnw3bJRZ>wXg~u>G~{WCZ~;YF4IHCd=qVbqLyPw*#ZvPj z2L7v7ktM%P$5!XeZ^O;RB9xU?5j%1D1-=wK8Sxp>g|RtFdN{mCCMQW&^l(a2bg^F5 z5PTLB)=Fv!=l#)v*(ydxS@MgpDx}f3n@+v?=GM5Z1V9Uo*6gP+(ho0WFNTv%gRvFy za5Y4gVeWQ6b|U!Ilq5|-Tvl`uz|QCr*HaS3-XvTahYjn&gXP%=a^Qsy(UFiP?ix+d0;sfo!I8i0JcV|J)8 zJQ(g6ZN`3td+EANbzC+;l~?H5^!3tr6htL4xj{+EMr(-IltgSGigw0l^ zw4(5}#JGemAwJ#E&@u!%c{mkA;QAgqnhJ@Q8keeys1b6@I_hF}xPWd4dK=2T<1=-+ z@NkUQ<{L*DdbCdL2SZVPT|s3H{NMpcO-xl*RX%k&!6AoHk-J*wiLO=MI^2ds{DYoaICxj5b`lo&WD!RnIw7M|6@IZbPFl%s0&|pgzml2&4rZi&qU^0=c z$#x+9)sPiEmbG|fhu5qZR#T{~C7U8o)a_ONzPx=iA0U_Sy%d{W;$FTZH!!ps!0`i; zWoWe_0vo8(!h;8cioLyqL%h99r1>->IwRVkHblkdq-(SVqQ{1E80z5jgBiHy^}Fhl z#565jhvAG5Sly1zaB|9)iCAf}afFB+GFwWBJ+wJ2j*u;Vf2GwWnHiPPmjD=@tQP{; zR((D##;+Dn{7J|%k#hO-#F~s?d!8qK@hA3q;@GvBI>_%I+#)7x3%-VZ|2*k$2ZWRS zexFJZZ zGXa`2Ok>GX#~d@#&l;-4cF{#>(P?~<|H+67(J|sBn{rqFE1PCU1U!WKni1O}iV4;9 zp1AkXlkwIK^7{wc%JYU~1$5l6tj>&V5RY^=C%Y##Q{Q7v`ou(_$Wv9puPNPLGMB8< zpdPQHM~-A=R|1g^19~EGby2UR#{`_fqgCd_0~OzRtl~&DRso6V)(LvCh0t4MYzFS- z7dF;{*qSTAe744dywn{pdw+K`3dlS0_w@~LN8?OCkrxJWNbux zvP{%uZ(@IPWc9Y`#^k>eTe zCnxDu32=hI5avTAoA^w;T-A{XSNJ1x&1SwjtST$Ke8-WsSU}2qWX_ldc!9p{oxcV#$#iArGD@@rY6z9jq6ecC(lQ3`VVYai)Ylt%_ zjT7C8jKgO7ot@W2b$8?qnHX_+`D>lXX7Od)&SbnvQO(wMCR@j$X|D1e{3i944ng^t zk^rU5k-Et8pu;?!%8RwIWWghWAL9m~1mNhzKJHBRzSvBil0EmWia3y*7z?1CG?{Jf zLV82(9dPWdx=s&A0rVTO2edZu&AMCxHey*_$gD1kzJ_0FYxDbEh}ii*l@dXa5~b37 z_F`Ak#}X3Z?F;hTn_{#5YBMwyuEI{YkIn5$ocjvVS1<41u8$3^Nz5qnz^yl=V@WB( zktP&~gzMx6`M0|#rOC@qi&JU~dZaCxsIXgHZsx$?D*&7dRL)}OhSi2XAFl(?0 zU{Mo)buW^E3%{rGE&gYLcV;x6U)9(`!>WRg<^|&UMRCARuAy>!thdahVU6;q;uiMC zDvQN&prl#@@4{QUJh8%Mk6t9gG{o9>Bazls^n!8Trq+4>wYt1=SCf6I*9cu63|XwC z8|fnwHg+TD&@0F(D>L6nJZi2VN@j&Gz&lQ{WxT_V*y8g!>$Oy9XK6 z6D3V;XqoSRF}Oe&xGmKDi(+%M<*)Gg8!pl_v5O-hN{&yTXJR*+G6g;`Iss*9q3 zxC1qDQVJ^GxhGls*P;z??RF3x4Jg_j{;JbQO3|8o65*f5`u8H%tWPg8l%%n_y@>0m zcj+0|6-VPT4eGR5;aa%ZTApMa2NpT3;9sDz*{CZoW2ZtdrBA%oi;N*@IlWE(3VnN% zO`_q0dXr_7(EvV;Eh97qK}Rz*Xn=*_DG*()gFy{GJ8^HMxQB^ebVImWps)S*J(GGv zIw4V*ozm)1)C4E-6XUV)nBw0TmpTt4qLS zg7YE$$#621fx}Q}B-y_HWL)Q$q1ETzGzBaeR}S?jE@Ty>14w{+9n@qzKQXP$P0vTt zhti1LAgHg`QF$+%q*Z3T6xVVDELmLh$oDf{dv+vg8e($u{NYjI{GJ#RO?;atgah`~ z?XgDQcF0K_o9?xAl);=OP#(*Krm($)^R3av;=*qYnNi{;Qb(SStp@7qs>cN+X~8*M zUT{ABG&(U}DdUx%=P#v4Q}b{|BhippxokC*N-L}FS|I{kG% zzmfMY@IJW|ZoR2#@C|O1dtaC5i)~eb_s(k=ex`)-D9K6?4$`?NR$w&BqgrqZTP`=d zR^nc|2Rp(ye9oj8;X+ybrW~dz*z=k$4_)&MJ}Td@1bRSj`{rPEOwOLyqKi|JYNe34 z7PIAUz)9(;T)doPIy|}-)pEuTB#S$*2e?V+Y1gy z5J+WeRt%%&U5s~p8NzA(TioY@a16Rj!$K7{0oM@9}Mi^bo-p~REsP(EE+_{uC^&K?aVedoSO1LW+a)HephhmqGy z3v+|6$)t+Dy5}|2NdU*Kl|SoYey}JQc0?YpW5-r#iYj)XDPZHz0VQD?TRMzn!(D`Z zJd6aBYs_IdnbG?Tnq8Psnw*lThp5H|LTpaI_N$Yc+0o%-AX2?GoNOUqurYQfDi0?+ zvZM106neJn#=#-gQYLG*L%Qwk5fa#-RlZ%!1vw=5HNvGV4WvABN7*UgfAc8Dfm*5DQuk9mzE%M=_iYaB%aAT-90CiBG#v)Hf19Zt$DYBU){ zrm_9v&wcj#Xfl};vQ{J#dxUvoh=8@R%rRtXJCXVU4wOb2OBUc|K4VQw?W(b4dS|RZ zym@qmOOZF`z@NsFUU)4XhZz_z7&Z>`>wUI%92qN4V{mF!NM&zXlZ2f><<`Ixey75! zGQ^~Lc^tXGqg&zz)hE=X90hNXa*Pv-G zTvC^)i=bp5+|obzNQpbtm8%?BsPNlu8G)KowLet{w}So1{BJLj*;5lJPoN*1cD){W z0&kxT8{=g8`}&0+%Y*9|PU3^n!{pmjcz@C8I?!d&hTFdNf~JRgPb4;G8DJ)2852qO zL1>BFAITz}j2CQw3(w+`Ui`Q1cEt|mkvAujf%AdiG1-Eo?>IKxsqrxSwBQi9WR(A1 zP9X4IaYe=zU=5+t$DuYq0n_}=?@Qc;#gdJlL^6e%N5x*9M55r(!RAdSllzD(8orud z#FmyuQg^rl(L%~Y=!Yz0GRYDRHhc;R5PwUin3i6zOd(6g3Lm?StgQ4T96km#co(@06D*;KZeo0ujLDr}WK z>DPH6ZCNK;m}e<5rd++O}tnW@*$_KcOaxR`dD!;<6OYizvka~HV9tcYE3 zPlXCI^dh{%%aRz$Oo>Uo1{#oC3W`*?lwwtaFdI3*Rz-{%)p5 zq*`~-Nu0_!6{%pfc9tIIgeV}3>C$((L77p|L1OjRBwa_RI7RtbEJ)A{mLBER&17?$P zFx|Ec-~^2UIps8)jP0cO2}v_VM`4+`&{et6(w{$%&VoeOW)or4U~~={JAW#bPv3{q zE4hl6=I51Fgy#l_gh%-W7DN^&q(l1v>*P=?J1qgLTX0+m0-UgpwFU%#qX1plo zxhJ(|Z}iXeSFmgU?wV4k@Qvk7#toU#DSQ@lor^sJT1t5Bs>O=w<@94KdAsbe=~|-3$^b=~i}lTC5w6j4QLlcZ(*wDb`7roSeP= z9@Kx@0`Q{3j}qO>(Xf9vkhmLTc5PT3mzk8DlB_O?VWZ{|;iJcv%_BR_`%?oB>*tX{ z=4Yr5hY#kF$us)Ei!?JTCoC&W$H0D9EGqPAH)%4iGCEVsSL=^me0BS=_3L)Ht=~}R zc1cqxys6?1Y$a&2yTJU8?i6BN2hhhxRx=+XcM%vIrE8TS%0vslKc6gtw&Zl_7(Qy9 z$1m~#|Jvx{%;;ElXj6f=po5Z<*sKL)*yJgcyBODNppXUup`rTtYw7U1Oi9cM%??AQ zy;i+@iy=EKB{3Q-98mt8Gx*oXixL$rAR~l_`z7gIT$aFyF!*^0j|yhDkPPfRMqppg zWko1=HZLTemO?ZCta87U^_fu;XLlDuY~f+EMPzV0v4I`22yS{X39)61Fg2= z671E{YK8DOF;)7MEqa+O5O_D1@-pew6`OimF>n*M{O$DZ_tL>i zlr8#Ds^~-i1)5v1S-}!z!xUadX0AhSbjhi z0==torb(naju!I4Yn<%Ino7 zg3jhX`~pUvk!J$81CEQ-7)58qG|PxJ^iJGGdYB#R@E2~We$zQ%lbO+*{uh+2@lT(B zMm5z>_2l_~U}1Gr09RiLG*{av{{z?6lQ+m3KD2aC;4xI}KQqQYeTxU@)Q16ua~9gE?!cl>8Y z7!Oku_;-Q^8`XOI$t)4^55WBySx=^@ zJev9)DBb^_2)=EWiTFo)R5orE=}JuO@GuU8OSmoFwP!E>D_i{Z|Hu~qbSC@%NS}%+ zdox5(1LfPK8(@%wBJNu-!srv>;qdK>h1KPw1R0$^tSXj87sFlrBpo%i8r0zFTI`k7 z*kgRhtqqY82Y_xmcIFJ0dN6b+>2d}4t?jOC7O0pMPOK)jT@?D(T^g|MY9OHQttNdI zNO|;d<=9WKeuCc&AdUw9GaWneFg!8RV?wGGhn;Wuz?39GWB2K))8{gDd9hh3iBV-R z2LtV9C~-%WgN19Lx|gmopEYE_6Iwxd13q1_{FR`+BZ>=KITjE9#P8RAfY|u`JBB~e zu+7Sb#c?gMfqC_RB+2fheqNwYk0|(4GvH5mN~fsN{!XjCu{+(#eam+=+QVnYo=<4C z=Z~m#pY}BmnJGZt#^b^{>KpdBS%xj>MgXQV6w#6Bq}(x02jK-eT2u zF3I%SS;s!&6zQ+9W$Q4_g;43LCI1mGHhcPu?}&?y%Ec$YlDqN=Gw}(twoi<(;y+ON zFTY511^F=J2a%{Pdln)=lalPoFWzMAX32k|vbxDk{4xDr6vudhxOYyu`1BXI&LPAF zZRy$?e8*_#biZL*`3|T1fg^2{#(;r7g;hW7HVj(sibPUBk47X{i!CP;sTCrK>!_@m|9; z)OD)VjY{KL<9gEPrz#6(@d#r!!-UI7Cqe8zfS2JB{N%z z$dBVakwBgxiH{=*dJ@aUOPq|B$eI*D=kczN_oNOengwzsa-&!E{XIdczVaP_biK|k_;{A^IDqNLHHYkrFd78)wpMXbmr7f&@BUTkscXl3sNjG+TBkb3xeJPas z*HyTRjQiK6qpVURZJ1W!>R*RyMiolq#o&-9wAz7Q0Rds^73gRL&4Zv8U2D+`obLP8rkdKd z)lL)r~7y{x=t;cq^IaReziR-Tury} zkmEf+@r7(akVdi}Hj}|>w7*hiMtkJXuNDp5!SoX34+2Zn*VF9b$rR}|YP1u5q;&hR*N;_jSA{28dDscEf@6 zoPjTrwr=THD+V3%EQ-x@U7z+`|2olt6|NPoPkL}JY7nEmw<8&7jt;_ivn7sXr0tXP zJ}Yge$mCj)A0l0321is1fA2|#+P;O3+17+g6_qNDi2RD%sJ>?{ENHEjWn-O4FBN3^MoX!hwmdS!FC_gYCt@=t zi^}64$y0<80UP_@pPX4q8p^*B0`&De(p@1~AkLib<42L8-?PI`*tB(HZ{g2qkp5$Q zz24Gw20Dn4WvTpAap^7u=T_-!j8}X?Tt~Eg6;r|tX)6+lTs5%0TZ!$9VvK!_G8pZUQhbmVY$XG` zV7)%xD2gLq&sralUhGp`H$xqL%Q|i&L#Ka>tchWX3NS;-MH8DDAyXhsW^mt@yLTJy z+cG1%YZeBqJl^TPsra7TNME)1^7oJ;sBDpMlW;QCHw8XWd4w;;6pDEXFO}}1uF#eZ z(?nfChR!hJ1E?&BrtuBa@M39>5KB+mLR6R0UK)&%EIO$RW?@sWkrq;ZhPJSF&ZOIn zS$Hqrr}PqKEW>c#)|hxfTh{QBwtST!U&u;V(pW&;Kas6cC~MeGtkngmIOI~97$B3|<_00b zMAw3l$`k!ubWrg&(;Qoi-uVsns}-WX$+#A)F5?<1{f>xLEsx}%EpQ~2wLEGmv%n3I z8vIU;f3`eo{Zrid{b96&oDe0p{#NLdi9?YIShaL&_u z*&=4{gkcHYK58eK(cO|Nq2~CXEmQWL-`9kWt7SKKlG#rZ3~oyxEohm)kW-POEKe$+ zf{#gBPSw%M7R7rPS>6s#vFySwlGz1YIKHT*=kb-oeVw`NCRQrwg2X;&vD9bx8%NgR zYTRy<(X)Ct89x|0GWoCwLD#;;7?Yc#Y8@^aajkW@xpYwuEZ!%ShdFMrf9>wYX1I|R z>Z#8^M@SyoPb$gL=PTN6ZO6>iW(j8LX4z)N7M2$KEN-`-(SC0GdmUzV*x&KYu4Y}`x+Ztc>$<;dP1lQEKj`}53oBmO_=2n& ztD35EQ5C70U+nnewiheA&FXfnTW$B}y07Y9)1$^x?O<8fv$$8^UQNAz>h)XiLA^Ki zcIsWz`%$06)}5_iwBBo7Z++hS)xN9x)!DYQb+!Gp|L*<=`yU(d)qtM|{5G&=;3tF9 z2b&G=(4Zvwv*ixa{$k;}?xDA73;6{`jxP|1zGBZ<*lr(%6Yz zCN7+~a^mTUmnV&x+$(xy*=x_*&cI7&C$)BGk3w<%z4Y^t)91G-uv^D7R+4m)55%kcNZlrp0@bV zV)e(1e|dTE%a>lhvSh-N9ZUXPYPK|DS-)jD%idb{-LgNIPhbAQ3jY;1R{XYdc};n)v$7`+D_E}rF_M>&n*PU4R%DSuTm#jaqVZerY8AjJg>1X&JkEKN^K$0{&VRZ%xYW9wc4^*DwolwXZM$Ln>pS}G z@ZJ%!S=BB>p_KDl~ZqlBKd)Dpo-*b3R{hsgL2e^-PpW(jT zeT#dTdxCq0d!hU5?#8_x_P(@t`(CfT`FjuTecPjh$4rk+9-$s79>pH-czodT=e|Ds z2JhRvZ_B>0eMk45-1n*Hi=GQSgFQ8#NuCDJ*F5iee(uS=p7-kHHP~yGmxot`SFBfx z*KxJiJ6?CZzVQ0ayN9=p_abj+?*Q)zZ;f|?cZzqmcZ2sO@2lSLdf)MueJnsCGSFv% z&nh2BpPfGbK2bh8pA?^?KDT@x`V!ynzC(Pc_|EWM?d#*4?t9$#mhZQ|KlwfH*WGWh z-x$ByeoOq^{B(Y0eh2;P{BHO?@cZ8XIe&Bip8o3o{xkg7`aAju`ltKn`XBZ`?tj7m zhW`itpZI_0F9oy<=n~K^z$(Bxpnt&BfVBY*0p0;&0fvCefa-vw0j~$V9q>&c3G5VT z8E6}57dR(yW8l6(U0{CTiNN!LR|9VcJ`DUS@Ry+Hf;tEF2w?^a zynLWg3ho>{Ab4`{vS8=nfZ*uh7nyNmxQhk-4wblbXVxUP~XtN(9qDRP<47}Y3Rw&S3}}%ZPyyV&V`Q($L6IXO$4AbIToSo9(lOFCa$jU% zWK?8)WO^ivERL* zsD4ocqsB$ej9M1u5akvX7^RDfkIIVLA9XzHeAKn5yHTG;eHrzOnyA%X)z<3a>WS*P z>XquXYG?I6b*NgSPE=>85$HvINPS#=M%|>otbS8{Q~j>`j{1T6Q}tKs@6;`HcP-I&(7vFx()QC1)DF{*(vH_o)=t;X(Js_3)vnU6*E(poX)Kn|yV}pR-)kk^^SaJDm9B@bQ!m~q2Nd{dim(*ddXZ!h z1i{d%@+PCnayHAGh&UTe>x~%;e=m3whn{s*58Kmz*nCy$o0K1xJq?kd;9+BY$N-ff z-mTm2Sg}?FS%ndmx%iL?v=>bnnX2&YvmzhTf0%%2dIA(C=1=#gTcHZ&K2)A*3gy0m zpH`RcJCE;u?nA)2&${@U>?wA>@PNaNyBHz3;g_?=m&|K(#XjO|@@RMiv9w3-hFiCY zilh-yktRUvBcdWnZ&Q6NsHiiN6E%zhb#pmg3&){eeq^Y4NQz`iwT5ViKtvJO3N{!v^=K`;%#ujEs0$9kHt-s0f zXSzRG*a4`eX^J~^yg!`l-(!dTiHNGgzV;{UND7;YpycAzA%H9)C9FIEG)=-n4(jEe zFT6etQA?#2(n=Ep)&C-uS z$8rNvhmQlu@X3f75S|ej48;8^>g40KMgubi+-B8fAbMBXH0%jG$lz-ZC$^SSx2Q6` z3I%FXuVYPtWO}D5^dbLl<0pb+nY9lhF9{c+*>Y2lTXWeJe+pmcZft5WHge18r6S3f@(<)f z$%n>X#mz9>qM)U7y?2wPT8HEY z9m~!}a*aV_>*6AL;5#enx=|+@fgGXRjfBJ|FI+p45sJMOJ z=V=CVGx5e4LzHbWA1!&(+C%uF>q(TZR$4))^AnU0-@FSqT*ZxAal;iiJ`^{;*TgR)POTq_^gJQ=G8_9pA)IU*_oCs{BDlYm+BJ7#K_Y}Xa z%@=HHtSpQS9Ql-NUkOB|yl-SyIC6U#KJ0%FFxw3H$=-0pitI@BdXP?{=>K*l>P5eVQP5t z%Rd|@?)iZ)Zk-rUJ%90|)~7^26#p7U*%Zb}`INLs|!4ng^j${1*al+rJWUFQvm}O$K3%wNf=<#C^Py9XMCX9IEKk^w;0}2EAWVU)gL+}^+hKP`t70&M=KE$f+?_`HJO;95ErAONcqPV0?F#hw?*%cHh$ej=(WK)9c_gAq#{+DU3Z9fZ zLME3SzkCf*TM%C$Rn>>LA9qIX6O)@CmKpsl%=A{&?E^`*`LoD8RM?KMu1qW4EghuZ zN(kx0Y(+G&>6=g8BXUCy2h>FzkIL~p4JY^k!l%tbxIwbP8sa%9H^`F;59-R|l8VZZ z5?`N?U|+xD-~+lm2@s3Sv02*fO3##cL@k*CYfhdmS0S@8bd0VfgJARS?+ z;JuS_GA&lbI%czD$R?B5VqOe6YOY{G+0s}z1omMGv1Be*8*j#v-FUTO(r*j!B}2q- zQ|uQhv~dp_&fPy8Q5jvJ&5tM-4kEUEuXLD&9^BSUC!e2)dV?A5)E3#w?aCB{#f&L) z1A5|799cS5G?{JaY=ipreDK&66(v*wR-_l05Af%~wfQ)G%+1{@<>$v@Qcoz`B`l~) zq+YLhVm(Dmr5;M4=`d)@npofT{J_J zjSBs5!nC$m!n8{EY;FRv8PQD7w=7w}KlW$>f91S}8PIjMkd~UwA5G`I5fQXzBUrBcickz z1|*V~Y_1EdX5Blt0rOKAXNQJWBbbxQc5&K?WdanyUQZ-LCkj`#S!s3ixmn@9ltgv0 z22?j_3ItXuEj@H7sMOOdD9F>ZG^k2lWF+tz%?UAfW&M*#e=90_$s`1NNWfZ##M1`#R~ z#XFL#DT>Q#rkhGm`@NydO9rdY6VTNhJ?W{QPp3w%-#R`aJq@mgf;kMO9m^rTbkGGE zlJ!P2s?!RLr(^?u4)HCkEU=oIQ7x{fB;o3#3Mjy>9`aoqKdW#NjZ396Ibn${(zA6<<$ z^GGGxCfCb$X=JuF99==^-;`&`_k0GpUUPNWwQDy zjab6B5k;7(+q8QsM6DkD0)T7^X+Mg??GK(^^y8E=;ef1H9jUjj-=CBsb)xEGOmP51 z`dj-)hit*6a?0l_Zp$C1Accs}BNCT^F`yHTE*ABuBvyxP!KHF|l}YcJyvp>?^O-Cr zogD3MTt?AGDsxzq^8Ye5cK_?t2%KtmD8^fG2AR}JI4j#6jfyTd&S$4G$Pi`G&K_it zY052IX)vG|X>33yz`f{F(=*AYwS6HK;%FUKo0yVnm((J}5{hs2`KGI=1pYj4KDMd~ z3$rV7^9Q{7$_WpzMyD%Pjwd{TI^xgExC?ZjDX~04Qbin;{+^e&A6&}x83uT8qU?Gg zk+GxrTaw=40PCk}1N3SE#mrCt3uEsPt06Q4(}dOkH4mi{TVZ$OuzycSDYjpRHybBT zDE=>_z+muXEbh;uvPpaTPvq`SKhnD<^bo@u^8YocFV;6a6Yqg@E%@G9ryLR^5S-Fg zSz2~wkXys5$H$yt=Kx$1VcEwFKSzI2#_I##%LrbB7XBN$%rA7*tK-B_&65pFIoWa> z9ikvyI(m z@DWD3KbVQAU_mZfW({7046re!(d*}GZk!V6_cUErM5Y>Xk63jsv1=DLlz1T0H&Kr*CUA;k+V11$ulCT! zWdX~WDSb@7nEPqqa0 z@u7#rik2mn5F4?W`t#RuL}K?!NZ*c>rlTzqq<0u8CEeA-DSTRW=^UZlX4S7r)&ugV zgn@9ll8}DR6b9lDnC5^~qn}X+L-}^Ng>TXA+r3tV`bg487a>6H+I`1g(P;{k^f{sF zI%QYpphLo4Ad9{r4EUTiye+d!;SR6)osQ;wBK>l3pgrD5!aa$-f4 zzyWif1rGR2^da;eAWsfldM62co$T=N$~0A)?YgW(4uS&QSwzfQ3Yuc52FKKi9Lby`Fv>DLW%=5krp zi3T0oF;k7ug1@pOl_qW3`<299qbC)t>v*NQ5E1>}1_iZkSKO8i~Mjm0MV*KEX?1A{R_>F-TzE;W6i68dQD?<4v`i8fFV75+x^|tSPfv2 zSaX4Bz?$nHm%7JipqEr1BC{;FQ=gBvf9!aB?XINcOtmgQJ6uSLKMs+BJzyUM(n{)z zC?AOJVWQ+?6RWY#TE`r#N#C((mDa`e^R@X{t?@m)ARKmwD!O+w!tx@hNd=vB&h};?B`;L7n-gxUU5nN)d-4Wu1WkQj!XRd>Q!=&kA zP1J78_Xz1XUVt~NK*ga3eagw>rR9|w8jMZw!sw-$h%2(m_jGJlxhs&Xar@9kunS=4 zj*w~NtLXZ@_3yn^f4Z@UxzSOqy%j zKY~jrv{MBAhe%*U|2L7qP^j6*$Y@h9@;*j-qgcD#J)-wS7ioaDN&*o*KE(=-ktIEw zX;^tp)H!`za!PD=h6WTvA``b*%Q0g6H27AZ7a!AyWBH3INdk-@BI2HAOOKPKP{d^) zCr)#kX-Gv?FHxlGo;4GO+@ner=1^@n_(|J0*@;F|FXjZzsBF_siVe|4ohJDD$ zN=iV45V5*fq8I1i)#h${A05lCj!a%uMZda^Wq&+u_+KqKQaJ`r(%{F%4(De&X5tZF zu``yoihxP|)3utSdvqsc4*1!MXcZvEo52Yt3$*jV`*jn zI)R~i>lF4%YcU(JmQ$udHuf|b*`^)YdYX*rvw_xJ*!M1C1k9$0$?0^dl8kniL` z3`u8p=M0(N^9Ge4%bOQ-uj0J|L|e0|O*#!f3qGPf?6tEdrIGC`I9!bt#{TP_3XUW_&+|?!}%qCX_-;6-E7}O*GaZqR7}}?@89@gf+w0PEJjW6%;Yo z4(+%Reh}5i>>5a-3CmsIfYl(fHM5b}v`xI*8p((yZkSdK>QqpHD|8uC1zpA{gBo-h zx;#Z9|NKr$QicZo`sevoM~0;&VM_TB3coLTEd|rW*eZ9hb&9}Rth$lB1o{MdaqSWj zdWxyek9G=wcU2h5$)@J{CsZdDvyO3#s*=m7OQSDcuU2);OISoI2nCHvtV zDKuAtle5(GF!k(YC(oOR6uvtT9~``U%mvcRO8Sl3A+r+5jYZ6Cg~|r%?<7_C*MWh=5tDL zlSb`7zEZ@!FYpzpklYHmT@jSb&*((5Yfq^_PA-c ziCDw&h=dW7Be_!^&b2oXhhW^ISEiS{?!4h&YuwC!xrli=m(6;WSg%D~z>zmWUI-cI z+d3GH0_{sj?i5jed?o7U;!XMDVqL!LHA6)0QV0c%HEegJ{WK>li{)suqSZQWwA!F$ zw)_JBDJk_IDV_(~U@yvh@aMjQ1e+p1_m$iO|DIEth(E_qvLmmO^>f7faO8DU7IwA# z9B@*gd>v{wK->4l+v~q_c^6m}ezxqbviJ9YaAfVYfJ`DHSt9oU%IgUe(Fwd?_3)_U#tQ2d?BFc ziv&GihSo$in63fU;FQ`rpK^A(DS**XXIgNg(A$oLaYQMDRa0&rr0#o3O%st z7(lV9s*Hk~eD?I(5D&1~r#WO`Sj#qr);y;KNh5JY6Wfj~h6v5fqW$l9S8dXMC-x;$ZCD9cIB z$cr-wLP%i>f!xnmd}9g`B%$-!B7B7Dy+a8+mY|z1pa$Fd+{n6 zu~-nNSiqVt{`Ubd4@8Sz*ilX9t|z{#HEr zDU;Gt!BmK;dppxzC3b@`%v3xD!ug+|rHC!WUzXkjtA9cjyK$BDH`&qSHm4>C%53)g zRWjfoBH2BZ-o~7+lg6^)*8~+o3tMwd84fJ;8d*9*46cxqjR*mk4yq+p;+mq%4!&vPK3Rjmip*ozZxGu~%1-`*!S^(b z8Nc2jb{3*8k^HZbqz3#ACLKK5H9lw6Whi3k4b$5X+#o}G@>vw7bd5S15{((Ma+oe# zZOda>!A;V8J(%Ex9yGoJtW_$tFJ`emK7J8XpfKk#Vw05rU+M<&$Q(BD7IB({CCh)S zyFfuRZ;{Degz@NU5N`I~Ei$HkbV=Y*@HaAxx5)5OZ6}~CyoP*kKm}dq#cSkZ&kF|i zp-nm_RC$g+>l5>Zd`o?cjJ9tqJAMHjR#T);2s)xL|8Gg#zY`*Zdd2CYf_HgAg^gJN zTfhC(F>v=L<4d&ET|xb^hPTMTc4!9n^;@Lxw1@mcZVztg7}aH=CFXTd`chJag()RB2Qx zmT7NDRV{C{RF%0Ec?KQ>n;`tS=Sw#E;CBHFN07&>m~h&$qwl~oTHvAplu1T@LH|@m z*Lh%rSa1ft_ zAV0bC9)^SkJ#;AU7}`8hup7rI$akS(j((5KvTvY(AX)+ckfAG8*(O{|jT3bLOV_XT za}X7ZC=6N3Ui2j=0U!c6LI5TdFdSR{KAFSDzfZb%F)ato_(>rRS?c?wcR%>u1K(u{ z=NIE>WZhQrB}!eIka==BhU{zalTqd{h@&X{eKHe8G8{?P3r-z2=L2jGL?Dve@B&7=nNl44_%;YJHb5OM~bUTCCf zeOxxQZK*9j30Q21coOY7vZs&J6rgvW{gCXo-f03Y39!xq00oT%IKeDwVVN74#yszl zsdKTUEty?5fB!sg-tv4}EcP7=qR?n3Pxx0F3uAYl=U*pqD0ecV(_&I%r6pKu-Xpy` zArSij`lcaLSW@VHGPup*W;_nna1;xREQf)*(iyf8-S)pwnH}Nd3x3cbq?L}jHS?#e zXU#PHK!!FiAfntz>AA8~dH(r+gS zS-Y&BCAX_`Oi3#A#+F}Y+j1CYWK2V<_SnF_3K0t6O*3S971i-K5D`jJQ?~m7#-RD) z+QpaxhQahBj5|RXBIs)vKge7&s2!m_xqs#8<#YN(5nwf0FSK5^BGirVY50}6?f{#;$_hUM zHB}gXR0>eq6?H2Bk3fd9^B<7`%dv1zPlVDlUuA%T5Gw;8WjOg z!^KcPKUpXa%;nYXKh~EED|os4B)zRiqWS4WO%V*{no#FNTMxZ?L`8Td8cwV9?Kt#p z;}+f=0qvzT<(0e$kdZos~Hmb{1ZNDrGNY)BY(~kSz0X|=V_yrMwc(xb^qLbk; zP#gwY#ARlv%;%q;jgRY9kRULU%ah{`c9^>a$F$RZEQS;qDnFnt^oF|$#Vj7P6S@TZ zlohu)-OV0|?27S)%-UlTzboAp<6FVXH`)vR{3%!&?zD6T?EyBC1_M~yQdF^8Z5+yu ze+bB_vo&s}b3oq?wFD+9H2jKpP>*1&#)O9%_;6K4eVtdu-o0LaJGNK(9Y)-n^f(|K z0jWjz!Y7#5r=*wq?@*p*f)UJ0(gGgeR@5=5wKfocTQ|iYvF)&)wP@MEgiH{BB_gc3 zs{gAiK1vdi98#|(WQsz|U6bYK;Es)Dqx&S}9tvwntrS(F`76eD&NPv|@EN>ifU4cA z3Ev%`8M$AFZK~L)W~ginzmm5XdbP!8oVxL|0$*qj{xH<0+&9~r^6=6$P*PKx_H!~qjqjh$-M1O+OL5wK1Wd%*cvCZg zo`6d$_|D0Ef@vOomj#KAu;FcaSHMY^cLlA2#jX@pLCJmycDM@Js%(p{#J^a2EOGxU_UiDGAkTsPXQQ^69@9v#SpFAqMVDH3)} zsBge9@7@tqe|?w9eci64#lnjw75wE3>9_$)z2pJYs@4~HXNT^*9#(}7wEprXD5Oi= zi#(+|dbfs^eL;GFV%UNY`{7M)`T4pFBl9z3)GQUTSfVMs7a~I85S6G`r3C=zhsJ!9 zYaI5xk&;lk6*c4?79c3(Fdpy=|EG9mX(a8XH&FsiuIaoz0>1b((?jrX7h1+d;q#@6 zPZk4QWxdZ5ldY$;PmNVvVk+tx;;~PX9@Z%>jPJsy$=q3?wSpBSH9UB`v%q+hcEy@S|4v@fO;G$nwDB&`B>pycVD4)31u9sN@aDf^-Z4Q~=xl z6^u|yQvmXDvB1~6p_zI+Zw+08W$U~2wCl ztZ;Nn#frTQT>~2t;awl8$<)BRK07;4IOGc#{m3U1ah~w#f9kZa`1qTNOHB6_wEvi@ zvF!m^z%n;8TXDWOp#e16wg_v2=wWyIsQj$z`1R%>W2D@Un(rOozb8-m`9w@atho|r9YSita_}$AvD7C+Ik1viqQ9hBus}Rpt=^1BmDrZ)=~~dJ=|yZy!BvNS z?%4|>=utBeJb#Jd@(Q z$Qp)eLWYjTXJ)GES0}=U5hgg{rIcuzzVzlPiCGaa%nEKn*;eiWf4daKc1#6(Iu^z; zSluHIn#y~h)=gLrRPBFMU+`TpZ=0KJR=q7-gtACz@lHunLTprIMP#TAkvX9m(SmJK zS+Xc{%mNt_LlH)K;VjOJiub0drdz(X>pGed6Oy?yMYR_~;D`_cAbVQ%18#|RfZ`B? ziOaNFH>i54Cta9?d!TBJ$n!;}bArqEV2tr^MDGRVjmk1IhC%b8QQ2 zjAnUdtXk+K(P0#R7CynH)UDJlC)8xrd%$zxR->|t(?vp;Wg@Oob`lmzDWDuzK@x)r zM~^{Jm2ODIgz;9miI>B#ZpW?ALn$iY*wJZLTc+Wsz0mlIDB9+-;blH2)_~rzb(08( zg-b$jW9yAzPXQ;XrqLZV(<$U-yX(|~dk24Dync?y3nH34!M?b)b) z#pjIA8N3Cx<9VsT+v6gRLw&J$RcA(H=rwHdJ#}DPGu-dRC=J|k3l-|DJ^VKgl&q9RuXOEW_Q!?d?W5Ici_&w-{XJI`OZ22e}}XR z*yttAy|M3E9V(yx{pvTyHKnB6)K5Ty4vUkp09b_Ad52@GF<*1|a&wdGK1(Q+8Nwwe z(WW0#ohlb@6B7!@AR7iyf<#q1fJA+{Y<$ zOn+Bc1=<6xDR)|18;xP0dLZ6ANudvk zgs~ROg>VGKWIpGzQk+G12Q~(wh_H?oDjR#I_~V41_fGiP(UQk4O+Vn?V-F6f@F{F5 zDwdX2?unbD7lCKJK+?acCRF4ItUgKh2C@;89g+#6Wly+B;T0hx;eke_YJyWIGKXm# zbM3QL5+@nWv-GmgYSUP%Tq~xh;AH&=L^$`Xf3jX1L}XE3VrhlXyWn29m}^&_h81~! ziP?L*%2a#T%IuR`1-^+uR&cKv zKje_qI?upqOI)!NkbZ&osK6}(=2i#Ow?B^hmMXd4;V9#c{+?>aKNx&OfN(Xbkao>0-BS)r~c+^E?laz0ajAkc}FV2k`>CQC#yV*7@m~T*7nL183{6WfRXqLRNku#?3uyb5w;80jMXK&_6M%~P+~;NP}zCpc6IbJ zSx~{OS~AFrWBtac|3?2vavEfZ?XwQ-g|0wBqrNQeU|94bfgH^{?_;p(!x`%gr(!w? zOifoT%J$G?;f%YnNV^7%yl a?jMbq-A_9fB?Tj`P9PS1(=i%xBLFz-S2yxhrZ#2I(6z)_*LC`|HQ2RrCA#z zFoD+R+EsS$0VLcdug%a77Xa|TO8{2@t^wQtxRn>&L)sCD6_9;E>VY%@ISAx1kYhkj z0BHhp8pv57=YU)QatX*4AlHDr1M&gLCm>(Is1+Es1|thFY70i~z^DTlS%Og#7^Q$w zDj21MQ6?D4z(@f`Ibfs)BP|$}fzehl+6P9*!RUe%jBbO`T`+nM#xgKw&|)#PSPd-_ zp~Y5caUDz~U=jf)$zZYpOiqHyZ(wQ$rftEr9hmk2(|%z32u!~R(~n^K8O&OOSqCud z31*I9HWbXpfmsfisiEZ%XgLmA`a#S2&@v2Ku7Q?`&@u~J=7F?TD`;g2t*oJy6SVS! zR%@VD0<_A6RwdBt612Jtt)4-vAEDK+KnYNDpq+vC2D%MsJ;^jm0c0j;}0 zYkO$z3av*%>j}`>A6hSj){)Tq1+;z#t$zb^Gca!t<~_mO5zGgJ`4}*lP6zWqFpmK9 z-C%wgEUdx82`q+y#W=9=1B(S<5e^nHU?ByI9I()V#b&Um1B*joaRw}|gT(`|cnKDt zpv_Qd;|*>6plu6iYXNOLLtAfXyAs;&0*MJox`CtzNcw`r9VDYc(g>0hAo&E6pQRxA z1KKH}T_Loqf_6KgT_dz>f_C?y-7{$S7TWR9-Wb})LHl%QuZH%;(0(&?&_ah&=zte> z(BTktI0GHqLdUMq(H=UwLC2BMaXfVNhmP~1<5K7t1s#*X(h4j+z%l?V3&8R)Se^yT zt6+H@q?QlB@+DZl2g~2U$^@+1fmIK%>IYUHU^NP?e86fZSOtMqI9Nr4RWev*gH=9Q zRe;rYuxbRWQ($!!tiA!OhtO#bbeapD^w8-ubWVcKd!X|J=wb?8+Ci5d&_xMdbkL;) zx@>|jcc5!0=;i?3r0&oy7rGsXZf~Ib1nB+{x_^Kk9ihi4=urec2SZOU=s6a8PJ^EF z!P*t9M}zewu$}?dL0}yT)@z}c1N0gQy}Y289Bk%*O)%I*fX!O4k%CPQ*yzA!6WIEI z?M$!@0^3NiT?@9G!S*Kf9ss>}N}=~D==}+Le*wEzVAm1stidi5?6hE44tCqXZa>%^ z2fK@4cL(eqgWV5c_Xg~K0lVM9z7^Pa1bb_+cLe)EVDAO?Q@}nD?8Cu6671K4eJa?i zz`hvle+364aA*S#UBST~97ce{L~w`$2PH@yiojtLIMji|VQ_c}4xhl`cj!Z*j}`Q> zg+2qI&sONOANm}JJ{O_S9q98E`n-WYJoFt7{p_IM0O&Uq`h`Ki0_gV+95cbO6dXBl z>H|*wz{vxgyufJ+IL!g4U~mcrrvyPtgB&7(iiw zB@D=h0a_SP3Il3jz#ec;1?LKI-VV+U;CvFCFM;ztaDEOh5^(7PF1Fw@09=NFi#NFV zfy;bwSqd(z!6gA)eg@a};5rmsqrg=MuA9Jh7r5>Q*Ms2N1g@9C^}ZBbpM&draMgpG zF}Sq>w=Ur30B!@pZ4|iqfZHr^3kJ94;1&mN8Q`V`w=!_s3U2$s?F0<00ryGZeiPhp zgZr=Gu?ajr!=Q&SSPMhKVJLy2H(*#f3||c+y13^KEkBcFd1O75ln7^DfTdB7EDP3-+|!!1f~vysdr%7I+*q&_!YzSB{2O1_@}@O z3Nz|qrql;!Ho&Y+Fnd1Cz6^8RV9rwrsDXKXVcxH>pfxPeKww7*+zksS!@_M4v;cy> zK+qo$+!}%hL+}^~J`BNUA@~-A7(+-K2&sgSZz1F@gzymR0HL!Wvd{ z8X)W>gk6TPdl2>t-q{Kr?7Nq1u$`MHU3Q}%>)EuM}A$2yS znL=74q!UPg1nEy8{S~BtfQ)XC;R6}|kTDA~=0L_g$Y_#6#wEzO0~z-r;{jy6fQ(m= z@dISMg$(TQ2{L|$j9(#xhm7AK<1=K=h0L9hc>ppGL*{+RvVg21kR^w#=a6j%*{vX3 z2H6V8R)K5;$VP$86J$Ohn+&p9Ae#fSk0ARAWWRun1KDpN`wUXq?;r<|8-e^d$WMa8 z0u<{&u@jU4$~B<;3^@^?>Itf|pbi6dG^mq6(+@O*LGunYA3*a7G@n89JLI;3+%1sj z3V9$)M;PDEa}4q;EjC9*TXT_$HKi zLCIJs@q>~bP_he34nWBvC^-Wq*P!GElstrzmr(LOlwN?+t5A9a%2q>J6qLn4SuB*r zL0JZrWx<9{u;D3ecn%xBgYs5T-Wtj+pxgt>2SbGhDsrLXI8=6p%IQ$K8LHY#p{fiv z8pFmzuxT-D`U0CxVRL)f{3C4s6{_o?dJj||f$FcI`XQYZ`3p2ivk>+Zov27q-uY9erTO7uY!%c80*t`>-n<>U^N?1k^P_-8HDY0d<)xIOJGkJ?1_dwYhj-e?01I!YS@1s>IXyp z&(JU#8V*6j321Bqji%684hM|kfEOIt3!m1 z_ZiOp0q2e2ya}AQfb$dJ{6RQ>7cNNPf|nF7Ft~6GE>gHS1THG!;sLm10+#~e(ptEb z1D6`%(iONo1TOD{D?Q-KaJVuTu8x9hc5uxTt_8rg7`Rpr*RA0CFt}a}H}1eqd$>6h zZk~W!?rYC-g2&_F@nLv;79L-RCspud2RvzjCnw;^MR;-> zo;-%9qu}W#cv=Hb_rSLf@U0tsI})BzcxDODtl?Qdc;*4mM#D27c(xUuw}j`?cJRDA zJhz4CbK&_zc(Dau{0!e!z{^m0Sqm@g;N<~$*#s{y!Al-q`NONP;MH|_^$omw0k7V{ zD;~Z#g6}QhwJp5v53h&7>#^`U3SJ+C*N5TtQFwg1@)~KCKw6z8G>OoggnmQlGeUnL ztxZYmQqsDSw7yANza*_WVs1vvdlU1~#C!%ZUq#HN#5|Xn?;_^MiTOEVexI2CN-WwF zi+Ez8A{J+f#d*@knY7tX+BA|j7fGA%Nn7ba(l(B?y+)z&9b1!*ZAiz_q~i+GaTT!~Ni1&?D@$Uvj99%SR9mb> z`iXS*A)TX0moB8sbJBGl>AI10eMh?4lWt2$w|%5LA>DmR_hQn+R7!dzkRJC)&yl3( z5n?@pSl=MMI+9-bq}OiJ>pNoOPHcjRO(?NZ5*szKX(Tp>hz&mfp4he{wl2hW8nJyz zdT%7XYf0}Nq<0y+s@!5hpX^)Q&iH zAx<{L$(J}yBTjRP(<0)ulsK&-PEo`ufjFfTr!3-3iF146+?_aE6X!m}*^M|4C(ho) zc^Yw^PMl{F=Y_;s8cv*}h;t%wP9e^j#92d}KN9EPh)WCN(uTNL5tm-Xr7v+gPF($o z>wMyRk+@zVu6K#+Q{wsqas7q3jUjH?#4V4w{Y(a~B?IHgz)xi0XX4(Qxcd_KmBjrl z@#sQ4yokqA;!#LEb`y_-#N!n4xI{eeNXek#WYAbLXfhczl?{1O@d6B*%4M$953ZjcdQ6Y0nnWTYb*IiHNo zA|o|qe`AY;3c zu>;6hPcn818JkGPmXon3$k-=jte%XMka2y;I8QPzl#ELu<4Vc61~Tq48TXoa8xwCw z;ysyo2NUl&;$1?#4-@Z;#QP2L)|2t(WPD#T-j9r5PsTGczMPD2AmcBQ@psAi@5zKt zWWq=?VGfxPEF}|?$bS`3zhB67X%{km6qz1MriYQ~F=YCB zd_<UqfaXkr~Ix%&}zVK{E3&nR$`SGBzc%tjVl- z>|T2pBYg^M*}>XaEwN<%I`lUDPV3;{tf5C1#O~f0j?cOFTvAQ&-YIH{$>&fnuANF^ zCbZ|`qYmtuhL8Hu*>n)A>M-2q1dX9b=u|p@I?`Ioos@Em=#9`DDoKmJliqP-c^MNr zj4{^7P&TGxAL(c6o_S(WUMddZvg6Kpu60pdR$)q2UPfA3uB4kA?L*bnmvVjRP?|{H zX#};QU(vyI7ImPUE#*gE6?Vt%T5`2|kw#)F*kott^MBB(dnX}ry{I=Wr91hjs}Aep zZ0RA&IqMIpv$xH+rMYw@okNFHSL)J4`MY$|oEHU2`zPWM8MC!n3hp8`Z46qtX}VG+ z%aiA6vh}m5ZC0T|#l2@;EqglZS5ujrTBct{h4E|miG1kJl`Xy&UC&LUBWPbbnhv9! zJsm=Cvn7^3-5<~`v>)aA^Kw~!_*t$8<;wIA#i2!JpR=?lgV|fl?nI~aJW0B>*LS2& z*Mt@-Tu#&%yQFG;7#m{Mr%x|&2;j9fAE7+B8+b<=b%05u8jy!9 z(`xX)8{)DRPQYGUjc(rIP6J!LqTGs0F%8@{)}wo8X($eVhL>lvsD@WG>QYTGw~f}; z4*nq`>^pa9WnxW{em$*N!GEUWPXE0j7j`P4HnW(UNDqZ<9;Hz$vI{bF+(xR+;63P3 zd6iPlCDRywF3n>60$Lc6qt-9~$3(dN@2{woYMENXw%E35;YPU+tZnDc(r@Sz{VGp8i6s z`c;`ld<@;NCc2Toj<4l!i`L`o`fdHWR&&CB6-abrQngB%ux0z44QsHe*kV**sbPvXkn= zxY57&FJGR+K6dV6^ML+bx=JOn;ufyj$4{gRxlXOlE>tTOTBWu?Vy!h}{krrVrZ1q8 zJjx?CSe09*6OY-M3qow{uE_FDVJMFyvy>X{B;^LX1U&KIFTT$F<%a*pd3*`W>f#`+ zp;6MpwcC@nrIx4ZmY-n~>w)VJqUg+~8A4|LxYO=ZI*7Up%Qh`tjTe#ndAS+IYnS7t z&`Q4`tEg!GWW1iQU$iw)o3#ipv-Qgqn!bpB&M#D=PI@Q5A@`TrsGVX&kDMwwrc-Zu^t>sx%U5yIO8;J z^nTLH*WxsWtGjG@cWd(plxz7)mY29yJf$al_h9?FTUsusPBc>=s?E4&xLBsmK$_UY z?lzVW@WD0x()^U-wNog+k$;+AsyAXCdJHnsw_sCx3~7UF6sCWElbe}UsFpls+8$%< zaAf}eh0nRt%E5H}x^{T#+x+DHo~_ zO4ugOJhrC~S;=yGh8Vlk6YO12=aENfjectU4sn-{P)@}cNh`HkY6<5p-gXq$sTGCs zp5pa#VR>prb%-rqkJQJcR^ZSqzn9 z5UlT9JMYMdMU;!C_1h1ftHBK$X_H1|?6{39$zktpEdNC(Inw_6c1qPL=l@M7{iWgm zl}`G5e_Z2#tCJk5&_dr%#!fl^RVg`BXSzz?Hb3=@<8r**rf-{BbjGn9FPG~jg^9<8 z6yoJ6eK$?^8AqJ-+`dEiH5tXJv3NS?QC#g4%m4T zcgETE>^_h(X?{vkLP0`?EZVIt-@T2w|l*C})JvIF~^EqLhu|U@Ck(R5Jal1qVf#Y1K zth%o+>BBzu^&kPvplT7{cv zLx=N?rO}5*skzQHi*m~Hl`4rejdJz+<+8l&0+B4%-@k>#L}tp;Vmg>wQ9h7cmp@># zVNZPr_;l3L0!dGeQiaBZO+zmzSJcs42LzAjFQW^#L)fI2T@nE8feo$XOLTFK;>MgU zYN|e)yjhc(RwmEaFQH!r>~z(nm&)=|s&>vo+mJm=gZ`H|lCN`5>CberQd1U%w>ESR zuT#kzz28wTVem*^>s7Q%YsB#p!S=>IFkQSYxUrKYc3lzDzlAZ+-{2BTWvT^C3 zuB(&<32J=`{WM|Qu0GFI%JdD~*Ju*+B;0=LzAaK;NYR-yr`%|+S6&*rBNGo-?meC> z&&?=R$>Qqd`eGWQtyreeB0pAVXC%ihU8PWSEoop}SU|QWn4#EuQ%%^ab-h=eq-aP? z=IX6z-u{_yW%@M~rS~#totrL7hvm_YdyeO3v$S%xym>i+xto^AHP~fU^K#IWX-VhD zhRxOc(aH#oELUQEID73rjT{$KA}&VG#iF#vec4hItUASP+P_7&ii|z z(~POBf`T=fd=)KDE6ps*EY2z{mRR$rSdg17@nvaloeirkb8|4}^^|?(<}Lk-3Rc2; zUHoY$@hA+Y9>TKHwT1Btyj;iMPpwGB3&EVf&!l;2{&*eAKdxP%&@REt9R7`3Aw~{d z-nIo?Ej`<`d;dONTtQN9dTzQllV3wG>jOs!eoHQ+Ivt zUPcB}3~b;2J$>N9wa!b^X5^>wr|A~{3#%LGPrUQpyUg#5k<18T&yLwA+|}IwlPAS( zE{a1c&z-HS-(Q%-Jz(qHo%&+nVv|*!FV870zPkb1Y&Ps>c{nVY}JrXq%+GNGL1ZEcZN(Rzc8Djc9I-JuzPLQ zVWlboFAuTVh*ZsFnxT=zoAE@y^K$# zT$NClRS-jJsUjYku(SUF6VWHi3h#H@zRzrRH_bo{YMh@m)8G*K>ellU*t)O zCgNWN>c5qzzYmRU{~rbF-&=^uXd?b1QvXjDB4pG=r!RDF=JJ5anMF!fHcQ^f522Hn zpE#bGwjrC9AeO*=rU4l>!P*SmM|NYBZL=u$obEzhP*bv$s>36*@$&DRiPwMM92a_m z-;kSeV9XeNDpX^fm_r}qKhBf?L6fgY&ZgY-)5)6`-w-v;;?bi}k}cV$(Syl-_O;>8 zgmv~D-Hl&IO+Q5k9+|jdl}eed(ZywyAOzIUOTUP+wVrOq`b5fVJwuK3t(k?_NMfOD z=TACx;^$ML4QIAuHD@C9DoiYmE?%pP<*nFSFIQ5_YP>EHTNX8@L&v}4LZfMJL5fPk zpW(b&$(S()VjhmMA*Ss2F|)euL+mD#zrS`5Hv_L2|Cl9<=768Utz#?4P8ju)-aWJb z%u%^ko0%_F%k@n3leDI6uq;m>NarjM4VjTznNgxmS8C8wEu#~tkiZSzxHMk$g4u_$ zT}V8mNyK8z%U#n#*$*YyyoW_>Kq*Q6M5RK5VspGnnc-@=Hqz99Yn@a529YkTx znWc9nuBgGgKay<1o_o(Q{0Vxyxu9k%+AM`izfE5B$U$$D-*UQY{P*BmA)os|E49(ZM`i!Ik8WVTKe?S-W^9p zAc`et6((&#zhwEDvenB@iEK9ZnN9VU)HL%7!hjKMvCopOqEmvl^rtu6aL&>DjbJrp zO5~!&qMOQ|`t%%ty(WH6xFW80@ih#F(3#Tv(t~HBkErCinfa+ojT&8_Zpk;wR--52 zG-(=cYQm&prV5HemBq?uckb>)RZ5j4IAo1xGat=DjM^vcR(i?6Bq&FuZ8PDa?V z)#N?~FK5tX8yp~D@(_bGYa!6jY*3RAXulL zL0SK)Qo{;&O`T8A(yviA5Y($>?WPSfJocFu*iA{dR4OzoNwKa}sZyX%Y8`tZFEw_z zxVYofL_S;iohEVYhF_&PmT(sedao2zM;Qr#_*0PzHg>|z_^PGVf!4dM|6dOGJtNsOBBNrPQCMij;C=TR0m+l?q#@$4SGoha&q zf0n|P$Ha~ugees(G}+>`_h%1tQ&0?KvrE_L*5k%j<)G+p%1Ya$QYtkng@$)B41sq! zxdvg*B=8PdfunqyvLAa*({%=K=?c@sX2^}%;m6&Khhx-1C&xF2wTWMwS zI_z|$N$}!|Rv%e@B6j!Ig<6S;$4L*dSGaIlu0h~^B#q&|S-*Yr;ysj0;!c&#-@8~` zV_Com1557*4D61ck)trBAc=RUCwCQ>9mv$7cP&@uWEJXdnZsQBR$BVS2CbXUR-uCl`k!>t^-fXg+HOzDE)=2ZG$a4|oxxyzbzK~IZZWF&m2(1agK1TBg zU@O=8eev(S`NJ29o8}c?EAoEgpR+&PedhJL-7-}|twMumj+d0JMx*v4Rb&?7u}6k- zXQ^D3qms+>WDHfB;T&dO!d;W&Xp=rCJmP-dKb0j1JSd6La$fA``3_xuY1!uN8WESs zQ7TngI^2@e!W7gJ?#yFB5b9w^slGenWq znZ^7n%2n3+Ba1(ty}svmVZ3f#ZU!R%7)Z_t9@WZ)W^iWOY(22zU|aO7j|9ux8eHAS zT>hLFX^81sGQW_)hDl{1eGI>QLPWW-WN-g`ZXeqGd|GHTQ4yg|2I2}st;qq_5b9&N z`y+Ik;n#0bvo2Y-s0TY9>iM^KJ&^Rcz57y{(2n4_QOi@sL>ae;&qiaojkzuEWN0~g zaTG4~=wfjU6LxR$YP54#kM3$ZgpiJ0D^q8wv-n1u=c&jO@n{paXvqxGC*dDn`kWNA zH@s}Oh~qhBNh`S~Dyo%hOLpSMCM|V0jJJ1b@X&44`J%0OzJfj{ByJUXVe(+!6Y)5; z;I>vCEjzN|@YcY(8R~4MN+Uy9L!O<_Bwf%|8XxA=8XNNoe8TGeNOD4$sM|J#HLK9` zVb&(i?S2SbZJ2C9xc#3`GQxulPo9TQF#I}2^unIL5l-!KJYlG`Qam6iv8ZIrnLNVQ z&}e6b7yeqZcM;8<21m{{(syLJk$YxhufSth0yz^TP$SEi zL1JE-ZoO71&&}mK(0qS+eqtr|`br<@DU4r+;m@Jj(e)VlYn>I^OcCo~xywXLY{@Px zn`-#&ynL&HjHczCkbz$>pU?qYZI1}vFki0KWaXu+a`a}Dxv%gidX}}qc0ety-Cj_z zC3&+_MBkJuC7#`+i@B*`=doW#{JQM*IqDpBc0MXBgl+Duu*H7-ia^60b5@SEKy%wO z!M7k~kFQ8g%}SM-KAZ}d^d)Tgs)vSFomYDp>&K#gS{-7zKeT#~;aMMv8Fkd+$##*c1y};N7<7K zmKfDbv?x6jC$VHbVOyiDTbt9~G@H*)sW>vi;E;Wavg?USzggOCa}|hMm@JehFIyED z^~4+XYa&hAlu^vwqPw*IOi#&I9ao8(OgArq^kmV|oqRge-86t<>heDeb+~>wcNx!e z6ph|!R5$CFXBIa@qt~PDjMNfcw>r|Zg_sLwDRF(7XN*}J^iLZ9)zmHC({~dt&_n~py|I6_7-$$n&|5pI!+qDiY zchd!I<5KPmyAs<=g2e#~GVrb+&E`mIGqy=tPv9{~Zn$<)bi1Q9l8D{m;Ot^gjni5g7XaM@13f{Z~x%e-Ue^e-7c1Ya)W0 zL-_z9R+Ej$%AQ(8R#ft|azs`}#*O})OnbIOjWz{=`ep2FoM&5fvddT2gl-Nkir1~@ zN3%}rF)@o}A(87RbUH=t=y@J3_Q`?Bioau1tmlwsrTuaJ2!x~t#0QaQOcg%}bH1oX zE{Wb-c-iKe=)LVnGr~<2)>JHuM?Be*8%Vi${%J~;h_C)apZynZ9|m9C8eM!jV$uKO z9MZo{@&jFr|F}hZg+eQ)MDhC9r~~LH9mIqv-q;H33gcDW2=O{zSe{ZPX1Es95BlA? z>0)|{>-c+ie63hyu$cZRj4p{%A&R`1zTh^=b9bTn_y?A@vPtkjEUkR?$`fg&W+IrD z#Yx%8gyRC=6TRJ#FLnXg=7iYhJ~NT_`I9~usiP%Q)Bmbq zBGMQ3#V+cAfj+iE+ME2ua;0PN?@hzsj;UT9eiD<}Ci-BdCID+curfeu$-+~&8tJW= zB(0;tI60(=CVpa?W5<3}DCWB)Z?2pE6XxFL>4VeC16WqtLDQdT0p%0fxb$(BhPsLy z`*%0pDvA@~cFg3MP*#>cz_7@R>CNtgV}|I(ShC;@9hzh=W3FK)|ID?9-*cG`w371S zf^T+#zCGhJ&$q-iy*F&d`K(Ms&uQ5!jrDCQJDJ_=@$uQCop3~MH1E8BVw0Pg2IA~K zJM5i0^ELMU&i_Y|9rO9J5KlFZ@^ol>JvD=>4EdNDU0>kJAM-bVZ% z?17>gEH+Yll0-IE8El|=vvMM?_D7{Fk+SYNYw#bzg+|sE$dHJHtmvY`422m?PH`*XIs?4R9w{~eTlg5Z8SZax9{ej zhBLQH*5;?=OEq$F`@A$d!!%!O1|res+VNuVnOgCoC3~Y4-7FI}B6qks-fJ$(bHgr* z52U$vV!N7L-=URsFMlnokaMH&=`j7e+25&UTsTdkPW-jFUHCMG3d{L71xY0_<0vwD zBd?6FZ5YpmvwnGldR3ur;;$udY;Kp#|5O@Xko1<`j!iF3tPv?l&a>vMl-W=ky(40(nCry zBZo0u&nr=juNY7~&R&>Uy$B-!JdU%!L*Y_ztrTxKP|LLGYDHeUUcy!uxEUs@DsV9{ z=thAHZm)^(H5XXCcDKJsi+N%5IT%ye-~A?5>T$33O+JRde8nxn94`v_Syd6ohG5gC z$g?;}9p_m3Ds@AAZ6?Oh+yz!y=qbUXtzA?`xt^4Jms*Z^%Dci&V#!O(q98XXgi$DW zmp>g}i`?UkFgs5<1ml3#(VaA&zQm3jDOb*ivgGOzk)om^M>iz$lwxb#a$FsvLJDnG z5hiFOqT`oK(do^Vu`C?|YOV;S@S$0S)ggR;#uwR<39N_CdFf@58qS4s6LO*&FcAEO zj!r$U&!+W0x#{V}rO}9lawYtd;;&i&biCYn&iYZxNDI$q0=)uIIgp?|^EOi5h z0+ODbc~0_XtaiXramdLz^PY&=SxZ)@v&R7PZ{635-4SbCK@a@dJ+0i({YFuSF0)wd z@I~j)x)b#joLO>V65pFS7k4HeY+|vED?)QUS!9k{7mv&49`K0I*Usl6Y5XG0fhuK8 zla-_5ZRtkN87m@7xlXLG*w3)7FN)iuQvrt*B4~b0Xz9H-^6cIzjbm9de~WD>>qCaH zGiCeDF3~HCuW>OfWkUdY$?k6W3IAR!cSkMod-*VfR1d3|AO^&Kr>;f3P|M`GSxl+H zcxotjN1oek{WesL#P(lToNYc0l>-gGw=3OS22kEbo{L;)Ta}O13ntm6HQDGUVKQ5$ z)L_7eksw;)9{Qi?<{Jd%cuGyq< z>6E=A;HcLO9vQZmFWpBxrZS2u1fS#arq7G-d8xzgZhc)nfBz9t*H_b6LTeGRq z@N2etBN|gnKJ@12Q19Y(A-7Yi8ponmy~B=f?n$n*2b-PAB}S{alOI__b?=V+F)Ha+ z#N_gP1V6Qix2d?#>`nC~G@pZOn$6APn%;eKDOblostGxalUj0Q?o-1~$du}k+en4? z!O?i1$bZLn)*yP-iG5qsvHLX2AK2r|U!q?vJH^FN5ATY|v)ku3jz!74#oBFY1~Z(t z^e4aRT=IyusAf1@?o~ykXzVO?^Yh4Xc5F)rMbvFokc#e?aytf4(0CAJ>0nU+eL(EFXaoj%}0U^;z6Cg z%OlSoAKW-LLx%)qZynQ5MY#g*-JItLe@iSMbMEDRl4kI99~(ItsFgvy0J0THfb|Y+kfk1n$_5ZMuj{^wQER$UDJU6!o1mnnj&* zS1KcMVS8ihRam0;0sWd^xHXlL8!=O3$#=dWoLGD+xURrD! zzJJ1{1UwfxY|5?ShqGi+)tKn|#}agybW>xAWA}cP$1*Eq)8!?Xaqj-!Rgq_p4s9HZ zVAn0yX8Yb2hMdKz?Q5+r(Hp^cMDnQjzR0utCpM17>f&3>cSlkS5Bf9Jg?JHztDsBt zB4VkM32V2r$MEa)2I`bo`j{M<=qx)@7rjkc)S3P(>5r%$GW61-IPrNXZPEv4>Nu=L zpxh;Ws%Y&ac0OuxmU36wq+OBzYIgTB@w)C2HiJErJtzraki76b#ubb z*H74koG@d8pNwHeumjDcyXYGH$Aw27LZANn3VMs)$x-6rGOn9$lSEs3r^l{{OhP0@ zfmKMnlBQ>&mQ$!DYIP>!5G=Ot7#oD_Ko!#ue8h8xB?1-x-vzC1BDMlH)m$o<3a z9v;}1^By61*DOBf7quUWSC3I@)grJ_85>=;Or4RAHcl%;Xk5~5q_>RaDX_%cbC0cf zL*pv>W4I@1l-zY28P+eF9rEs?rZ*OTjnY}DPePx-WJr@6-e|?HOAjqXmYzN& zrj$*X>ET`oQ*PlLn?qxd1~>YCX$swx7Pe(&nSd(F&M_*5_2=Ob$E?!x4l{i}~4 z3lDInC9wt?@{ijYw$b5uFG~!tW(vKpCd*ika>?bQcuX9jng~4JZG7zBIWICwP7X|} z9>#SqjXpV$CF^iN>k4i=W&PdqUJX}n}vNQk3aM>pu-B1dJ(1dLwavobZUDUpoH-qkC zPsX91ZC1biCRT)w_sX zJ~NNh?q7JO4>4OnuP(XF=d+x%HbW0m@$-+Q>eTY+`gOZefpLpY4C4Nv2>;9TMQ&r{ znWD+g&D3OSv(OF1tTi^`XRsG%hhr^<^;h2H2wU=1e{>Y-6(fQlYN@<-!iN7 z6G%U{@O(eVCaTo1WDO>PupU3HWUUJQ1#JcwLXSLq^3|z(Kc62WxCxQ2WA$U$p7So< zkjSMCXIFiVuC6-06dk!Clv_YAMtp@#`sw^g(erb=U_)lGnHNTy1^&ssq6@=&Bcqrs zSNtd{oBheC3{93c8yS`HH%9$*VXi^9`du7|tV+K)0KahBb8%XSf5RXqxik^I*twT% z3@k~!G(dtZnH~6zXan{Q!a~=~cgULho=&BcrK+kJ`69La_q6o~1 zY1lp&xw}^s0VKaIT{LC9|Li|SpfY(=@@5o)+-r8Wm$1fe<5HCWul05V7d+Bt-4WWN z-WG0t9u|B%su9OvcdlXjWHn{2uXpRx7ab8>u9st`PM)VghejjE?2+UmPnqX+%-_tW zEb+Q^XZ;4M%)v^YMgCP0yZsHK((G{UzwSuRu*cU&wJyc#RR3+GFgmVa4mWy|Z`t@8 z<81Uk^!~f=XVs6d!wGV8P<*tRa*Vy@n4NDH@wyu$$Sd~4jY!-nOE&xF7?eES&3?%4 zrkhqBLg=v<&%Qc~g61v^5!SeRp`iV6(;heAU*v55pBvEomQ6SDFiI;^tNw8q>4}ZO zwHOgtvY=by#z=2@cGpmDjS#6)VA7p4s=xAxYqfSCma!FN6ziAhrtKzvLqz?UT~H|L zvN<4i!}b%MgVl!E z!1(UaA#s#DC(OlcxY+gng5ulZfz;*twZSvi#I?g;sO} zW9}|COwy}EHTN^tOJUIC#{Il)K3?djGJ4NV(wcG>l=J02mc$+%hJ)*No+KjPYohz( zB$maUxEJt`o8kA{_1Z=`D`8#v3Tyfn5n0iqlBk!-l%!%c`T|x&e ze(JytTT&+s5Zu@AjIY(lQQVP=WeM9#qqFl1`I*#=!&gbw+4GMPGRU*Q#QLXpt>h z?*~Id@t3=+iNf?d+GwnpK2#hVEuL{hSq9cn<9&4q_fgDlwAvVM=*PFv1m9|IKZSd+ zF=Em6zqg+v;C=lBY=5tD>4kNB#98({u$jXn`gMr&z%#XxucyKxZcudy0$LIixo}^l ztO*wVg8|=EtU%8MTRz|>FS@>Nx7ZRd>nE(+Ew=n@tWp}H*#mcDcZ*o6C3AUbBjxu~ ztiwN)ve7`cMz||is%jRh5T!Qbko=U5B7$eaow%Q)M5hlMBh9gO2AVaWTVUe@DP4=J09-PU3|4R;?0!UPV^ zYAPHOaCOD&M5Y}QaLqc=q2;H46JNVAOr)ATvKox<9tgO~Dsk*ZcdH@{3lbJ`1nZh% zU0vy#stEijLs+@uq-b&ab7tu6-(*uB<>AqK^k|@sKABo_qd2F7kGZb-DVfEZOhi}k zSjN=r;zYiiFt^9{9{6Ea%pzS}70zoil0yGe_y;WTNq2H@fBch=q%D?|at{@1y%!Z8im8L7Z|%ir!b40Gc;PEC zPTBvhSTbkHe)x9vpiPv&#`VVUOB%-}RU>H6#p5?FpRXlViwZU5w&>}iX7eyKNh>!r z;WL=}Sr05@-SMnPw_I#4cr-UJ6dhx3KNd%ch>j)u_E|GV*Zp~Onqcws=7J2_bMFrN zbh>@gn(421HVoG^sE_)Y_?>qB7Djpl;iB;wjdW?W(CR-cb@;kX(>( z@Shsuav!(<#C_b@89<`00;eFyBa15dhOEc zSK8~BlC@>%=;>ZJlW_a>Kys6r{Sbx8Cd>L8^(mVeasW?S-T2&0(KwkL5-V&>7d}P+ z9$4uQ1KqLV)vZPA^U~B3v)ZEM^|6W4HCWq`h#zlf6=pHDGP?jvf}>;%yS?O%sv^)) z`{M@>J4Ai8rndyYlBg9Yaoh&!Mr?4C^DB+USPheBnYQ}5Z1(C@`{n|+{_iu$WVYu$g0ZITyZ5sR$3}eU(j|~`?)tYg^9A=W?@r^V)EaqBFgnHP zoUZyX4oy_|pGLBGAIv&W#vqZm&Pyv@!?mE?F}{ORRk}vxp!vt<$m;S>3y2>({;``S z=Dtqw9aPHFHIERNY;Jjuz5Cb`(LwGFcU>2^S+rt@YF48d;HEK~Pu6|(?dZaqtymh2 z4@P^e7=!=g0%dMGmbI$&63mEgAA8>egNtJ<;*$ugn6Ng#SleKq!%=Gv>f-PLw~TV7 zTy0_emLRSprk(_U{Je}MfABD@VVtE%zc4;84L=4I=@Kh8FchQz!1(b_XB zuH~i4F@6*OiLm`UVLVI5F5;2|f0Z&nMO>2DIX~qboBMO~l7s?XoIz9l(~^e#hfAVZ zD%O)L6bkUO*=BY3v!jtdmRbDL%jwS*;s{qTR%S=`CltF%n?bgRC9j z4SF9s5`Hl~Ra2apt1dOf@>;xwj;^9}_7kvm_zE<2KV*J}xTY6Wb6-v`4gd;&0v5f~ zqj%#7+s7s~=1RlwV$bf6g)B{iAx9(c2l3(U@*-tRfMK-JX7m%>%+lqk67zsUyegc` zS|k1BM@(7iDOkssZcEB8z?^Rmani@+R90d1C1(tse(l}iy1=qnLvdil zUS@8X_-mH@xz~T4E&uH#^=J#1H^XpgNHV&PTk_6gUpW)@)P{7|%lUFQekgS$5w z`EJwOHs(oqrIH z9;&F?4N07=Pt>QRi<1pATa@<3?ZPgFHY+xVjC z9Mc098O^&~*WZ@Pv)lIHj>v7%<9A2yR!0KA|z&|n{wn61u_;_Vdt z`*^a#Q2TqI9>|h)UEJ)G7rk!{H#}OhyP{30FD9^OzxN%DeD+k7?Aa4m=ImU!uh^?OkO;AE{euYiE%^=I=`#_>XEfT7Y4eS^wd5^H=tl!awh0T($mvK3%Z~!>D>!=rMBu)G@ApP z7ko6PnsRYJj+gp*aO`v$#`P@gYa> z2>r&4_)PmjICH4_z+U)trl12S>yx48)mvn507j%mXkza#mO=s=6Y}=2j?c#|>FE;` z>#Zx$7IP3VAnCNgoQ&&=m%P9II=-E?XYcEiWzS~%)SN7nHQ9Ydn-V{ine%(`aYOwq zh(`w;uyLYItuu;9pIVTHKB(7s4xheV9bX9Zt|qo7DF;PiR_yEi2-$mw96~c(6iVe(FOz_KhPDglWyp*<_DyG8`z4d+T7?Ww*#xNdXu~)&GzeFS8>l9 zC^z)*C&rwDFnI!@xv!JH9X}G-X=4r~C!bU3h1W@cToSEVa*nE$gCgknuM^qeN(C^I zwW}2LVhuecKT}UnproJ2Ki5Zz@JJ&^zrwMurpGULf}Ee-Peg0X`QC zLfLP0i9n`ub?V9Vvb`s1Bsab0MqxcpONG`qH40>OSLFEawwt_e+p*I*7Ux zl#;G)PoSzY7ida*;xY#9@HTT}w}e2kL`c)8Cqw6P;8<)`*nXBHNb|Kt_;Se2L(Bjd zdmVq?ssq`)S z&!Ja3kZJ9q5Mh^E8~DwRr0;Cx`iHm(gSe=GxPU{LEH2{nTE&GlrdgS-))gT!yLVo? zw>}{+s6Ja$?ap`bJ7{o6;)=H`*{%j@*H(Q(bQXkyACLT&nmt9uqw;f40bRy*^ zpJAkN%UjEQlQc+Z`|LHm>$lC$QaTT(w^Sa%eQE}oqI$A+wI{@9RATn5h9#oKi zZZ8GtF8jUMKL>526qlcA7NTmy4i<(Yk9mneBQ6yrODwO?Luab_*_V1KPG3HzT&kr5_I2T2W1I2J~=*Lt_hcNA7seChU&Wzton^{ z^hy^pT=rI@KX)Ph`Hou5INdzk`$Bjzw;Nl`NW?pTr=viy2q!tZsw)}Y-IyUrLs~l5 zZsHS!#fR*o(~~4fUL~#QN*3@`Uw0+Y;l)vflF0MZoTCdc1hzCUQAt)&dtEFm?I7KzFZV=Y@VhV-79NSYC22>4fIE)EUJ`rm=#&x0UP;;P|I?akU34VBCF)` z4{qta2b2XU|3h|h<430QGbqFNTj$34-HAzOSOG#kxsC(QG!NAj zhaJq;ppNGP#4j$TqzAEvPb&N6CGFco7E4Mxrw4Jf#tP9)oNz|^GNwB0V16W?n4Xjw zFE1wOg&t%AUd4Kl;cbjwbYM?%Snd-a^la^N>#Q+Po}&@gq!(_O(|l{f0U}Cj*^9^q zXF9nTnM9V-kY2n?;KqSoq_o{7K|0QDwZ3$9Z!#6cnAyEaXF|+rwGCcqP9NEjksYv5 zbPxwtZvpeoY}(b93=#0y-g0kDF0&~(2?vw@G{BZv%h~E}$>@&I5e{OVHN|`zqomhu z$rhrcL;H{rRf53Iu%eVqu;#JB!ZUGbK^PRo34*i({=*70R*q}=&>JT4Yd%FmrfYv5 ziJH^#1wiG&qtf+0@8(TxvoAyezB$tpn#j#{8|4$z-R5=@XrW}V#A2>Gv)m@)in>g` z^2_O*I5{V=9m6$apzyZOd8BE^DU5`H!sN!8IK?gnnfji^81P~Wgbc)467FarN6r68%|>AJVP<+p#uLBKrw_|!WKy$L zzCgc4CUT7q?nfr^dTYxLS9tLym-1b7_FHWB8P=oN|L7vP!)9bcFK|ZcaZ8$wO;NG` zwwus4@l+tTu#(C6W*%9Ju_+C2=BKc&o82t;uJA%$*8)zY8{xrMc0-EN6nnj;D@4cp zf(d*5o9_y|uW z!g;I!pOCH5!P1fo<=~nhD?R0prYHLo88|~9y*j`~Wi6a1ET8>Y5N1lVaX{;ciW@*i za%BWPJb)C))wpONnJ*t01`=N(PhgY9xu>SFYAOsOy=Gk(LZrOZjBBzlaf3LwAnc|@ zP(2sD-a@^FFx*@AgC2@|i(c$L$HZIoZ9CErslK(t`uZEXcrcN{0yKOuaqA!m z4+Qa+aX`dg(Vl)j7zthJ>qE%UKG?B*J)fEJg+`ze9$0)!Yc92uHWmeQ2$Yhp7(!N% z!L)J+nE}!E$qVslXA5_%-)cvNjRCw8I_N0B?+=Z@|lO~UykHgF7aLeW)Y__imG zo*qM*296azVeJaSWHW|1O`O(@{{kBV8)~-7W{h|LQ5=W`ZTVQzb0sgW$iA0E>HA{; za?j{J;fJuKHKh>5!QuPRX6G-d%2lPPE^$C}pYQ`5IAFQliAKu)t<6Kry&(aPAA|XQ z7caiWI5OQ4>=22<2aWExLa`Z8GJBZq?4@rT=6);J4M6{s9!z9?c#qHs_;>n2 zV1vwBLu1Dgo2i)s%M{XoN=sk!1)i7i{ML8yEN`+0A4&W%3Hfb(2U+oJX#)Ojeo*aZ z%HsYw(r;#ZGRz_3Hw+u^j3k&tnsEq-?;b&Xj}c4(KDZ*`N;1%3mLd+dMah_O&F_3$ z?k$@HspEK(!#xz}-SH$2E)R6Y1Y+L<7c^|C&?GR05G!~Ktd~$Cun6G;S}}p-$}MPb zPeSB_{r0V^?JM?V;c&R8W#{H*nfw&ludwW)uUhGn;H-=5*wUq@r|EG$NMK#)w24G7 z=W%Od>vF+-5~;%#b9#6ZDeo{g+&zckC`Sua>Mpg1|*B)j42Z>`pH@ zkb&c;LQ}=r!ZgYcJg@R9cjTCLxP>^fFJMqGpMGdLuTe+o3z!m^qx2l*qP-o7-BO6> zx22x=w^-`ESn8gw(UcYkdR~sM@w%3frzwW(b&|!I{0K}XVk&yJf;C%6JJ?kn#h$lS zbnlRGD!ZJ}Oh@>ABFiU|;%lit4c8Qx`bO;MePOTEy!D;s-=SkMNI0xOJHo9QHU7kr zXfXwEnM~~XzjU`(2^YBcr#U;#zDiI257RzjQHelL3$+!LmL%mQXLJ80 zSvrLr&(X;Cws<;w3K`1xK1<|P^3TU3>(nJUrLj}U)c)8?UE*{K7FF!M_&iU(bL`(R zpPx%OKeU`D{BR2C*B_t!<5uq670lkt(Z~r`@7c)DC7hcQ_MS?*jT*^4{K31L-XO4< z{P-CSProQIZwXSs9~_uanyR=4L0M5$U|dMuv1aN3)kkf3uA@mzKlRu8$?%3Bcoo2JB~O7-G`>)tUb<}`>-}JQw7nh z(}-++pk~v_s19QVsqqQklg7K{wCSX~3%5fhXJl}dSt48>5;L$T0qu&b>Fue?%EF?` zs_267$mqD>(BhcVZ(Z#yuZIH;h!+b7W*mYjSQrlw#&Ld8>Y#)nS<1lLHr;-%a4#zD%*^% z#ewU=*d*S~i_T2&#F24XUi5a}o_8Sg;n{ui!F{L`wZ)(kEr)&5*|2LnYoTw>B(g6! zoi>wfvzR0pcn8`ulk~S}0t^7hcV-fM$G;(l{IkM$#m3gVmHZNU|Wo9G|)*S`60 zOO3boZr^0ci%L&XmnIsZRXS@3Zb*_pDt$KLfF^UO19E7%)#8=5x_J7vtb4i~QC*Gr%=Rg(DpZ|6a0jj7yRn8^0a5bY7=VBGmpKhE> zhR75Hlm{VaXl2jEcN24Eec|81EeB9>9(i*h#_DY;l()u_I!&oKR0wL!iIa(-)hd}E z7yKJv(Gl~>oFOo4z2k8U@*sh&k1qi1WhH0Hwn&iHLnUC&=1O5XYF=?lS~MT)N@Qus zn%eEZp^c&)77%NE-rxnKw{TcsS}8A6$0fjm*2>tufDGidc6$No$s7M8Hh7{m*buvK zy{^#bJk}CykrbyZ;JQ&IHD5?%J_HI{^?n^k2@M+mV$k8}!FWj33rTOezO~|Yto7T| zT2QYK$C$Jcq_xuYf-rgW`m5jN-~3hvHo&yDRW_|jR^rQ78@9fS$iO9_Ua4wOmCFn< zPo$pGuoKc$pkR{V{}&I1k~CEsw%I}I8DEeSmz;xLDyJ;0+Nvt&(%+nI5ufEnZV(2r zb`W%&)v32511vE|?ess>kpeN*`uJGZu421UrhDo?)#*PXBmIJ-rdl8W3%e9uwwQG5 z=p;xQHmJgjf0U92;?lqkAVFl^>(9urSCh7hL}{V&k-{|j1COuieyrh7_Yo5kCpXTwyd{Q5d< zi-AkviSYH(y;Z|G)0;l3Hi4?k!0+BD44qsZgUdmUR8r9m9f`+wwuUJstVj?evk z*=rKXffl_es4&S_488#RJ>nSQ&HSdGKcTrm{OmY(cKFj-FpxLVp|)p{nn2p0c*hQybt z!zzT32^GY*mF%U^JizRaU-7bh@vMCD)vxF+=WoXIHD)^fgE# zjr~Tl#{|g}oRgEi`b9p*&PwFNLPZsDzo8b;&^;AQKNoO>TzG;#JOKo%e7}L;$Ik`) zup*(kQ%m?mHX$#U%ifXC}~n{dXFUzaZvUaRuuLVQhq%MdwbP(7;j zrI5>$htO}YX3+4CI8{gcjm1S3b|*`Ej+oT>S?5 zF(l9AZ$zsRR)ALFxgC-_f6EYFEqY!p7zeFw1ACb1CgE9uf2MpbX-5>aZY=?Aj;Z|s z=%csSV$V8~CpFa&8d1y>a^%d7q+YHRQ#ny9Iijht%iWDcu5VsMo_`izjy4v}P)Oe9 zrtFARAdO`OErgB5!>tX^vn~=^9H;W$ioV3o3v|;u(rFd60!{VJousk6Wza+!cp1AW z@ERp(;}N_=w>U~;<=)KivopN!w>YB6rk>36<6RG(nO9m7J++RkR-s(H%H+pTz%!23 z?)yhuqCqeZYrgm-_!aolgt`ywGPSx(b$F0P3NW~A);=E58 z9mQH<;}c~1XJ@Ks1rMbH;}EfHZ{DYZ>Z{#(zEy5`)cJ7`e@`BuJ%ef0dNM$TULn^N z#99RgihNtn5T!(uqKf!fF%=R|ri)kc#k}WKx&3QN|59Nq1)iGMQ)^LC&>WtdtAJ)1 zVv+!-9q5t`q>m~O-M!kKqW#`rffxi5XjWc*gz$GCkjslfT6=I%Js-dL5MCp!z}?iz zMNc&Qt4>~kO6BqZQU`TYZ|Xz*oxEm(=yw~4(CM%J2-4s;1O&5vRXcyyO%DGg?4i-M z#L;wt6B*#$+QHED_=47Q@Q%R;iznm~MojAs)O2f?Xw9&-Q}8cu&kC#DpsQd*xnLhE z3-%@}HuT}fC+ME?IeqLz>^v}0tW%2RLi0;A{PHPcoh+i8xQK4Dz-2D5ThEw5kjA`} zCUU;3aJa(1I`*9DmQdVb_%7FON;Cvc&Tb58L*m5;44#`AIY!APlo7@(Q?KS zqd>H0g}B1O$&k`hT82zD4#BS!I8}5BK4#2D!T6WqeR*h@LiW7MjSDMyBYaG{D)>0V z>u|UAb&5@7OlN-ea}?J&1UKZI>8eenU#HKx=8_lPl!ImyaWq3Ed`Zu5B7>A)Viqz< zLZ$c`K9RSi8GYkpVhtvHqoXut4*RQx4hbMf&49iPvRryay+=p+_sE)2va zg0UCIB9}_yBYe6%vGGsGg(*fy`P(6m#+-KG^*)JzL_`-cfkqZXoLCFRw>cf*O2+r)AFpiu)O5{4$`x}N{tq~DVKjdv)3}&wT*)%q zUm#yF%|7IlbT}^=?@!$4p^*I|h@tdbSJJa9ipL` z7)i|ol+<<$vFdQ~521^B%6|*7e!U1a%F9Hvw~(&90U@diogbrX%M*O-^jnY7{t^<4 zOZg^a8ZtDdL-#JQADUlEKUm;MtZaVSTxo$D;I(>BF#g{BvgLPvN00@)D~;u@X~Tb0t4|~`4n>yoWxT~ z_SfSQ1I~?I6ej+Su>S6L+5D4&X{LiXL<) z(=E}DbGZ_En>(2}pf#B|r+M~VCdlb33q>lE9f@-Um73dImTx0V%(#t^mTe-ac0}{Vp4+c+5-)S=?$K&eP4pmR z20|Yu?N|0PA8grdwv(l*&^E6TQcSAJ z9&)%%ZCkgtC1wd`8D{xr#b#9&y)1$(9$L<`Tx|K}>x*AM-0sJA&4Rh`vi-gGkJ|s# zVQYsS9W6R4I(F^2q~n=R{W~Rf+Slo1r;D8)bo#gx>mwz1=ewQi?%4gK9*Q2y9(6@y_I}^CzimPvi#{oRuJ?JTAL-Y=-y8id_xrVf&48W*YzFijFk+zZ zz@R}5gFd&jw3}hK&@S07-7aVFh`}ocuNmw*`1BC-p`C_W59>E9Y*_U09K z|%Z@}d=^S2V16cg3@nt5-f-)qd5u zRcls-uWDXBWA*+uo!3~e30?E!+TgW$Ys=TQTi0b>+PdG?k6d59{?iR>H(Ya??6l0O z$?2-oedpQE^PL-As7D%T$*YF14Fq+w8Xa*yeMtygk>^q5(d6-Pd#~;Dw(GWE_O$ez@43=5#k0`!wCDR? zR$jxrRFk}BdBu5^d7bn6)w`|tH19y~Xzz6IQtt!aXT3l4e(wFFck>Rr9rioCcNlhD z+3~Iq@lp89^KtP>^r`lF}%ya+c(U&&iAqJ z7rx*5ihe`a z5a=Bk9he?i7FZRyC-7?E!$4zD*P!u1Yl57Ee1c+v^g(4oXM!FC{Swq1+%>pw@R;D4 z!ApbJ1$zbi1}6ur%7c#vp9;Po{9TAy$m=29Li&UZ3vmpY8?rpaIb?H)dx%$vHl!$| zCS-re#gO+xz6|*`q4A-Gp@%~+hdvJdM`&|cyD+P; z{$azyCWXxnTN<`D%q47FSa4WMSb11O*!8eGVV{S67501h8{q@O9aQ1V!rj9o!u8?1 z!W+Ubgx?B(82)+qx8XmBw?wp!Xcy5bqDw^gh~5$XBJ3iDMNE%a8sQod7@>A{=*H-4(f6VsM}HChee|y}W-*;&y2td6 z=@(-cGdyNYjD5`Hm>Ds1V;03Y$83uUiHVOf#8k!9$27&oY)hP3T>H4r zaXsSt#M#A-jGGWQIc{d${J5oYtK*#FT;n|AeBuJ)LgS+1RB`cfDRCKbhPZ;b(zxAm zN8_5}ZpS^2`zlUUS*W_I`l&{%rm0j*R4Y}kDqmHgDo&NADp1v^j;hY9ZmJ%tK2m+E z`d-zdHdl94E7iT#1Jxtc6V#6C>FPP^h3aMM)#?pu7qy$(Q@v9is18#{tJUfRb*eg3 zovSWHe4r|It@?oasJc;oMtwnjS$$o7OZ|@ezWQVJH)^BCT=S-;w`Pb+Gg9NInWtH$ z*{s>23Damb8JZ%^Zp~56In52t`uP#Uzu8YxWbcwn&IN0Xtige|=YF(Y~ zpsrqbLU&eoQFm2$Q+HSQp6-F}vF@4fGu;c_OWpUnU*pZa8?-xHj-adXt{G#|Z z@tfnl;)CL2;uGVu;)~+T;&;U(YD4_N_@nX1<4?t(V`rog%i;ipeZmgmlbs~3Ew}Rq z`jQbuMaz8w9+7YO%I?QXYU4+otm*{>4r9AucUGuwfsRu0g(lXWX84i5Z*s!jV_Ti8 zSAm=;n_F?|c|S6?eHXCpXPDUbspLoc3RJB8Zqp;dC3q7j)6>M7u_8h;j)y;qn2uWgxCaT5?tJRLoE$Ni4hSFvhXuj+oySem@VH51p_1Tnlf;h%eL{9pN_JX`hEiaP zE@x@sY84Vdcohqza6By_YvCS@vXGR~mLM`{C>#MSmatyn&l;`C z)8#Gx{=U=+I`dI21FkqAx~aH9{66eZ0r0s>dNP;{=1%uu)(#B^q<;l{8BBWg#1(k% zHCK4XRq7S11#zjktd%&DE)C{7bw6RT@1dpKnbDj^B9AWoiN4Lwr8~LRauxs9RkT|O zncN{uc*ee2_leBqOkG0AI9P#|Y`WA`;Tg&iyR;+(no4_mIz%?!eiQc07$~q0q!Q6zNO&7J zqxj8pp`^RYLs%~^5>}Ur9>U6I6`Lf$;j2>g60(=#xMT&pBJ5wU)M#`n6>5?i43z2& zD%;~*#BB((Ggr72i39cy+lujkj@as5Mn{l_GrZB*ZbzlmELRsRr}#UA%`1${4!^fB?r zP!| z57DS%7J{Blrtd})2ad|QTYLEdLhHm;7~;YX{r7CV~DSR|@*#wxe9 z&hUIo5E64#m55+BkFJh}B5MQHL=)w-0MKs;?4BJ%m&U)Fb^uGr=9yQ&dgjAx@9%?{ z(p%AF_`ifM?IU|84vhg;1q>&2Lk!u{FGKM8c@*2PDx{%4N9*T9fDCLIaA_6{7*>vv$tq>pepchWa<7^7%2t2SOVssm} zmF|iq(K)rie*`G-ctS!GXsk_U+nM=^^F{p+_S2g&Yk$&M{@XC?d@W z*LY;T+-UY8{XUjht!kxi;E`=szKU$~XPj{1BSf{~arOYYL&(45!nd4#ipPRJC(akZ zmIFW@9ESlJ$&lGq9&%TzvN#Ar1cY|M7e5sh8$OFI883|2?T@{VtDZQ9eM`5|5r~^ve$ozP`}?J3J7?D0oqDUk4F@clypGm0gufUM+tHO z5P0D503ba22L?((n6DuFh}V>rSJy<82L?oh2L_de@75I>?SRG2jWb#cTF!yQ)`TCz zOLrq3J*6UVbg>h1<1lku3%WwwmVHQR4;At4rhK0V$ub%Q%ov##IrhnLKF3SxH!3om zd_jAvNrV+bD4B~zItq_a_e1=|g^d87qgGAk@Xl1jroy$O3;jh+*5cgUMcf*`5572S zG&1DKoF3E=t-Q7vtL1JbuTy6&>D2+w2I)sL6XdAHRHFr2folmKYso|2L=|1lWQAA5QocSrpyI5ihmxpOu#3o$}i zwtAViohmVmTlSlO`1~FcK0M=!{_nloLGSOEyV~rGYKj{o<#B# zH6?y%t8GbeS9YVBNu+1{Ea9WO>pzw0K4^Us8E1Qkn_7>(`v5B@RaqWfwbN73TjpmT zSu8^rs97=@G#(IzX_?1nGqaMN=_#r*4XAHWwWx=>ii*0runJ$lurOcWim+N$sd0cn zfipJR(#^@FkJSJnA8|j8wt}jZcipkocG%}gb3uD%td4AR5R7$kh0Udi31^@;-x)(yK-)5UgzstkFj>J`D(!Rm-j zxKsy^MYOin$LUDGAuc>^C1Ogq6VzqAGUc?Yh)uXu2UZ~QewHpHaVF;dDfDIrIoOqR zsiL72=8)J0f0?e{{Bybj;x;c5L(4hgvAJQ`?w)S~ zY-qY64HXqJd&K`IF>h~KD#m0Zdc*&Mp?6@nzCt!cxYhrE^pY+#z(6dA{KuhPcr=+V zY^nIX#P44y+1Gy~JThUL^3i_(tEjtrxaD&3k;TIU&{er49&|l`NxUtIi?8AKk0Ls5!64gbm-(GMiuhuH*Bw``*MMa14rRzln<;xri1 z0_|E%rpr~kwwT!3)xe|;1_fOqD)q^=q6_!nM4JPK1;j^#81lMUx>L48(A*M~Mnyj^ zA>;9|Iqgz{WT1*CY06)U4ou?eRJF7XpQA`r# zhgX)6{sUY6KZ98Nf)Hb*aBffid0^4wsXhfEHp#1_?dtya185|W=Is_aELfl8Dd`noLjmq9;t0w!%8kj zTO&OC$pC z-L{J`HM2VKTx_MLgwvkDQ4gU9i(nm6-N@F7bLhTu;@0;Eq48J+2d3dW6g3E&4wXzg zwi{X7K&636%AAg>fUh$@aIGLqO0Y8Yi(m=p3O<`loePXImu2V@N zN9C&AlV#vx%Ry!Ur*YVc_hW`qf%KLbT@h^nSV$$V{%z_}(g=M@Zmif}sCO-!nvtFc z*3PUNR}7ALchKd?p#g0FDKx-eBN3s;A#Yk%NvxD8x+@QnwbJvWaX`|TLS)gmDqFb# zo>!77CWcZvXqOC%#h30P-ov0jnt%HPzpqpE$yu6`lnhyaq;C+EciuVF&}7UMROruJUH)a%Jt2 z(^#S;<*48dub>}RwW_k(Ruewzz`RgR9)Zw^E~+7%mD-#huOVZ`8B2uNO61Ter2we& zsle7rzG>-*+B#f-|K#zrmvRzvlX4LVp%{+-t*(*QyUCCVh>5d0=eX00ylBkAxe11Z zT=a%p%sLa4q>lu5ql1u?Q@#UT?L=bOLBNgb(v#Ra8nB!6Ge0M!v%!?^1~w6||0k}U zA^$Vijy0bG7@-ndVKjtf$4v&@a8HdCB3zWOtW$o0zTUM zvGapf9;whZ>WcEBW#Q7Nmh|h&jhFz7AyRLW9OFaJ_r>dK$v~o~F}0-E800^{Wq!kK z-nA_L5{`Gr28829c#|q&f>)dF*R`q? zgX_qEc9}wR*ufQuSV^nupwcU)-_(&lrr?H;+2IYJa6V`y?Xj0^$JR)_mnfYp1PT;C zq6R1AfooK}C}e(_qL=CS*t$tAn{Ji+G>z31yWhzas|2?bmwDt{uvvoiARVk8Jo0S- z!n}IP#il6sL=?LLxO4uRulEv}qm1_6M>cXDUumFkffH7gSoJ1wnmC%ikMthJYC%Av z0^QEh!xdFE*%}OTu-@p!$zX+DAJ~|XTjdVaZX$w|;tu-PqkSgT%$gky_upw~JX2Gn z3*8;PJDwU-gpz<9VBwQ9=_t_}+W_l_VPN_Ul?s4jMkSv1sto|U`D32k{+B zXNAelm(o)>)1&h530FJwe*4dat8^=JHGF^OO}Q}O_3kloobdmd)EhxW3Iu9)giL7F z6;3%qYSv<1`(h2eVJsw_sDPI?A~lR=wFpP0D=hUrKMtFg|1j=Dc5Z4iLWN+n1j;nF zXU0;QcjE*QP+BM)bcDS9~3GjJ#kd#C@`llkIE}Db2_G;j07K#@q%xTdvVgsq7WEGdCik1GrcJcO$5Ija}IlrgH-JEj_?1F6IO`h{|kDca#Q8DY6Wm~mp7IEcY%{&8JiyN&!(@Oa8%^5Py@KSBv z-Pjf}@7Qn=jK`dELdkxXLIM8UM87&qoVtTiXvqoRD;Y^ZS0sWthYKi9GeSQoOM{L> zub@1ew~cL{8FRy!ARGehGcmUygr`#>OQwje`XkAVn75JS@G_ti4RR6`lm2+FRoUZk zo=k$O*_>YtJx|tkHJS-=UY^>`JhX69HdhFWe)QRS(v>9BpU-20rF41|vF?mT%dk7( zON1~BY#9Krr0s@@R=o#8`G7r*Sjsn)tSfu%1q9AS>9rS9SN!)H>XN<24%6uu$eP($ z#0|S;%E6=ghmfN(=+|lATBzf`xVPp74^E@}nw_kCr}F(>9~@Y9PwJSZ%hu_Er_I)8 zYvdri^xX?&V0(6+{UbHwUn!#d8Y+hMvq2^QBO~FALoHPQQYZ*9HwpFo5K$6(yK;7n zPP|Cgy&<+YI%Omlge-=ckt=gbFM^%Hl|H>lCiF@Zo*4%~v9#`!%!H=#Tt>%B4#D-D z-A_qJULw=mU}g%qM0yXzh5vb=(W95hM6-mv)O7mt5}7g!4}rn&Y%7BwrtaxN1Q`5c z!QhvzH8BllX}~miB5N&}2DK$w@iY_+e(p)xg`6;$7h*<#Kp3DTaq3Sda<-{|L)Ss) zT_z4Zya0{I0oOz}mhUe_t4A4rVF}u*;`WCs=x-n zb2VFQH$aTj&o2{ykm$g&RqW4f1wQdgzjCy<8Ox??ufUcG^_KsJy^A1tRj?0SAwxU% z0U4*{qAN6M+h<&DWesq?Y9gB8thi(UAME8U9P8+R1KYJ3D<~gdz7FmsuFAqvL-FIv zD~^sUSMb4vsJ<1(RW$Tk>kf9`H8Pf09(Z+TUL)hWnZaF<8L-QKvE(PNk=iUq75iiN z@WVBk+e3Ms47KB|EPmYOu=R&!?OzS`aXW z2*H*G#wJDVIb9)-bIx_h$>MM!ASa@*CLuo~2{idU#AHoX;Ta4nEa9fC5mSw^C+00N%_B7CAD6MV9=OduKnkl2(E~rZ`_tw)Jj@@o7n$zKyCWTZBDx5 zB+zbm$l$p+0DIz16m6AortV_-VLjrZ06ys4JlCG!!Q zfbO|VW|*O+4$v`o;h&9L>?c7fe#NcY7U!>NO4ZzKXMC;sV-EF$^ZBw3tt5yoSX5x1 zIet8@LiV8%uZgwI*P3f9JxhH<4@K4iTVfn0eAI9(#;q}^KKB0#E-Y+RmB&`az!yhd zE^l{~cRb!sr?&5qnVs2e(WVHbGoTO*^SKD+-*2?>9b)Uv!B&7*B?{PaZ{YQ|+6Q~N zV~yu(sYOj+rTw~jwa^rUxRoyhNpdO zNV1`&kBz)cQ@jgJAy*5pesysBT{5lRDZnHIE8rby&bwsbmYzagUE(41jug(DoCr0j zHHQuj;YhYt=v=n0LSdVHGb2$JDT~%D3v%MMj?fCZ@@{e5MkQ7XW~P;bnQ5h9##ahv z?65%Ry+>wDLVucTII-eIQ6Ls11-c?xLjrgfFjm|>AK)-0TuqF#@iDfLIvI*edy5pqz@Mmh68DOndXPCxle|2&BxSaSIDxi2t%RfgS5@_On9x} zdZq;}xK9?U<_WV?Hu)^8a!*T1Pc^8xBB1ArQ{GH3H1HstW}c7{G+&piQfswpRjxMQ zHa`~^w7F`P4i_LqY?bUi+3Voduae!D&tLtrdr~Oq&fgJKQR;Bm%Q8}7T~9#VRBQhL zy8L}2s6ab@7N`#sB*8djDl9!f`vYq&g<=VhK-v2XD|e-*#g*$*VKUDVKM^>Yh+Yw? z2~EKiuUA<6`av)CPXzB5RZ4bJYzs=S*Mv+<>7+<<;*4FmgZas39Lmuzk}TQD=C<+e zczk(mE=3&;eILdyI7XpE?quoGPRQs~luEk!^6fQ+|F6P_A3VG=OKo5m#I%!5r+ z^#`Qau*X;?CBT79W^2CA2*}!HIwY`GgZ*8mL&Bl91awHW?gL`)1iJ$k2#@gu~n@nTd(6d`N7% z0yUg2wW*QNTD2SD4iyD+9F-oBQRA^-Q?hI@+dNAHQI=Q_9w||+Pn1iN(HwwT8=noo zJxhiX=@T`@D4}7i?Ko=vh>SyzH{a{GdCwAAS!Z}i?5ww$P*EI3v>S1$jRdgCTybut zC&<>k9|1fnudd6dSI*uwi2$MH{f?+CM0R%lHw2#2s_{m zg|))sj_#f0+X*yFNBew81lhA@)Q5m8VweZjpW!G-S<9^3$}1g}29Tw02D@PoHB^Q6ELEJ1I^}Nph$|onz5au^W;VVqw zUYOfC>N8y-$FxbefCglzsHc4%ldhZwt5&>-wP9y^>qBBgfBujR9t>*w9`X4+w70@q z>bPQ>)V9_+J+;IiS_g$~^L`URisOuSJ|=@yIyjpd%*0s4yprukVdnGe=VQjgR+e{8 zj9VGZ*NVPISG>mewJPP4s|PQi)u-^-t!esXZlU4PbpjjFzAo-=0QUWX9zz&KghS@9 zm4R!l>5&vDJ_1V4`LXk3nz;$WL?u23IrsSkSHYwi4}X&+1CR9aWuuI-1R4{&NB|1U zIJ~gTq7_t*6AM6jjQ~c!f`W?K!s>mIm`e3&;yx1u++9Y#R=Wel3Pr{yHZ%B2^D4=u zaHpoU!YeP*?@X31DT|grA+J;SC!`;3d_ww8lNVd?{lj7_FHc@<#pkDFAv}0yk;0IJ zJ+n=~ixXGgfo?p$zz`EtBl8Pna<;!rQ52}>Q_`n1;w4X4pGCan`uXrOD-`bvH0db} zib_MoFk5PeB<7%BWuMWjPs#WJQYNKJ8uW?(XfkaibW5 z&>f0@<;7u(fD06RLA~{iSgWw6x)9iiuJZ^P8EwqhfdUi^=Pfqo=*x>_a6B?Lu7o=y z*6NRd1f41&SeM*D7)@A#$$-uwEbt*uQN{~iW|5Hqo2o8HvGp=HIa#CeIq3lIVZDaI z4okUYpO^#Ygs!t2r{jHS0Lx+sQl*Sql>v~d-P#g=@atmQkKc9!9n>*>>0Ksl2Wn63 z^su=Ts1`Qj^Cm;okvC?GIJKnyN@H$#zaFl1pvnV{7s zrW+>;iUghQ#wS?R@kqF~GHDW2ZTt4`DmjoJIVdk0T5+8m3E*^DAZFptV3Z;|v|{~_C17z{kGxa3`*3+amHC9}Cc!y;YbJt3X@7WwlUO))-wgVYyv>n1*DlDGfTK5?Thbh@ys3Rk?wDLzkXu?2tevIA+6NitxAx^egdxMHOHAfxT zm>&UMk-`=lWRwm-d>IY?3Ok<_pFr{PCb;e&fLi5`|8Q-rau2T8EBX&?bfv0Ki6#C0 z6Jn(@eY2VP()7(QP2Y^Fay@f<3$x(cZy5P`%scUx00=V5T3x9v<~;t{IfdL&9)$kU z=tqtMpTu-Lx-A@n6LQm1__S+_3H`WWkSvqH%Z^;{W+*;q6O%Krhh+BBYoE~{J|)&` zkm>2%laU5P9i};__XP#L#xzDr`&N zPQcC|ck@t`+#{(Ovf7iAEo3NI6F}||s<*gDp&T>IM5_>fKvT*|sxgzvK}2~sGUsb9 zB{!!jxi7!9N-xe5qV{l$Rbrm5Ku4j-%Lki(^yN#?DwlghSp!h^K2Gk$jl+VyTzs)y#xL%ej+Oq_Aak@aRQ;QeTJKHO2mUk=t%X z)dGj0Pt4I4CFFy6P?cm6|0E+();4iEI?!a}7YddntV+<+!+Cq&U>YZ{Yw5`~E~rfZ zs1Qu#x<4=c)vS5X-6&9h@7 z;b;Y;S7r!6i`HU*pt@5BFZ7*C%$GLNOAN7xmmpa@_h>SAl?gfFWVdo3yx=Ttx9%tf zAu(=j#$Gi84WmONa{M&vfi=D4T*X%6+`Ez^d_Q>L+g6Z#_yIZg6Qm;NYQP`P5r7Rl z)JU1qSR0J~bOpvkk_C^KZo?V8m7MrO!3B>EUGW9!))|8gF}xa32>-x9m2YC6mWF>p zdYjAjPrE&bBL0<^`yW2>U;{9*f>gV67x>s$vtJ>1m=~W2jqb}1p#0DvUp8rw6S-{y z^H7H9j}>1Q>Hw9^J>g?DIU0Dv=j9c0@A-Rxhv&12_nJq}VH2D4rHOOUi$_e6dFa@_7m5Qp_m;W8t4rj{ zBtuN~-gQyC(^C)lf|624H6{uJE=i1zk6Ik3aJj+x0x;IHwSjPQ;p03|=47-Un~)p3 z3t{I_U5Vb8QC%DP_~d&AK0f83w=bmmB~Uk@l0RDeIXX!Sn9CG4=e;kX@!;CQUNfNR z6yO5Xs79m0lED^K2I&eQo8_Jk&JqjG`Vj7pEmF&n`23>_A*Z8NV3Xgwp%@X`6VVgl z)w_~QC4ALc;Gj7ixn+d~LafUq&j=*k%2g9ok3ggp3z77cEY3S(;(B2Yx4!xI+gn2< z2d;6S5ONqrLr(8y>^*TWKZ>vEtoLrfH97P;y4eh6rb5MOj0_9d3@+^~^l3?+r0_inOR!wzE7SHR3Sza-uX{KYN~T%vQ>uI z{78gDNJ&OmR2@yq$x$?{NP&-{H6mxmz(&ex3ME^qtGtAe1&T#F_%#vYF#}}oSi#04 z+h{~WQ~2-HdSb?ArDZ$P6_b@FzP>~_*M1A#uqrpkI3J?I^853Fb7pP!l+5;SMzn%I zxO@1}lf!f*H~Xij$^k_FATTiv6Kr?kJC$OZL-pqQ;gw$K$m}b;e&qo^{&`1~$s5pj zOfwq}K3)DDI#GTU-d`AqPr+z5WtWms;SH)QgQEL{^AnH+X}Qk=a+9C6#Hz*uGL>J$ z;5V(%w^Vpmc;-jy6J#?XMxV4SL1nV`Jp~C#3m8tgRThJj<--9-VZ~Lf=sybEO)6c5 zS7vNH%~m1U6H+KFGB9Vn1D6l33TJ^_Nb_EAo(WmqLLLSkbGsW^cXYwg1%;vMsho@p z9chIU(QeT)3hX6ft59OD;8GR^p$oykR$(p&9mqsFOHLi|5>!td<`0sFDUxdIq2+wF zVx0dCk7p(gSF$>cVg)|Y_foOH&jmaliO~wngkCnZO3Hzzfg0*|7nSS0g@yi~qRuX~ ztul<`f}R9+<4ZAKtdJ;9VK*XUI=mQjTX8UPY{(WBr_xXzv|X1r4QZ40r1}0%^VO#5 zXr1k*URdYEbp67*yIsW#MdpQy6G8A+4)q}Td)}ypQcmbOId9+hd7rQMdH#QC0?-d` z*zZ@PY@^M${Oy}>^CTeR%Cog`<&I!H7|9wkchM`9V0GvPq8j!v zC9H8_g?Rjz*MDY48oN*Ii<;>QGcy9g7KKVYP0koCXdkg2DrG1;E-2;rspEa%>+qjj z{V?VNgTc+fk7 zL?IB%{i9$w=#WOar(eZ3;$<1aMZBBdS7A`}%x5XyrZ#tfXNZCBkxRpd0lb=f&3d|9 z8HuAK$!z=-*WKC6mbWl4I_is*66Z`|wB=j*(aYZmGZs}11i6HQ2mlxOUAW!ltqlc?I9_&~vX_3(Q* ztp;N`J#_0#E5LQ48EY{Q*Q!&odF#uF)Y~wg_B!`lsZY-#gxg!GItm9TXeLHnMj@M2 zClF*gtcDa+bM3ZVeZVMxTQl1yx*6s}=f8oL)O@(}opKzrdxT|;mjMUW1%%?J#zeME zL3`X>ip?v>_f}7tYJu+H8Uxv)F5`@~;`52QL{k#T^8n`7%*DtG!~6KKeSAGAd-mXc z+4;GWM>-$U-b_AAZGN@{>q{*%7c%EU@s_!0F2Zi5M8uueV;4HMbLu*4vORv|l0Sd} z{mVG6QvnCwytwqqpnr|d6xQt+p!))Os(b0Wegq7oJ$AqC`_q0@rsuFopYx`2$2O`_ zJ=1|(k(H~<;g80?@LP9FY2pPY=b0auKa4bkp~zHVtX0g!pm`7#`ie3hymS6H*~v~M zzTcW0-eyz&ODw5#{V)X;rRKj^+gf{P<%3HL{$}99ubLrB&JBBQr!02w@At?v2qq7B zhjcsO*lM-}GrBas%FDot?+RwG=3CJE8cRHz&dlHin%Qx7Qa;A{RTu8JJR8+5vgoK}%S47a5QZsR$|ai3BbwQv z`TG)0?&g%NmYb|bXG6hNZYgO`8qTd`Lo_n_hAc4i4|+3B2F}G-eA^;g;Lr=+)z9Bu z9%xM1Z}`{JwNyQP!}bpCq-bJ@tQ6GOT|?q1C)+0~%5+BU=bFKKxK43JYxI%-oeuQ$ z?pg3)&N{fVP68Qo(h(O63kr0pbiENKBuP>LQBG3j2w8b4t&G0gr^VhqwTGp|VSSZ5 w%&JLmMuLqVD ints) it's no longer # over the 65535 bytes limit; the long charstring in 'CJK-VarTest2.otf' is # already as small as possible, so it will trigger the check in cffwrite.c - actual_path = runner(CMD + ['-o', 'cff2', '-f', 'CJK-VarTest2.otf']) + font_path = _get_input_path('CJK-VarTest2.otf') + cff2_path = _get_temp_file_path() + runner(CMD + ['-a', '-o', 'cff2', '-f', font_path, cff2_path]) expected_path = _get_expected_path('CJK-VarTest2.cff2') - assert differ([expected_path, actual_path, '-m', 'bin']) + assert differ([expected_path, cff2_path, '-m', 'bin']) def test_many_hints_string_bug354(): # The glyph T@gid002 has 33 hstem hints. This tests a bug where # tx defined an array of only 6 operands. # This is encountered only when wrinting to a VF CFF2. - cff2_path = runner(CMD + ['-o', 'cff2', '-f', 'cff2_vf.otf']) - dcf_txt_path = runner(CMD + ['-a', '-f', cff2_path, '-o', 'dcf']) + font_path = _get_input_path('cff2_vf.otf') + cff2_path = _get_temp_file_path() + dcf_path = _get_temp_file_path() + runner(CMD + ['-a', '-o', 'cff2', '-f', font_path, cff2_path]) + runner(CMD + ['-a', '-o', 'dcf', '-f', cff2_path, dcf_path]) expected_path = _get_expected_path('cff2_vf.dcf.txt') - assert differ([expected_path, dcf_txt_path]) + assert differ([expected_path, dcf_path]) def test_non_varying_glyphs_bug356(): @@ -261,16 +276,20 @@ def test_non_varying_glyphs_bug356(): support code assumed that this was an error, and issued a false warning. File 'bug356.otf' is a handcrafted modification of 'cff2_vf.otf'. The latter cannot be used as-is to validate the fix.""" - stderr_path = runner(CMD + ['-r', '-e', '-o', 'cff', '-f', 'bug356.otf']) + actual_path = _get_temp_file_path() + font_path = _get_input_path('bug356.otf') + stderr_path = runner(CMD + ['-s', '-e', '-a', '-o', 'cff', + '-f', font_path, actual_path]) expected_path = _get_expected_path('bug356.txt') assert differ([expected_path, stderr_path, '-l', '1']) def test_illegal_chars_in_glyph_name_bug473(): + font_path = _get_input_path('bug473.ufo') save_path = os.path.join(_get_temp_dir_path(), 'bug473.ufo') - ufo_path = runner(CMD + ['-o', 'ufo', '-f', 'bug473.ufo', '-s', save_path]) + runner(CMD + ['-a', '-o', 'ufo', '-f', font_path, save_path]) expected_path = _get_expected_path('bug473.ufo') - assert differ([expected_path, ufo_path]) + assert differ([expected_path, save_path]) def test_subroutine_sorting_bug494(): @@ -280,8 +299,11 @@ def test_subroutine_sorting_bug494(): The bug is that two subroutines in the Windows CFF output are swapped in index order from the Mac version. This was because of an unstable 'qsort' done on the subroutines in the final stage of selection.""" - cff_path = runner( - CMD + ['-o', 'cff', '*S', 'std', '*b', '-f', 'bug494.pfa']) - dcf_txt_path = runner(CMD + ['-a', '-f', cff_path, '-o', 'dcf']) + font_path = _get_input_path('bug494.pfa') + cff_path = _get_temp_file_path() + dcf_path = _get_temp_file_path() + runner(CMD + ['-a', '-o', 'cff', '*S', 'std', '*b', + '-f', font_path, cff_path]) + runner(CMD + ['-a', '-o', 'dcf', '-f', cff_path, dcf_path]) expected_path = _get_expected_path('bug494.dcf.txt') - assert differ([expected_path, dcf_txt_path]) + assert differ([expected_path, dcf_path]) diff --git a/tests/type1_test.py b/tests/type1_test.py index 0cbc9d9e5..cfc86a28c 100755 --- a/tests/type1_test.py +++ b/tests/type1_test.py @@ -31,6 +31,6 @@ def test_exit_unknown_option(arg): def test_run_on_txt_data(): - actual_path = runner(['-t', TOOL, '-f', 'type1.txt']) + actual_path = runner(['-t', TOOL, '-s', '-f', 'type1.txt']) expected_path = _get_expected_path('type1.pfa') assert differ([expected_path, actual_path]) From 166fd3c3cd2425aac76992c03dc93c1be22e5000 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Fri, 14 Sep 2018 22:10:13 -0700 Subject: [PATCH 18/26] [runner] No need to add '.exe' for Windows --- python/afdko/makeinstancesufo.py | 18 +++++------------- tests/runner.py | 9 ++------- tests/runner_test.py | 6 +----- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/python/afdko/makeinstancesufo.py b/python/afdko/makeinstancesufo.py index bb78e2e4a..3cf3b7133 100755 --- a/python/afdko/makeinstancesufo.py +++ b/python/afdko/makeinstancesufo.py @@ -23,7 +23,7 @@ from afdko.ufotools import validateLayers __usage__ = """ - makeinstancesufo v1.5.0 Aug 28 2018 + makeinstancesufo v1.5.1 Sep 14 2018 makeinstancesufo -h makeinstancesufo -u makeinstancesufo [-d ] [-a] [-c] [-n] [-dec] @@ -214,12 +214,8 @@ def updateInstance(options, fontInstancePath): opList = ["-e", fontInstancePath] if options.allowDecimalCoords: opList.insert(0, "-d") - if os.name == "nt": - opList.insert(0, 'checkoutlinesufo.exe') - proc = Popen(opList, stdout=PIPE) - else: - opList.insert(0, 'checkoutlinesufo') - proc = Popen(opList, stdout=PIPE) + opList.insert(0, 'checkoutlinesufo') + proc = Popen(opList, stdout=PIPE) while 1: output = tounicode(proc.stdout.readline()) if output: @@ -246,12 +242,8 @@ def updateInstance(options, fontInstancePath): opList = ['-q', '-nb', fontInstancePath] if options.allowDecimalCoords: opList.insert(0, "-dec") - if os.name == "nt": - opList.insert(0, 'autohint.exe') - proc = Popen(opList, stdout=PIPE) - else: - opList.insert(0, 'autohint') - proc = Popen(opList, stdout=PIPE) + opList.insert(0, 'autohint') + proc = Popen(opList, stdout=PIPE) while 1: output = tounicode(proc.stdout.readline()) if output: diff --git a/tests/runner.py b/tests/runner.py index b011912c4..2d92bdb84 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -12,12 +12,11 @@ import argparse import logging import os -import platform import subprocess32 as subprocess import sys import tempfile -__version__ = '0.6.0' +__version__ = '0.6.1' logger = logging.getLogger('runner') @@ -30,9 +29,7 @@ def _write_file(file_path, data): f.write(data) -def _get_input_dir_path(tool_path): - # Windows tool name contains '.exe' - tool_name = os.path.splitext(os.path.basename(tool_path))[0] +def _get_input_dir_path(tool_name): input_dir = os.path.join( os.path.split(__file__)[0], '{}_data'.format(tool_name), 'input') return os.path.abspath(os.path.realpath(input_dir)) @@ -96,8 +93,6 @@ def _check_tool(tool_name): Returns the tool's name if the check is successful, or a tuple with the tool's name and the error if it's not. """ - if platform.system() == 'Windows': - tool_name += '.exe' # XXX start hack to bypass this issue # https://github.com/adobe-type-tools/afdko/issues/348 if tool_name.split('.')[0] in ('sfntdiff', 'sfntedit'): diff --git a/tests/runner_test.py b/tests/runner_test.py index b669c0202..be4277ff9 100755 --- a/tests/runner_test.py +++ b/tests/runner_test.py @@ -1,6 +1,5 @@ from __future__ import print_function, division, absolute_import -import platform import pytest import subprocess32 as subprocess @@ -22,10 +21,7 @@ def test_check_tool_error(tool_name): @pytest.mark.parametrize('tool_name', ['detype1', 'type1']) def test_check_tool_unhacked(tool_name): - expected_name = tool_name - if platform.system() == 'Windows': - expected_name += '.exe' - assert _check_tool(tool_name) == expected_name + assert _check_tool(tool_name) == tool_name def test_capture_error_message(): From 1bd10667af214af4974a577eaaa52ebd3e8b9060 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 17 Sep 2018 00:20:48 -0700 Subject: [PATCH 19/26] [sfntedit] Fix exit codes Fixes #348 --- c/sfntedit/source/main.c | 44 ++++++++++++++++++---------------------- tests/sfntedit_test.py | 26 +++++++++++++++++++----- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/c/sfntedit/source/main.c b/c/sfntedit/source/main.c index 2223e669a..864a416ac 100644 --- a/c/sfntedit/source/main.c +++ b/c/sfntedit/source/main.c @@ -185,7 +185,7 @@ static void cleanup(int code) { /* Print usage information */ static void printUsage(void) { - fprintf(stderr, + fprintf(stdout, "Usage:\n" " %s [options] []\n" "OR: %s -X \n\n" @@ -209,20 +209,19 @@ static void printUsage(void) { /* Show usage information */ static void showUsage(void) { printUsage(); - quit(0); } /* Show usage and help information */ static void showHelp(void) { printUsage(); - fprintf(stderr, + 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(stderr, + 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" @@ -230,42 +229,42 @@ static void showHelp(void) { "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(stderr, + 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(stderr, + 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(stderr, + 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(stderr, + 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(stderr, + 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(stderr, + 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" @@ -274,7 +273,6 @@ static void showHelp(void) { " 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"); - quit(0); } static void makeArgs(char *filename) { @@ -525,10 +523,10 @@ static int parseArgs(int argc, char *argv[]) { break; case 'u': showUsage(); - break; + exit(0); case 'h': showHelp(); - break; + exit(0); default: fatal(SFED_MSG_UNRECOGOPT, arg); } @@ -635,21 +633,21 @@ static void sfntReadHdr(void) { static void sfntDumpHdr(void) { int i; - fprintf(stderr, "--- sfnt header [%s]\n", srcfile.name); + fprintf(stdout, "--- sfnt header [%s]\n", srcfile.name); if (sfnt.version == 0x00010000) - fprintf(stderr, "version =1.0 (00010000)\n"); + fprintf(stdout, "version =1.0 (00010000)\n"); else - fprintf(stderr, "version =%c%c%c%c (%08x)\n", + fprintf(stdout, "version =%c%c%c%c (%08x)\n", TAG_ARG(sfnt.version), sfnt.version); - fprintf(stderr, "numTables =%hu\n", sfnt.numTables); - fprintf(stderr, "searchRange =%hu\n", sfnt.searchRange); - fprintf(stderr, "entrySelector=%hu\n", sfnt.entrySelector); - fprintf(stderr, "rangeShift =%hu\n", sfnt.rangeShift); + 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); - fprintf(stderr, "--- table directory [index]={tag,checksum,offset,length}\n"); + fprintf(stdout, "--- table directory [index]={tag,checksum,offset,length}\n"); for (i = 0; i < sfnt.numTables; i++) { Table *tbl = &sfnt.directory[i]; - fprintf(stderr, "[%2d]={%c%c%c%c,%08x,%08x,%08x}\n", i, + fprintf(stdout, "[%2d]={%c%c%c%c,%08x,%08x,%08x}\n", i, TAG_ARG(tbl->tag), tbl->checksum, tbl->offset, tbl->length); } } @@ -1245,7 +1243,5 @@ int main(int argc, char *argv[]) { doingScripting = 0; } - - fprintf(stdout, "\nDone.\n"); return 0; } diff --git a/tests/sfntedit_test.py b/tests/sfntedit_test.py index c0af4aac0..38551a759 100755 --- a/tests/sfntedit_test.py +++ b/tests/sfntedit_test.py @@ -1,6 +1,8 @@ from __future__ import print_function, division, absolute_import import os +import pytest +import subprocess32 as subprocess import tempfile from fontTools.ttLib import TTFont @@ -47,11 +49,25 @@ def _font_has_table(font_path, table_tag): # Tests # ----- -# This test is commented because sfntedit does not exit with 0 -# def test_no_options(): -# actual_path = runner(CMD + ['-r', '-f', LIGHT]) -# expected_path = _get_expected_path('list_sfnt.txt') -# assert differ([expected_path, actual_path, '-l', '1']) +def test_exit_no_option(): + # When ran by itself, 'sfntedit' prints the usage + assert subprocess.call([TOOL]) == 1 + + +@pytest.mark.parametrize('arg', ['-h', '-u']) +def test_exit_known_option(arg): + assert subprocess.call([TOOL, arg]) == 0 + + +@pytest.mark.parametrize('arg', ['-j', '--bogus']) +def test_exit_unknown_option(arg): + assert subprocess.call([TOOL, arg]) == 1 + + +def test_no_options(): + actual_path = runner(CMD + ['-s', '-f', LIGHT]) + expected_path = _get_expected_path('list_sfnt.txt') + assert differ([expected_path, actual_path, '-l', '1']) def test_extract_table(): From c9183030846fcf2b03727b9bd4c31164f8d7133a Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 17 Sep 2018 00:21:55 -0700 Subject: [PATCH 20/26] [sfntdiff] Fix exit codes Fixes #348 --- c/sfntdiff/source/Dmain.c | 9 +++++---- c/sfntdiff/source/Dopt.c | 15 +++++++++++++++ tests/sfntdiff_test.py | 16 ++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/c/sfntdiff/source/Dmain.c b/c/sfntdiff/source/Dmain.c index 172beca25..4cc02df2f 100644 --- a/c/sfntdiff/source/Dmain.c +++ b/c/sfntdiff/source/Dmain.c @@ -54,7 +54,6 @@ static void printUsage(void) { /* Show usage information */ static void showUsage(void) { printUsage(); - quit(0); } /* Show usage and help information */ @@ -85,7 +84,6 @@ static void showHelp(void) { " e.g., -i cmap,name\n" " will inspect/compare ONLY the 'cmap' and 'name' tables\n"); printf(" -i and -x switches are exclusive of each other.\n"); - quit(1); } /* Main program */ @@ -115,9 +113,12 @@ IntN main(IntN argc, Byte8 *argv[]) { argi = opt_Scan(argc, argv, opt_NOPTS(opt), opt, NULL, NULL); + if (opt_Present("-u") || opt_Present("-h")) return 0; + if (opt_Present("-x") && opt_Present("-i")) { printf("ERROR: '-x' switch and '-i' switch are exclusive of each other.\n"); showUsage(); + return 1; } if (level > 4) level = 4; @@ -125,6 +126,7 @@ IntN main(IntN argc, Byte8 *argv[]) { if ((argc - argi) < 2) { printf("ERROR: not enough files/directories specified.\n"); showUsage(); + return 1; } filename1 = argv[argi]; @@ -303,8 +305,7 @@ IntN main(IntN argc, Byte8 *argv[]) { } else { printf("ERROR: Incorrect/insufficient files/directories specified.\n"); showUsage(); + return 1; } - - /*printf( "\nDone.\n");*/ return 0; } diff --git a/c/sfntdiff/source/Dopt.c b/c/sfntdiff/source/Dopt.c index 1b314cd5f..018ae3c93 100644 --- a/c/sfntdiff/source/Dopt.c +++ b/c/sfntdiff/source/Dopt.c @@ -8,6 +8,7 @@ #include #include +#include #include #include "Dopt.h" @@ -99,6 +100,16 @@ void opt_Error(int error, opt_Option *opt, char *arg) { global.error += global.handler(error, opt, arg, global.client); } +bool is_known_option(char *arg) { + const char *known_options[] = {"-u", "-h", "-T", "-d", "-x", "-i", "-X"}; + int num_opts = sizeof(known_options) / sizeof(known_options[0]); + int i; + for (i = 0; i < num_opts; i++) + if (strcmp(arg, known_options[i]) == 0) + return true; + return false; +} + /* Process argument list */ int opt_Scan(int argc, char *argv[], int nOpts, opt_Option *opts, opt_Handler handler, void *client) { @@ -138,6 +149,10 @@ int opt_Scan(int argc, char *argv[], argi = 1; while (argi < argc) { char *arg = argv[argi]; + if (arg[0] == '-' && !is_known_option(arg)) { + opt_Error(opt_Unknown, NULL, arg); + exit(1); + } opt_Option *opt = lookup(arg, matchWhole); if (opt != NULL) /* Whole argument matched option */ diff --git a/tests/sfntdiff_test.py b/tests/sfntdiff_test.py index fea24f811..5f8b75122 100755 --- a/tests/sfntdiff_test.py +++ b/tests/sfntdiff_test.py @@ -1,6 +1,7 @@ from __future__ import print_function, division, absolute_import import os +import subprocess32 as subprocess import pytest from .runner import main as runner @@ -19,6 +20,21 @@ def _get_expected_path(file_name): # Tests # ----- +def test_exit_no_option(): + # When ran by itself, 'sfntdiff' prints the usage + assert subprocess.call([TOOL]) == 1 + + +@pytest.mark.parametrize('arg', ['-h', '-u']) +def test_exit_known_option(arg): + assert subprocess.call([TOOL, arg]) == 0 + + +@pytest.mark.parametrize('arg', ['-j', '--bogus']) +def test_exit_unknown_option(arg): + assert subprocess.call([TOOL, arg]) == 1 + + @pytest.mark.parametrize('args, txt_filename', [ ([], 'dflt.txt'), (['T'], 'dflt.txt'), # default diff with timestamp From fbfe610fae3b6a08a6596c7b5794a511db911d0d Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 17 Sep 2018 00:28:12 -0700 Subject: [PATCH 21/26] [runner test] Validate de-hack --- tests/runner.py | 5 ----- tests/runner_test.py | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/runner.py b/tests/runner.py index 2d92bdb84..90fe419cd 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -93,11 +93,6 @@ def _check_tool(tool_name): Returns the tool's name if the check is successful, or a tuple with the tool's name and the error if it's not. """ - # XXX start hack to bypass this issue - # https://github.com/adobe-type-tools/afdko/issues/348 - if tool_name.split('.')[0] in ('sfntdiff', 'sfntedit'): - return tool_name - # XXX end hack try: subprocess.check_output([tool_name, '-h'], timeout=TIMEOUT) return tool_name diff --git a/tests/runner_test.py b/tests/runner_test.py index be4277ff9..c2fd3a420 100755 --- a/tests/runner_test.py +++ b/tests/runner_test.py @@ -19,7 +19,8 @@ def test_check_tool_error(tool_name): assert isinstance(_check_tool(tool_name), tuple) -@pytest.mark.parametrize('tool_name', ['detype1', 'type1']) +@pytest.mark.parametrize('tool_name', [ + 'detype1', 'type1', 'sfntedit', 'sfntdiff', 'makeotfexe']) def test_check_tool_unhacked(tool_name): assert _check_tool(tool_name) == tool_name From e7005716ba66f8531705d3d042907e5ea05ad584 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 17 Sep 2018 00:28:26 -0700 Subject: [PATCH 22/26] minor --- tests/makeotf_test.py | 2 +- tests/makeotfexe_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/makeotf_test.py b/tests/makeotf_test.py index e9ab448be..0d598ae50 100755 --- a/tests/makeotf_test.py +++ b/tests/makeotf_test.py @@ -93,7 +93,7 @@ def test_exit_known_option(arg): assert subprocess.call([TOOL, arg]) == 0 -@pytest.mark.parametrize('arg', ['j', 'bogus']) +@pytest.mark.parametrize('arg', ['-j', '--bogus']) def test_exit_unknown_option(arg): assert subprocess.call([TOOL, arg]) == 1 diff --git a/tests/makeotfexe_test.py b/tests/makeotfexe_test.py index 187b50a71..37d959225 100755 --- a/tests/makeotfexe_test.py +++ b/tests/makeotfexe_test.py @@ -56,7 +56,7 @@ def test_exit_known_option(arg): assert subprocess.call([TOOL, arg]) == 0 -@pytest.mark.parametrize('arg', ['j', 'bogus']) +@pytest.mark.parametrize('arg', ['-j', '--bogus']) def test_exit_unknown_option(arg): assert subprocess.call([TOOL, arg]) == 1 From d8c6d68f5787057bc16e16241f229c3bc443ddee Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 17 Sep 2018 00:59:54 -0700 Subject: [PATCH 23/26] [makeotf test] Update expected TTF results --- .../makeotf_data/expected_output/ttf-dev.ttx | 22 +++++++++---------- .../makeotf_data/expected_output/ttf-rel.ttx | 22 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/makeotf_data/expected_output/ttf-dev.ttx b/tests/makeotf_data/expected_output/ttf-dev.ttx index a113081ce..06b023a0b 100644 --- a/tests/makeotf_data/expected_output/ttf-dev.ttx +++ b/tests/makeotf_data/expected_output/ttf-dev.ttx @@ -103,10 +103,10 @@ - + - + @@ -131,12 +131,15 @@ + + + @@ -236,16 +239,16 @@ - SourceSans + Source Sans Regular - 1.000;UKWN;SourceSans-Test + 1.000;ADBE;SourceSans-Test - SourceSans + Source Sans Version 1.000;hotconv 1.0.109;makeotfexe 2.5.65593 DEVELOPMENT @@ -253,20 +256,17 @@ SourceSans-Test - - Test - - SourceSans + Source Sans Regular - 1.000;UKWN;SourceSans-Test + 1.000;ADBE;SourceSans-Test - SourceSans + Source Sans Version 1.000;hotconv 1.0.109;makeotfexe 2.5.65593 DEVELOPMENT diff --git a/tests/makeotf_data/expected_output/ttf-rel.ttx b/tests/makeotf_data/expected_output/ttf-rel.ttx index 920261284..2744571d3 100644 --- a/tests/makeotf_data/expected_output/ttf-rel.ttx +++ b/tests/makeotf_data/expected_output/ttf-rel.ttx @@ -103,9 +103,9 @@ - + - + @@ -130,12 +130,15 @@ + + + @@ -236,16 +239,16 @@ - SourceSans + Source Sans Regular - 1.000;UKWN;SourceSans-Test + 1.000;ADBE;SourceSans-Test - SourceSans + Source Sans Version 1.000;hotconv 1.0.109;makeotfexe 2.5.65593 @@ -253,20 +256,17 @@ SourceSans-Test - - Test - - SourceSans + Source Sans Regular - 1.000;UKWN;SourceSans-Test + 1.000;ADBE;SourceSans-Test - SourceSans + Source Sans Version 1.000;hotconv 1.0.109;makeotfexe 2.5.65593 From 9331e1c265fc1a951306fda21a8a1ff72cd27f0b Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 17 Sep 2018 14:01:11 -0700 Subject: [PATCH 24/26] Update defcon to 0.5.3. Update pyup config --- .pyup.yml | 7 +++++++ requirements.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.pyup.yml b/.pyup.yml index 8d511bb1e..38677dac0 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -2,3 +2,10 @@ branch: develop schedule: every week + +requirements: + - requirements.txt + pin: False + - requirements-dev.txt + update: False + pin: False diff --git a/requirements.txt b/requirements.txt index f3ff51cda..5716d3ad6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ booleanOperations~=0.8.0 -defcon~=0.5.2 +defcon~=0.5.3 fontMath~=0.4.7 fontPens~=0.1.0 fontTools~=3.29.1 From b7d3dcacfd25a1ef4d0f9018cdc2ccc687c2f3a3 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 17 Sep 2018 16:04:18 -0700 Subject: [PATCH 25/26] Fix pyup yaml [skip ci] Fixes #615 --- .pyup.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pyup.yml b/.pyup.yml index 38677dac0..ff71e893e 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -4,8 +4,8 @@ branch: develop schedule: every week requirements: - - requirements.txt + - requirements.txt: pin: False - - requirements-dev.txt + - requirements-dev.txt: update: False pin: False From bc1e6e3aa05255bb448bbfa8d0f92797268e1ed1 Mon Sep 17 00:00:00 2001 From: Miguel Sousa Date: Mon, 17 Sep 2018 21:43:16 -0700 Subject: [PATCH 26/26] Update NEWS with version 2.8.2 changes --- NEWS.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/NEWS.md b/NEWS.md index cb96f83bb..d42189b56 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,24 @@ Changelog ========= +2.8.2 (released 2018-09-18) +--------------------------- + +- Switched to `autohintexe` from `psautohint` (v1.8.1) package + ([#596](https://github.com/adobe-type-tools/afdko/pull/596), + [#606](https://github.com/adobe-type-tools/afdko/pull/606)) +- Added 64-bit (`win_amd64`) wheel for Windows + ([#609](https://github.com/adobe-type-tools/afdko/pull/609)) +- \[snftdiff/snftedit\] Fixed exit codes + ([#613](https://github.com/adobe-type-tools/afdko/pull/613)) +- \[makeotfexe\] Fixed exit codes + ([#607](https://github.com/adobe-type-tools/afdko/pull/607)) +- \[makeotfexe\] Fixed bug in setting Unicode values + ([#609](https://github.com/adobe-type-tools/afdko/pull/609)) +- \[makeotf\] Fixed calculation of relative paths when the input + paths are not on the same drive + ([#605](https://github.com/adobe-type-tools/afdko/pull/605)) + 2.8.1 (released 2018-09-07) ---------------------------