diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 7f8cceb82..56760852f 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -44,7 +44,7 @@ jobs: env: CIBW_BUILD: "cp39-*" CIBW_ARCHS_MACOS: universal2 - CIBW_ENVIRONMENT_MACOS: "CFLAGS='-arch arm64 -arch x86_64' CXXFLAGS='-arch arm64 -arch x86_64' LDFLAGS='-arch arm64 -arch x86_64'" + CIBW_ENVIRONMENT_MACOS: "CFLAGS='-arch arm64 -arch x86_64 -I/usr/include/libxml2' CXXFLAGS='-arch arm64 -arch x86_64' LDFLAGS='-arch arm64 -arch x86_64'" - name: Build wheel (except macosx_universal2) uses: pypa/cibuildwheel@v2.3.1 @@ -57,7 +57,10 @@ jobs: CIBW_ARCHS_LINUX: x86_64 CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_SKIP: "*musllinux*" - CIBW_BEFORE_ALL_LINUX: yum install -y libuuid-devel + CIBW_BEFORE_ALL_LINUX: "yum install -y libuuid-devel && yum install -y libxml2-devel" + CIBW_BEFORE_BUILD_WINDOWS: "code --install libxml2" + CIBW_ENVIRONMENT_LINUX: "CFLAGS='-I/usr/include/libxml2'" + CIBW_ENVIRONMENT_WINDOWS: "CFLAGS='-I/usr/include/libxml2'" - name: Build sdist (Ubuntu only) if: matrix.os == 'ubuntu-latest' diff --git a/.github/workflows/run_cvg.yml b/.github/workflows/run_cvg.yml index 1af17316f..0ea1d1ddb 100644 --- a/.github/workflows/run_cvg.yml +++ b/.github/workflows/run_cvg.yml @@ -29,7 +29,6 @@ jobs: if: github.event_name == 'workflow_dispatch' run: | echo "Reason for triggering: ${{ github.event.inputs.reason }}" - - name: Check out uses: actions/checkout@v2 with: @@ -42,22 +41,18 @@ jobs: - name: Build AFDKO wheel env: - CFLAGS: '--coverage' + CFLAGS: '--coverage -I/usr/include/libxml2' run: | python -m pip install --upgrade pip python -m pip install build>=0.7.0 python -m build --wheel - - - name: Install AFDKO wheel run: | python -m pip install dist/*.whl -q - - name: Generate Python and C coverage run: | python -m pip install pytest-cov -q python -m pytest tests --cov --cov-report=xml --color=yes - - name: Upload coverage results run: | bash <(curl -s https://codecov.io/bash) -y .codecov.yml diff --git a/CMakeLists.txt b/CMakeLists.txt index e9c8c08e5..9ce80598c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,14 @@ set(ANTLR4_WITH_STATIC_CRT OFF) set(ANTLR4_TAG tags/4.9.3) include(ExternalAntlr4Cpp) +FIND_PACKAGE(LibXml2) +IF (NOT ${LibXml2_FOUND}) + MESSAGE(STATUS "Could not locate LibXml2, will install externally.") + set(LIBXML2_TAG tags/v2.9.13) + include(ExternalLibXML2) +ENDIF(NOT ${LibXml2_FOUND}) +include_directories(${LIBXML2_INCLUDE_DIR}) + # sanitizer support # work around https://github.com/pypa/setuptools/issues/1928 with environment # variable diff --git a/c/makeotf/lib/cffread/CMakeLists.txt b/c/makeotf/lib/cffread/CMakeLists.txt index 5497ab7a2..9a400fdef 100644 --- a/c/makeotf/lib/cffread/CMakeLists.txt +++ b/c/makeotf/lib/cffread/CMakeLists.txt @@ -1,4 +1,18 @@ add_library(makeotf_cffread STATIC cffread.c) -target_compile_definitions(makeotf_cffread PRIVATE $<$:CFF_DEBUG=1> CFF_T13_SUPPORT=0) +target_include_directories(makeotf_cffread PRIVATE AFTER $<$:${ANTLR4_INCLUDE_DIRS}>) + +if (${LibXml2_FOUND}) + target_link_libraries(makeotf_cffread PUBLIC ${LIBXML2_LIBRARY}) +else () + add_dependencies(makeotf_cffread ${LIBXML2_TARGET}) + if (WIN32) + target_link_libraries(makeotf_cffread PUBLIC ${LIBXML2_WIN_LIBRARIES}) + else () + target_link_libraries(makeotf_cffread PUBLIC ${LIBXML2_NONWIN_LIBRARIES}) + endif() +endif() +target_link_libraries(makeotf_cffread PUBLIC antlr4_static) + +target_compile_definitions(makeotf_cffread PRIVATE $<$:CFF_DEBUG=1> CFF_T13_SUPPORT=0) diff --git a/c/makeotf/lib/hotconv/CMakeLists.txt b/c/makeotf/lib/hotconv/CMakeLists.txt index 82257bf2f..3cceceeab 100644 --- a/c/makeotf/lib/hotconv/CMakeLists.txt +++ b/c/makeotf/lib/hotconv/CMakeLists.txt @@ -71,6 +71,17 @@ set_property(TARGET hotconv PROPERTY C_STANDARD 99) target_include_directories(hotconv PRIVATE AFTER $<$:${ANTLR4_INCLUDE_DIRS}>) target_link_libraries(hotconv PUBLIC antlr4_static) +if (${LibXml2_FOUND}) + target_link_libraries(hotconv PUBLIC ${LIBXML2_LIBRARY}) +else () + add_dependencies(hotconv ${LIBXML2_TARGET}) + if (WIN32) + target_link_libraries(hotconv PUBLIC ${LIBXML2_WIN_LIBRARIES}) + else () + target_link_libraries(hotconv PUBLIC ${LIBXML2_NONWIN_LIBRARIES}) + endif() +endif() + if ( CMAKE_COMPILER_IS_GNUCC ) target_compile_options(hotconv PRIVATE -Wall -Wno-attributes) # set_source_files_properties(${GENERATED_SOURCES} PROPERTIES COMPILE_FLAGS -Wno-attributes) diff --git a/c/makeotf/lib/pstoken/CMakeLists.txt b/c/makeotf/lib/pstoken/CMakeLists.txt index 2bb9e98e5..1f928976f 100644 --- a/c/makeotf/lib/pstoken/CMakeLists.txt +++ b/c/makeotf/lib/pstoken/CMakeLists.txt @@ -1,3 +1,14 @@ add_library(makeotf_pstoken STATIC pstoken.c) +if (${LibXml2_FOUND}) + target_link_libraries(makeotf_pstoken PUBLIC ${LIBXML2_LIBRARY}) +else () + add_dependencies(makeotf_pstoken ${LIBXML2_TARGET}) + if (WIN32) + target_link_libraries(makeotf_pstoken PUBLIC ${LIBXML2_WIN_LIBRARIES}) + else () + target_link_libraries(makeotf_pstoken PUBLIC ${LIBXML2_NONWIN_LIBRARIES}) + endif() +endif() + target_compile_definitions(makeotf_pstoken PRIVATE PSTOKEN_DEBUG=1 CFF_DEBUG=1 CFF_T13_SUPPORT=0) diff --git a/c/makeotf/lib/typecomp/CMakeLists.txt b/c/makeotf/lib/typecomp/CMakeLists.txt index b3bc439af..39cbd8a58 100644 --- a/c/makeotf/lib/typecomp/CMakeLists.txt +++ b/c/makeotf/lib/typecomp/CMakeLists.txt @@ -45,6 +45,17 @@ add_library(typecomp STATIC tc.c ) +if (${LibXml2_FOUND}) + target_link_libraries(typecomp PUBLIC ${LIBXML2_LIBRARY}) +else () + add_dependencies(typecomp ${LIBXML2_TARGET}) + if (WIN32) + target_link_libraries(typecomp PUBLIC ${LIBXML2_WIN_LIBRARIES}) + else () + target_link_libraries(typecomp PUBLIC ${LIBXML2_NONWIN_LIBRARIES}) + endif() +endif() + target_compile_definitions(typecomp PRIVATE TC_HINT_CHECK=1 TC_T13_SUPPORT=0 diff --git a/c/makeotf/source/CMakeLists.txt b/c/makeotf/source/CMakeLists.txt index 21ed70585..5f15b3a02 100644 --- a/c/makeotf/source/CMakeLists.txt +++ b/c/makeotf/source/CMakeLists.txt @@ -23,8 +23,18 @@ target_sources(makeotfexe PRIVATE target_link_libraries(makeotfexe PRIVATE ctutil dynarr hotconv makeotf_pstoken typecomp makeotf_cffread) -if(HAVE_M_LIB) +if (HAVE_M_LIB) target_link_libraries(makeotfexe PRIVATE m) +endif () + +if (${LibXml2_FOUND}) + target_link_libraries(makeotfexe PUBLIC ${LIBXML2_LIBRARY}) +else () + if (WIN32) + target_link_libraries(makeotfexe PUBLIC ${LIBXML2_WIN_LIBRARIES}) + else () + target_link_libraries(makeotfexe PUBLIC ${LIBXML2_NONWIN_LIBRARIES}) + endif() endif() target_compile_definitions(makeotfexe PRIVATE MAKEOTFLIB_EXPORTS=1) diff --git a/c/mergefonts/source/CMakeLists.txt b/c/mergefonts/source/CMakeLists.txt index 53a6ca945..b77d1ef4c 100644 --- a/c/mergefonts/source/CMakeLists.txt +++ b/c/mergefonts/source/CMakeLists.txt @@ -6,6 +6,19 @@ add_executable(mergefonts ) target_include_directories(mergefonts PRIVATE ../../shared/include ../../shared/resource ../../shared/source/tx_shared) + target_link_libraries(mergefonts PUBLIC tx_shared) -install(TARGETS mergefonts DESTINATION bin) +if (${LibXml2_FOUND}) + target_link_libraries(mergefonts PUBLIC ${LIBXML2_LIBRARY}) +else () + add_dependencies(mergefonts ${LIBXML2_TARGET}) + target_compile_definitions(mergefonts PUBLIC -DLIBXML_STATIC) + if (WIN32) + target_link_libraries(mergefonts PUBLIC ${LIBXML2_WIN_LIBRARIES}) + else () + target_link_libraries(mergefonts PUBLIC ${LIBXML2_NONWIN_LIBRARIES}) + endif() +endif() + +install(TARGETS mergefonts DESTINATION bin) diff --git a/c/rotatefont/source/CMakeLists.txt b/c/rotatefont/source/CMakeLists.txt index 42d2141f8..6d3660d32 100644 --- a/c/rotatefont/source/CMakeLists.txt +++ b/c/rotatefont/source/CMakeLists.txt @@ -6,5 +6,19 @@ add_executable(rotatefont ) target_include_directories(rotatefont PRIVATE ../../shared/include ../../shared/resource ../../shared/source/tx_shared) + target_link_libraries(rotatefont PUBLIC tx_shared) + +if(${LibXml2_FOUND}) + target_link_libraries(rotatefont PUBLIC ${LIBXML2_LIBRARY}) +else() + add_dependencies(rotatefont ${LIBXML2_TARGET}) + target_compile_definitions(rotatefont PUBLIC -DLIBXML_STATIC) + if (WIN32) + target_link_libraries(rotatefont PUBLIC ${LIBXML2_WIN_LIBRARIES}) + else () + target_link_libraries(rotatefont PUBLIC ${LIBXML2_NONWIN_LIBRARIES}) + endif() +endif() + install(TARGETS rotatefont DESTINATION bin) diff --git a/c/shared/include/ctlshare.h b/c/shared/include/ctlshare.h index 22dd6675b..f5299abbc 100644 --- a/c/shared/include/ctlshare.h +++ b/c/shared/include/ctlshare.h @@ -15,6 +15,9 @@ #endif #include +#include +#include + /* CoreType Library Shared Definitions =================================== This library supplies definitions that are shared between members of the @@ -139,6 +142,7 @@ struct ctlStreamCallbacks_ { int (*seek)(ctlStreamCallbacks *cb, void *stream, long offset); long (*tell)(ctlStreamCallbacks *cb, void *stream); size_t (*read)(ctlStreamCallbacks *cb, void *stream, char **ptr); + size_t (*xml_read)(ctlStreamCallbacks *cb, void *stream, xmlDocPtr *doc); size_t (*write)(ctlStreamCallbacks *cb, void *stream, size_t count, char *ptr); int (*status)(ctlStreamCallbacks *cb, void *stream); diff --git a/c/shared/include/tx_shared.h b/c/shared/include/tx_shared.h index 485c2799f..e9dc2564c 100644 --- a/c/shared/include/tx_shared.h +++ b/c/shared/include/tx_shared.h @@ -59,6 +59,9 @@ #include #endif +#include +#include + /* ----------------------- Miscellaneous Definitions ----------------------- */ #define ARRAY_LEN(t) (sizeof(t) / sizeof((t)[0])) diff --git a/c/shared/include/uforead.h b/c/shared/include/uforead.h index e2b5fdd55..b7dcdfc04 100644 --- a/c/shared/include/uforead.h +++ b/c/shared/include/uforead.h @@ -6,6 +6,7 @@ #define UFOREAD_H #include "ctlshare.h" +#include #define UFO_VERSION CTL_MAKE_VERSION(1, 1, 2) @@ -125,6 +126,12 @@ void ufoFree(ufoCtx h); /* ufoFree() destroys the library context and all the resources allocated to it. The temporary and debug data streams are closed. */ +static char* parseXMLKeyName(ufoCtx h, xmlNodePtr cur); + +static char* parseXMLKeyValue(ufoCtx h, xmlNodePtr cur); + +static bool setFontDictKey(ufoCtx h, char* keyName, xmlNodePtr cur); + enum { #undef CTL_DCL_ERR #define CTL_DCL_ERR(name, string) name, diff --git a/c/shared/source/CMakeLists.txt b/c/shared/source/CMakeLists.txt index 3cf291f5c..f6a4ca04e 100644 --- a/c/shared/source/CMakeLists.txt +++ b/c/shared/source/CMakeLists.txt @@ -3,6 +3,9 @@ include_directories(../include ../resource) MACRO(ADD_AFDKOLIB lm) file(GLOB sl_sources "${lm}/*") add_library(${lm} STATIC ${sl_sources}) + if(NOT ${LibXml2_FOUND}) + add_dependencies(${lm} ${LIBXML2_TARGET}) + endif(NOT ${LibXml2_FOUND}) ENDMACRO(ADD_AFDKOLIB) ADD_AFDKOLIB(absfont) @@ -44,6 +47,17 @@ target_compile_definitions(t1write PRIVATE $<$:T1W_DEBUG=1>) target_compile_definitions(ttread PRIVATE $<$:TTR_DEBUG=1>) target_compile_definitions(tx_shared PRIVATE $<$:CFW_DEBUG=1>) +if(${LibXml2_FOUND}) + target_link_libraries(tx_shared PUBLIC ${LIBXML2_LIBRARY}) +else() + target_compile_definitions(tx_shared PUBLIC -DLIBXML_STATIC) + if (WIN32) + target_link_libraries(tx_shared PUBLIC ${LIBXML2_WIN_LIBRARIES}) + else () + target_link_libraries(tx_shared PUBLIC ${LIBXML2_NONWIN_LIBRARIES}) + endif() +endif() + # These libraries are partially ordered target_link_libraries(tx_shared PUBLIC diff --git a/c/shared/source/tx_shared/tx_shared.c b/c/shared/source/tx_shared/tx_shared.c index 16158cb63..daa799406 100644 --- a/c/shared/source/tx_shared/tx_shared.c +++ b/c/shared/source/tx_shared/tx_shared.c @@ -386,7 +386,7 @@ static long stm_tell(ctlStreamCallbacks *cb, void *stream) { } /* Read from stream. */ -static size_t stm_read(ctlStreamCallbacks *cb, void *stream, char **ptr) { +static size_t stm_read(ctlStreamCallbacks *cb, Stream *stream, char **ptr) { Stream *s = stream; switch (s->type) { case stm_Src: @@ -405,6 +405,26 @@ static size_t stm_read(ctlStreamCallbacks *cb, void *stream, char **ptr) { return 0; /* Suppress compiler warning */ } +static size_t stm_xml_read(ctlStreamCallbacks *cb, Stream *stream, xmlDocPtr *doc){ + int res; + xmlParserCtxtPtr ctxt; + + Stream *s = stream; + txCtx h = cb->direct_ctx; + res = fread(s->buf, 1, 4, s->fp); + if (res > 0) { + ctxt = xmlCreatePushParserCtxt(NULL, NULL, + s->buf, res, s->filename); + while ((res = fread(s->buf, 1, BUFSIZ, s->fp)) > 0) { + xmlParseChunk(ctxt, s->buf, res, 0); + } + xmlParseChunk(ctxt, s->buf, 0, 1); + *doc = ctxt->myDoc; + xmlFreeParserCtxt(ctxt); + } + return 0; +} + /* Write to stream. */ static size_t stm_write(ctlStreamCallbacks *cb, void *stream, size_t count, char *ptr) { @@ -501,6 +521,7 @@ void stmInit(txCtx h) { h->cb.stm.seek = stm_seek; h->cb.stm.tell = stm_tell; h->cb.stm.read = stm_read; + h->cb.stm.xml_read = stm_xml_read; h->cb.stm.write = stm_write; h->cb.stm.status = stm_status; h->cb.stm.close = stm_close; diff --git a/c/shared/source/uforead/uforead.c b/c/shared/source/uforead/uforead.c index 81b62331f..ec8da8667 100644 --- a/c/shared/source/uforead/uforead.c +++ b/c/shared/source/uforead/uforead.c @@ -39,7 +39,6 @@ #include #include #include -#include enum { ufoUnknown, @@ -58,6 +57,7 @@ long CIDCount = 0; int currentiFD = 0; int FDArrayInitSize = 50; bool parsingFDArray = false; +bool parsingValueArray = false; typedef struct { @@ -407,6 +407,10 @@ void ufoFree(ufoCtx h) { freeStrings(h); dnaFree(h->dna); + if (h->top.FDArray.array != &h->fdict){ // if more memory was allocated for FDArray + memFree(h, h->top.FDArray.array); + } + /* Close debug stream */ if (h->stm.dbg != NULL) (void)h->cb.stm.close(&h->cb.stm, h->stm.dbg); @@ -923,204 +927,226 @@ static char* getKeyValue(ufoCtx h, char* endName, int state) { return value; } -static void setBluesArrayValue(ufoCtx h, BluesArray* bluesArray, int numElements) { +/* free dynamic valueArray and set cnt to 0 */ +static void freeValueArray(ufoCtx h){ + if (h->valueArray.cnt != 0){ + int i = 0; + while ((i < h->valueArray.cnt)) { + memFree(h, h->valueArray.array[i]); + i++; + } + dnaSET_CNT(h->valueArray, 0); + } + parsingValueArray = false; +} + +/* ToDo: add extra warnings for verbose-output */ +static void setBluesArrayValue(ufoCtx h, BluesArray* bluesArray, int numElements, char* arrayKeyName) { int i = 0; + if (h->valueArray.cnt == 0) { +// message(h, "Warning: Encountered empty or invalid array for %s. Skipping", arrayKeyName); + return; + } bluesArray->cnt = h->valueArray.cnt; while ((i < h->valueArray.cnt) && (i < numElements)) { bluesArray->array[i] = (float)atof(h->valueArray.array[i]); - memFree(h, h->valueArray.array[i]); i++; } + freeValueArray(h); } +/* ToDo: add extra warnings for verbose-output */ static void setFontMatrix(ufoCtx h, abfFontMatrix* fontMatrix, int numElements) { int i = 0; + if (h->valueArray.cnt == 0) { +// message(h, "Warning: Encountered empty or invalid array for FontMatrix. Skipping"); + return; + } fontMatrix->cnt = h->valueArray.cnt; while ((i < h->valueArray.cnt) && (i < numElements)) { fontMatrix->array[i] = (float)atof(h->valueArray.array[i]); - memFree(h, h->valueArray.array[i]); i++; } + freeValueArray(h); +} + +/* ToDo: add extra warnings for verbose-output */ +static bool keyValueValid(ufoCtx h, xmlNodePtr cur, char* keyValue, char* keyName){ + bool valid = true; + if (keyValue == NULL) { + if (!parsingValueArray) + valid = false; +// message(h, "Warning: Encountered missing value for fontinfo key %s. Skipping", keyName); + else if (parsingValueArray && h->valueArray.cnt == 0) + valid = false; +// message(h, "Warning: Encountered empty <%s> for fontinfo key %s. Skipping", cur->name, keyName); + } else { + if (!strcmp(keyValue, "")){ + message(h, "Warning: Encountered empty <%s> for fontinfo key %s. Skipping", cur->name, keyName); + valid = false; + } + } + if (!valid) + freeValueArray(h); /* we free h->valueArray after parsing every key to clean up any leftover/invalid data */ + + return valid; } -static void setFontDictKey(ufoCtx h, char* keyValue) { - char* keyName = h->parseKeyName; +static bool setFontDictKey(ufoCtx h, char* keyName, xmlNodePtr cur) { + /* returns false when current key is NULL/ not parseable, + otherwise returns true */ abfTopDict* top = &h->top; abfFontDict* fd = h->top.FDArray.array + currentiFD; abfPrivateDict* pd = &fd->Private; BluesArray* bluesArray; abfFontMatrix* fontMatrix; - /* If we do not use a keyValue, we need to dispose of it - */ - if (!strcmp(keyName, "copyright")) { - top->Copyright.ptr = keyValue; - } else if (!strcmp(keyName, "trademark")) { - char* copySymbol; - top->Notice.ptr = keyValue; - /* look for the (c) symbol U+00A9, which is 0xC2, 0xA9 in UTF-8 */ - copySymbol = strstr(keyValue, "\xC2\xA9"); - if (copySymbol != NULL) { - /* if there is a copyright symbol (U+00A9), - replace it with the word "Copyright" */ - char* cpy = "Copyright"; - char* newString = memNew(h, strlen(cpy) + strlen(keyValue) + 2); - /* set the 0xC2 to NULL to terminate the left side of the string */ - *copySymbol = '\0'; - /* use copySymbol + 2 to skip the NULL and the 0xA9 - to get the right side of the string */ - sprintf(newString, "%s%s%s", keyValue, "Copyright", copySymbol + 2); - top->Notice.ptr = newString; - } - } else if (!strcmp(keyName, "versionMajor")) { - if (top->version.ptr == NULL) - top->version.ptr = keyValue; - else { - char* newString = memNew(h, strlen(top->version.ptr) + strlen(keyValue) + 2); - sprintf(newString, "%s.%s", keyValue, top->version.ptr); - memFree(h, top->version.ptr); - top->version.ptr = newString; - memFree(h, keyValue); - } - } else if (!strcmp(keyName, "versionMinor")) { - if (top->version.ptr == NULL) - top->version.ptr = keyValue; - else { - char* newString = memNew(h, strlen(top->version.ptr) + strlen(keyValue) + 2); - sprintf(newString, "%s.%s", top->version.ptr, keyValue); - memFree(h, top->version.ptr); - top->version.ptr = newString; - memFree(h, keyValue); - } - } else if (!strcmp(keyName, "postscriptFontName")) { - fd->FontName.ptr = keyValue; - } else if (!strcmp(keyName, "openTypeNamePreferredFamilyName")) { - top->FamilyName.ptr = keyValue; - } else if (!strcmp(keyName, "familyName")) { - if (top->FamilyName.ptr == NULL) // we don't re-set this if it was set by "openTypeNamePreferredFamilyName" - top->FamilyName.ptr = keyValue; - else - memFree(h, keyValue); - } else if (!strcmp(keyName, "postscriptFullName")) { - top->FullName.ptr = keyValue; - } else if (!strcmp(keyName, "postscriptWeightName")) { - top->Weight.ptr = keyValue; - } else if (!strcmp(keyName, "postscriptIsFixedPitch")) { - top->isFixedPitch = atol(keyValue); - } else if (!strcmp(keyName, "FSType")) { - top->FSType = atoi(keyValue); - } else if (!strcmp(keyName, "italicAngle")) { - top->ItalicAngle = (float)strtod(keyValue, NULL); - } else if (!strcmp(keyName, "postscriptUnderlinePosition")) { - top->UnderlinePosition = (float)strtod(keyValue, NULL); - } else if (!strcmp(keyName, "postscriptUnderlineThickness")) { - top->UnderlineThickness = (float)strtod(keyValue, NULL); - } else if (!strcmp(keyName, "unitsPerEm")) { - double ppem = strtod(keyValue, NULL); - top->sup.UnitsPerEm = (int)ppem; - fd->FontMatrix.cnt = 6; - fd->FontMatrix.array[0] = (float)(1.0 / ppem); - fd->FontMatrix.array[1] = 0; - fd->FontMatrix.array[2] = 0; - fd->FontMatrix.array[3] = (float)(1.0 / ppem); - fd->FontMatrix.array[4] = 0; - fd->FontMatrix.array[5] = 0; - memFree(h, keyValue); - } else if (!strcmp(keyName, "FontName")) { - fd->FontName.ptr = keyValue; - } else if (!strcmp(keyName, "PaintType")) { - fd->PaintType = atoi(keyValue); - } else if (!strcmp(keyName, "FontMatrix")) { - fontMatrix = &fd->FontMatrix; - setFontMatrix(h, fontMatrix, 6); - } else if (!strcmp(keyName, "postscriptBlueFuzz")) { - pd->BlueFuzz = (float)strtod(keyValue, NULL); - memFree(h, keyValue); - } else if (!strcmp(keyName, "postscriptBlueShift")) { - pd->BlueShift = (float)strtod(keyValue, NULL); - memFree(h, keyValue); - } else if (!strcmp(keyName, "postscriptBlueScale")) { - pd->BlueScale = (float)strtod(keyValue, NULL); - memFree(h, keyValue); - } else if (!strcmp(keyName, "postscriptForceBold")) { - pd->ForceBold = atol(keyValue); - } else if (!strcmp(keyName, "postscriptBlueValues")) { - bluesArray = (BluesArray*)&pd->BlueValues; - setBluesArrayValue(h, bluesArray, 14); - } else if (!strcmp(keyName, "postscriptOtherBlues")) { - bluesArray = (BluesArray*)&pd->OtherBlues; - setBluesArrayValue(h, bluesArray, 10); - } else if (!strcmp(keyName, "postscriptFamilyBlues")) { - bluesArray = (BluesArray*)&pd->FamilyBlues; - setBluesArrayValue(h, bluesArray, 14); - } else if (!strcmp(keyName, "postscriptFamilyOtherBlues")) { - bluesArray = (BluesArray*)&pd->FamilyOtherBlues; - setBluesArrayValue(h, bluesArray, 10); - } else if (!strcmp(keyName, "postscriptStdHW")) { - if (keyValue != NULL){ - pd->StdHW = (float)strtod(keyValue, NULL); - memFree(h, keyValue); - } else { - pd->StdHW = (float)strtod(h->valueArray.array[0], NULL); - memFree(h, h->valueArray.array[0]); - } - } else if (!strcmp(keyName, "postscriptStdVW")) { - if (keyValue != NULL){ - pd->StdVW = (float)strtod(keyValue, NULL); - memFree(h, keyValue); - } else { - pd->StdVW = (float)strtod(h->valueArray.array[0], NULL); - memFree(h, h->valueArray.array[0]); - } - } else if (!strcmp(keyName, "postscriptStemSnapH")) { - bluesArray = (BluesArray*)&pd->StemSnapH; - setBluesArrayValue(h, bluesArray, 12); - } else if (!strcmp(keyName, "postscriptStemSnapV")) { - bluesArray = (BluesArray*)&pd->StemSnapV; - setBluesArrayValue(h, bluesArray, 12); - } else if (!strcmp(keyName, "LanguageGroup")) { - pd->LanguageGroup = (float)strtod(keyValue, NULL); - h->parseKeyName = NULL; - memFree(h, keyValue); - } else if (!strcmp(keyName, "ExpansionFactor")) { - pd->ExpansionFactor = (float)strtod(keyValue, NULL); - h->parseKeyName = NULL; - memFree(h, keyValue); + if (keyName == NULL){ + return false; + } + if (!strcmp(keyName, "postscriptFDArray")) { + h->top.FDArray.array = memNew(h, FDArrayInitSize *sizeof(abfFontDict)); + if (h->top.version.ptr != NULL) + h->top.cid.CIDFontVersion = atoi(h->top.version.ptr) % 10 + (float) atoi(&h->top.version.ptr[2])/1000; + abfInitFontDict(h->top.FDArray.array); + + parsingFDArray = true; + currentiFD = -1; + parseXMLKeyValue(h, cur); + parsingFDArray = false; + } else if (!strcmp(keyName, "PrivateDict")) { + parsingFDArray = false; + parseXMLKeyValue(h, cur); + parsingFDArray = true; } else { - // if it isn't used, free the string. - memFree(h, keyValue); - } -} - -static int doFontDictValue(ufoCtx h, char* keyName, char* endKeyName, int state) { - char* valueString = getKeyValue(h, endKeyName, state); - if (valueString == NULL) { - if (strcmp(h->parseKeyName, "styleName")) { - message(h, "Warning: Encountered empty %s for fontinfo key %s. Skipping", keyName, h->parseKeyName); - /* It is valid and common for styleName can be present and empty, when the style is "Regular".*/ - } - } - - if (state == 2) // we are processing a key value. - { - if (valueString != NULL) - setFontDictKey(h, valueString); - state = 1; - memFree(h, h->parseKeyName); - } else if (state == 3) // we are within an , which is a key value - { - if (valueString != NULL) - *dnaNEXT(h->valueArray) = valueString; - } else if (state >= 5) // we are within a within an (an fDict in an FDArray), which is a key value - { - if (valueString != NULL) { - setFontDictKey(h, valueString); + char* keyValue = parseXMLKeyValue(h, cur); + if (!keyValueValid(h, cur, keyValue, keyName)) + return false; + if (!strcmp(keyName, "copyright")) { + top->Copyright.ptr = keyValue; + } else if (!strcmp(keyName, "trademark")) { + char* copySymbol; + top->Notice.ptr = keyValue; + /* look for the (c) symbol U+00A9, which is 0xC2, 0xA9 in UTF-8 */ + copySymbol = strstr(keyValue, "\xC2\xA9"); + if (copySymbol != NULL) { + /* if there is a copyright symbol (U+00A9), + replace it with the word "Copyright" */ + char* cpy = "Copyright"; + char* newString = memNew(h, strlen(cpy) + strlen(keyValue) + 2); + /* set the 0xC2 to NULL to terminate the left side of the string */ + *copySymbol = '\0'; + /* use copySymbol + 2 to skip the NULL and the 0xA9 + to get the right side of the string */ + sprintf(newString, "%s%s%s", keyValue, "Copyright", copySymbol + 2); + top->Notice.ptr = newString; + } + } else if (!strcmp(keyName, "versionMajor")) { + if (top->version.ptr == NULL) + top->version.ptr = keyValue; + else { + char* newString = memNew(h, strlen(top->version.ptr) + strlen(keyValue) + 2); + sprintf(newString, "%s.%s", keyValue, top->version.ptr); + memFree(h, top->version.ptr); + top->version.ptr = newString; + } + } else if (!strcmp(keyName, "versionMinor")) { + if (top->version.ptr == NULL) + top->version.ptr = keyValue; + else { + char* newString = memNew(h, strlen(top->version.ptr) + strlen(keyValue) + 2); + sprintf(newString, "%s.%s", top->version.ptr, keyValue); + memFree(h, top->version.ptr); + top->version.ptr = newString; + } + } else if (!strcmp(keyName, "postscriptFontName")) { + fd->FontName.ptr = keyValue; + } else if (!strcmp(keyName, "openTypeNamePreferredFamilyName")) { + top->FamilyName.ptr = keyValue; + } else if (!strcmp(keyName, "familyName")) { + if (top->FamilyName.ptr == NULL) // we don't re-set this if it was set by "openTypeNamePreferredFamilyName" + top->FamilyName.ptr = keyValue; + } else if (!strcmp(keyName, "postscriptFullName")) { + top->FullName.ptr = keyValue; + } else if (!strcmp(keyName, "postscriptWeightName")) { + top->Weight.ptr = keyValue; + } else if (!strcmp(keyName, "postscriptIsFixedPitch")) { + top->isFixedPitch = atol(keyValue); + } else if (!strcmp(keyName, "FSType")) { + top->FSType = atoi(keyValue); + } else if (!strcmp(keyName, "italicAngle")) { + top->ItalicAngle = (float)strtod(keyValue, NULL); + } else if (!strcmp(keyName, "postscriptUnderlinePosition")) { + top->UnderlinePosition = (float)strtod(keyValue, NULL); + } else if (!strcmp(keyName, "postscriptUnderlineThickness")) { + top->UnderlineThickness = (float)strtod(keyValue, NULL); + } else if (!strcmp(keyName, "unitsPerEm")) { + double ppem = strtod(keyValue, NULL); + top->sup.UnitsPerEm = (int)ppem; + fd->FontMatrix.cnt = 6; + fd->FontMatrix.array[0] = (float)(1.0 / ppem); + fd->FontMatrix.array[1] = 0; + fd->FontMatrix.array[2] = 0; + fd->FontMatrix.array[3] = (float)(1.0 / ppem); + fd->FontMatrix.array[4] = 0; + fd->FontMatrix.array[5] = 0; + } else if (!strcmp(keyName, "FontName")) { + fd->FontName.ptr = keyValue; + } else if (!strcmp(keyName, "PaintType")) { + fd->PaintType = atoi(keyValue); + } else if (!strcmp(keyName, "FontMatrix")) { + fontMatrix = &fd->FontMatrix; + setFontMatrix(h, fontMatrix, 6); + } else if (!strcmp(keyName, "postscriptBlueFuzz")) { + pd->BlueFuzz = (float)strtod(keyValue, NULL); + } else if (!strcmp(keyName, "postscriptBlueShift")) { + pd->BlueShift = (float)strtod(keyValue, NULL); + } else if (!strcmp(keyName, "postscriptBlueScale")) { + pd->BlueScale = (float)strtod(keyValue, NULL); + } else if (!strcmp(keyName, "postscriptForceBold")) { + pd->ForceBold = atol(keyValue); + } else if (!strcmp(keyName, "postscriptBlueValues")) { + bluesArray = (BluesArray*)&pd->BlueValues; + setBluesArrayValue(h, bluesArray, 14, keyName); + } else if (!strcmp(keyName, "postscriptOtherBlues")) { + bluesArray = (BluesArray*)&pd->OtherBlues; + setBluesArrayValue(h, bluesArray, 10, keyName); + } else if (!strcmp(keyName, "postscriptFamilyBlues")) { + bluesArray = (BluesArray*)&pd->FamilyBlues; + setBluesArrayValue(h, bluesArray, 14, keyName); + } else if (!strcmp(keyName, "postscriptFamilyOtherBlues")) { + bluesArray = (BluesArray*)&pd->FamilyOtherBlues; + setBluesArrayValue(h, bluesArray, 10, keyName); + } else if (!strcmp(keyName, "postscriptStdHW")) { + if (keyValue != NULL) { + pd->StdHW = (float)strtod(keyValue, NULL); + } else { + pd->StdHW = (float)strtod(h->valueArray.array[0], NULL); + freeValueArray(h); + } + } else if (!strcmp(keyName, "postscriptStdVW")) { + if (keyValue != NULL) { + pd->StdVW = (float)strtod(keyValue, NULL); + } else { + pd->StdVW = (float)strtod(h->valueArray.array[0], NULL); + freeValueArray(h); + } + } else if (!strcmp(keyName, "postscriptStemSnapH")) { + bluesArray = (BluesArray*)&pd->StemSnapH; + setBluesArrayValue(h, bluesArray, 12, keyName); + } else if (!strcmp(keyName, "postscriptStemSnapV")) { + bluesArray = (BluesArray*)&pd->StemSnapV; + setBluesArrayValue(h, bluesArray, 12, keyName); + } else if (!strcmp(keyName, "LanguageGroup")) { + pd->LanguageGroup = (float)strtod(keyValue, NULL); + h->parseKeyName = NULL; + } else if (!strcmp(keyName, "ExpansionFactor")) { + pd->ExpansionFactor = (float)strtod(keyValue, NULL); + h->parseKeyName = NULL; } - } else { - memFree(h, h->parseKeyName); - fatal(h, ufoErrParse, "Encountered key value when not after or element. Text: '%s'.", getBufferContextPtr(h)); + freeValueArray(h); } - return state; + return true; } static int CTL_CDECL cmpOrderRecs(const void* first, const void* second, void* ctx) { @@ -1819,9 +1845,144 @@ static void reallocFDArray(ufoCtx h){ h->top.FDArray.array = newFDArray; } +static int parseXMLFile(ufoCtx h, char* filename, const char* filetype){ + xmlDocPtr doc; + xmlNodePtr cur; + char* keyName; + + xmlKeepBlanksDefault(0); + + h->cb.stm.xml_read(&h->cb.stm, h->stm.src, &doc); + + if (doc == NULL) { + fatal(h, ufoErrParse, "Unable to read '%s'.\n", filename); + } + + cur = xmlDocGetRootElement(doc); + if (cur == NULL) { + xmlFreeDoc(doc); + fatal(h, ufoErrSrcStream, "The %s file is empty.\n", filename); + } + + if (!xmlStrEqual((cur)->name, (const xmlChar *) filetype)) { + xmlFreeDoc(doc); + fatal(h, ufoErrSrcStream, "File %s is of the wrong type, root node != %s.\n", filename, filetype); + } + + cur = (cur)->xmlChildrenNode; + while (cur && xmlIsBlankNode(cur)) { + cur = (cur) -> next; + } + + if ( cur == NULL ) { + xmlFreeDoc(doc); + fatal(h, ufoErrSrcStream, "Error parsing XML file %s.\n", filename); + } + + if ((!xmlStrEqual((cur)->name, (const xmlChar *) "dict"))) { + xmlFreeDoc(doc); + fatal(h, ufoErrSrcStream, "Error reading outermost in %s.\n", filename); + } + + cur = cur->xmlChildrenNode; + while (cur != NULL) { + keyName = parseXMLKeyName(h, cur); + cur = cur->next; + if (setFontDictKey(h, keyName, cur) && cur != NULL) + cur = cur->next; + } + return ufoErrSrcStream; +} + +/* ToDo: add extra warnings for verbose-output*/ +static char* parseXMLKeyName(ufoCtx h, xmlNodePtr cur){ + if ((xmlStrEqual(cur->name, (const xmlChar *) "key"))) { + cur = cur->xmlChildrenNode; + if (cur != NULL) { + if (xmlStrEqual(cur->name, (const xmlChar *) "text")) { + return (char*) xmlNodeGetContent(cur); + } else { +// message(h, "Warning: Encountered non-text value %s within .", cur->name); + return NULL; + } + } else { +// message(h, "Warning: Encountered empty ."); + return NULL; + } + } + return NULL; +} + +static void parseXMLArray(ufoCtx h, xmlNodePtr cur){ + dnaSET_CNT(h->valueArray, 0); + parsingValueArray = true; + cur = cur->xmlChildrenNode; + while (cur != NULL) { + char* valueString = parseXMLKeyValue(h, cur); + if (valueString != NULL) + *dnaNEXT(h->valueArray) = valueString; + cur = cur->next; + } +} + +static void parseXMLDict(ufoCtx h, xmlNodePtr cur){ + // go through an XML dict + char* keyName; + cur = cur->xmlChildrenNode; + + if (parsingFDArray){ + currentiFD = currentiFD + 1; + h->top.FDArray.cnt = h->top.FDArray.cnt + 1; + if (h->top.FDArray.cnt > FDArrayInitSize){ /* Memory needs reallocation*/ + reallocFDArray(h); + } + abfFontDict* fd = h->top.FDArray.array + currentiFD; + abfInitFontDict(fd); + } + + while (cur != NULL) { + char* keyName = parseXMLKeyName(h, cur); + cur = cur->next; + if (setFontDictKey(h, keyName, cur) && cur != NULL) + cur = cur->next; + } +} + +static bool isSimpleKey(xmlNodePtr cur){ + if (xmlStrEqual(cur->name, (const xmlChar *) "string" ) || + xmlStrEqual(cur->name, (const xmlChar *) "integer") || + xmlStrEqual(cur->name, (const xmlChar *) "real") || + xmlStrEqual(cur->name, (const xmlChar *) "date")) { + return true; + } else { + return false; + } +} + +static char* parseXMLKeyValue(ufoCtx h, xmlNodePtr cur){ + if (cur == NULL) { + return NULL; + } + if (isSimpleKey(cur)) { /* if string, integer, or real */ + return (char*) xmlNodeGetContent(cur); + } else if (xmlStrEqual(cur->name, (const xmlChar *) "dict")) { + parseXMLDict(h, cur); + return NULL; + } else if (xmlStrEqual(cur->name, (const xmlChar *) "array")) { + parseXMLArray(h, cur); + return NULL; // returning NULL because value is in h->valueArray + } else if (xmlStrEqual(cur->name, (const xmlChar *) "true")) { + return "1"; + } else if (xmlStrEqual(cur->name, (const xmlChar *) "false")) { + return "0"; + } else { + return NULL; + } +} + static int parseFontInfo(ufoCtx h) { - int state = 0; /* 0 == start, 1=in first dict, 2 in key, 3= in value, 4=in array 4 in comment, 5 in child dict.*/ - int prevState = 0; /* used to save prev state while in comment. */ + const char* filetype = "plist"; + h->src.next = h->mark = NULL; h->cb.stm.clientFileName = "fontinfo.plist"; h->stm.src = h->cb.stm.open(&h->cb.stm, UFO_SRC_STREAM_ID, 0); @@ -1832,149 +1993,10 @@ static int parseFontInfo(ufoCtx h) { } dnaSET_CNT(h->valueArray, 0); - fillbuf(h, 0); - - h->flags &= ~((unsigned long)SEEN_END); - - while (!(h->flags & SEEN_END)) { - token* tk; - tk = getToken(h, state); - if (tokenEqualStr(tk, "")) { - if (state != 4) { - fatal(h, ufoErrParse, "Encountered end comment token while not in comment, in fontinfo.plist file. Context: '%s'.\n", getBufferContextPtr(h)); - } - state = prevState; - } else if (state == 4) { - continue; - } else if (tokenEqualStr(tk, "")) { - if (state == 3){ - state = 5; - if (parsingFDArray){ - if (prevState == 5) { // NOT first fdict in FDArray - currentiFD = currentiFD + 1; - h->top.FDArray.cnt = h->top.FDArray.cnt + 1; - if (h->top.FDArray.cnt > FDArrayInitSize){ /* Memory needs reallocation*/ - reallocFDArray(h); - } - abfFontDict* fd = h->top.FDArray.array + currentiFD; - abfInitFontDict(fd); - } else { - h->top.FDArray.array = memNew(h, FDArrayInitSize *sizeof(abfFontDict)); - if (h->top.version.ptr != NULL) - h->top.cid.CIDFontVersion = atoi(h->top.version.ptr) % 10 + (float) atoi(&h->top.version.ptr[2])/1000; - abfInitFontDict(h->top.FDArray.array); - } - } - }else if (state == 5){ - state = 6; - }else{ - state = 1; - } - } else if (tokenEqualStr(tk, "")) { - if (state == 6){ - state = 5; - } else if (state == 5){ - prevState = state; - state = 3; - } else{ - break; - } - } else if (tokenEqualStr(tk, "")) { - if (state != 1 && state < 5) { - fatal(h, ufoErrParse, "Encountered '' while not in top level of first , in fontinfo.plist file. Context: '%s'.\n", getBufferContextPtr(h)); - } - // get key name - tk = getElementValue(h, state); - if (tokenEqualStr(tk, "")) { - message(h, "Warning: Encountered empty . Text: '%s'.", getBufferContextPtr(h)); - } else { - h->parseKeyName = copyStr(h, tk->val); // get a copy in memory. This is freed when the value is assigned. - // get end-key. - tk = getToken(h, state); - if (!tokenEqualStr(tk, "")) { - tk->val[tk->length - 1] = 0; - fatal(h, ufoErrParse, "Encountered element other than when reading name: %s, in fontinfo.plist file. Context: '%s'.\n", tk->val, getBufferContextPtr(h)); - } - } - if (state != 5 && state != 6){ - state = 2; - } - } else if (tokenEqualStr(tk, "")) { - if (state != 2 && state < 5) { - fatal(h, ufoErrParse, "Encountered when not after element, in fontinfo.plist file. Context: '%s'.\n", getBufferContextPtr(h)); - } else { - /* check if parsing FDArray */ - if (!strcmp(h->parseKeyName, "postscriptFDArray")) - parsingFDArray = true; - if (state >= 5){ - prevState = state; - } - state = 3; - } - dnaSET_CNT(h->valueArray, 0); - } else if (tokenEqualStr(tk, "")) { - if (state == 5) { - if (parsingFDArray) - parsingFDArray = false; - if ( h->top.FDArray.array != &h->fdict ) { // if more memory was allocated for FDArray - memFree(h, h->top.FDArray.array); - } - state = 1; - } else if (state != 3) { - fatal(h, ufoErrParse, "Encountered when not after element, in fontinfo.plist file. Context: '%s'.\n", getBufferContextPtr(h)); - } else { - if (h->parseKeyName == NULL) - break; - setFontDictKey(h, NULL); - if (prevState >= 5){ - state = prevState; - }else{ - state = 1; - } - } - } else if (tokenEqualStr(tk, "")) { - if (state != 2 && state != 5) { - fatal(h, ufoErrParse, "Encountered when not after element, in fontinfo.plist file. Context: '%s'.\n", getBufferContextPtr(h)); - } else { - dnaSET_CNT(h->valueArray, 0); - setFontDictKey(h, NULL); - state = 1; - } - } else if (tokenEqualStr(tk, "")) { - state = doFontDictValue(h, "", "", state); - } else if (tokenEqualStr(tk, "")) { - state = doFontDictValue(h, "", "", state); - } else if (tokenEqualStr(tk, "")) { - state = doFontDictValue(h, "", "", state); - } else if (tokenEqualStr(tk, "")) { - state = doFontDictValue(h, "", "", state); - } else if (tokenEqualStr(tk, "")) { - message(h, "Warning: encountered element: skipping."); - } else if (tokenEqualStr(tk, "")) { - setFontDictKey(h, "0"); - state--; - } else if (tokenEqualStr(tk, "")) { - setFontDictKey(h, "1"); - state--; - } else if (state != 0) { - tk->val[tk->length - 1] = 0; - message(h, "Warning: discarding token '%s', in fontinfo.plist file. Context: '%s'.", tk->val, getBufferContextPtr(h)); - if (state == 2) - state = 1; - else if (state == 3) - state = 2; - } - } /* end while more tokens */ + int parsingSuccess = parseXMLFile(h, h->cb.stm.clientFileName, filetype); - /* Currently, proscriptStdHW and postscriptStdVW have to be hand-edited in. If they haven't been provided, - use the first value of the stemsnap entries. - */ fixUnsetDictValues(h); - h->cb.stm.close(&h->cb.stm, h->stm.src); h->stm.src = NULL; return ufoSuccess; diff --git a/c/tx/source/CMakeLists.txt b/c/tx/source/CMakeLists.txt index be4097a87..684cb7ed1 100644 --- a/c/tx/source/CMakeLists.txt +++ b/c/tx/source/CMakeLists.txt @@ -7,4 +7,17 @@ add_executable(tx target_include_directories(tx PRIVATE ../../shared/include ../../shared/resource ../../shared/source/tx_shared) target_link_libraries(tx PUBLIC tx_shared) + +if(${LibXml2_FOUND}) + target_link_libraries(tx PUBLIC ${LIBXML2_LIBRARY}) +else() + add_dependencies(tx ${LIBXML2_TARGET}) + target_compile_definitions(tx PUBLIC -DLIBXML_STATIC) + if (WIN32) + target_link_libraries(tx PUBLIC ${LIBXML2_WIN_LIBRARIES}) + else () + target_link_libraries(tx PUBLIC ${LIBXML2_NONWIN_LIBRARIES}) + endif() +endif() + install(TARGETS tx DESTINATION bin) diff --git a/cmake/ExternalLibXML2.cmake b/cmake/ExternalLibXML2.cmake new file mode 100644 index 000000000..df4233b9b --- /dev/null +++ b/cmake/ExternalLibXML2.cmake @@ -0,0 +1,50 @@ +include (ExternalProject) +cmake_policy(SET CMP0114 NEW) + +set(LIBXML2_TARGET external.libxml2) + +set(LIBXML2_GIT_REPOSITORY https://gitlab.gnome.org/GNOME/libxml2.git) +if(NOT DEFINED LIBXML2_TAG) + set(LIBXML2_TAG master) +endif() + +if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*") + set(LIBXML2_OUTPUT_DIR ${LIBXML2_TARGET}/bin/${CMAKE_BUILD_TYPE}) +else() + set(LIBXML2_OUTPUT_DIR ${LIBXML2_TARGET}/bin) +endif() + +if(WIN32) + set(LIBXML2_LIBNAME libxml2s.lib) +else() + set(LIBXML2_LIBNAME libxml2.a) +endif() + +ExternalProject_Add(${LIBXML2_TARGET} + GIT_REPOSITORY ${LIBXML2_GIT_REPOSITORY} + GIT_TAG ${LIBXML2_TAG} + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/${LIBXML2_OUTPUT_DIR}/${LIBXML2_LIBNAME} + SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${LIBXML2_TARGET}/src + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${LIBXML2_TARGET}/bin + CMAKE_ARGS -D BUILD_SHARED_LIBS=OFF -D CMAKE_BUILD_TYPE=Release -D LIBXML2_WITH_ICONV=OFF -D LIBXML2_WITH_LZMA=OFF -D LIBXML2_WITH_ZLIB=OFF -D LIBXML2_WITH_PYTHON=OFF -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON + INSTALL_COMMAND "" +) + +ExternalProject_Get_Property(${LIBXML2_TARGET} BINARY_DIR) +ExternalProject_Get_Property(${LIBXML2_TARGET} SOURCE_DIR) + +file(MAKE_DIRECTORY ${SOURCE_DIR}/include) + +add_library(libxml2 STATIC IMPORTED GLOBAL) + +add_dependencies(libxml2 ${LIBXML2_TARGET}) +set_target_properties(libxml2 PROPERTIES + IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${LIBXML2_OUTPUT_DIR}/${LIBXML2_LIBNAME} + INTERFACE_INCLUDE_DIRECTORIES ${SOURCE_DIR}/include) +target_include_directories(libxml2 INTERFACE ${SOURCE_DIR}/include INTERFACE ${BINARY_DIR}) + +set(LIBXML2_INCLUDE_DIR ${SOURCE_DIR}/include ${BINARY_DIR}) + +set(LIBXML2_WIN_LIBRARIES wsock32 ws2_32 libxml2) + +set(LIBXML2_NONWIN_LIBRARIES libxml2) diff --git a/tests/tx_data/expected_output/bug1467_unknown_key_array.txt b/tests/tx_data/expected_output/bug1467_unknown_key_array.txt new file mode 100644 index 000000000..13ace4693 --- /dev/null +++ b/tests/tx_data/expected_output/bug1467_unknown_key_array.txt @@ -0,0 +1,8 @@ +## Filename NameRecordsTest.ufo +## Top Dict +FamilyName "NameRecordsTest" +sup.srcFontType UFO (name-keyed) +sup.nGlyphs 1 +## FontDict[0] +FontName "NameRecordsTest" +## Private diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/bluesarray-string.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/bluesarray-string.subset new file mode 100644 index 000000000..d08b61add Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/bluesarray-string.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-dict.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-dict.subset new file mode 100644 index 000000000..79115bfbd Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-dict.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-key-name-fdarray.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-key-name-fdarray.subset new file mode 100644 index 000000000..c73fe5d0e Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-key-name-fdarray.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-key-name.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-key-name.subset new file mode 100644 index 000000000..3ec1e10a9 Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-key-name.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-key-value.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-key-value.subset new file mode 100644 index 000000000..3ec1e10a9 Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/empty-key-value.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/fontmatrix-string.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/fontmatrix-string.subset new file mode 100644 index 000000000..4e71fc456 Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/fontmatrix-string.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/invalid-key-name.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/invalid-key-name.subset new file mode 100644 index 000000000..3ec1e10a9 Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/invalid-key-name.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-name-2.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-name-2.subset new file mode 100644 index 000000000..79115bfbd Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-name-2.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-name.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-name.subset new file mode 100644 index 000000000..635ab80a0 Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-name.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-value-2.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-value-2.subset new file mode 100644 index 000000000..79115bfbd Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-value-2.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-value.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-value.subset new file mode 100644 index 000000000..3ec1e10a9 Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/missing-key-value.subset differ diff --git a/tests/tx_data/expected_output/ufo-fontinfo-parsing/switched-string-and-array.subset b/tests/tx_data/expected_output/ufo-fontinfo-parsing/switched-string-and-array.subset new file mode 100644 index 000000000..d08b61add Binary files /dev/null and b/tests/tx_data/expected_output/ufo-fontinfo-parsing/switched-string-and-array.subset differ diff --git a/tests/tx_data/input/bug1467_unknown_key_array.ufo/fontinfo.plist b/tests/tx_data/input/bug1467_unknown_key_array.ufo/fontinfo.plist new file mode 100644 index 000000000..5150dcf0b --- /dev/null +++ b/tests/tx_data/input/bug1467_unknown_key_array.ufo/fontinfo.plist @@ -0,0 +1,349 @@ + + + + + familyName + NameRecordsTest + openTypeNameRecords + + + encodingID + 0 + languageID + 0 + nameID + 0 + platformID + 1 + string + Copyright (c) 2014 by Designer. All rights reserved. + + + encodingID + 1 + languageID + 1033 + nameID + 0 + platformID + 3 + string + Copyright (c) 2014 by Designer. All rights reserved. + + + encodingID + 0 + languageID + 0 + nameID + 1 + platformID + 1 + string + NameRecordsTest + + + encodingID + 1 + languageID + 1033 + nameID + 1 + platformID + 3 + string + NameRecordsTest + + + encodingID + 0 + languageID + 0 + nameID + 2 + platformID + 1 + string + Regular + + + encodingID + 1 + languageID + 1033 + nameID + 2 + platformID + 3 + string + Regular + + + encodingID + 0 + languageID + 0 + nameID + 3 + platformID + 1 + string + Designer: NameRecordsTest: 2014 + + + encodingID + 1 + languageID + 1033 + nameID + 3 + platformID + 3 + string + Designer: NameRecordsTest: 2014 + + + encodingID + 0 + languageID + 0 + nameID + 4 + platformID + 1 + string + NameRecordsTest + + + encodingID + 1 + languageID + 1033 + nameID + 4 + platformID + 3 + string + NameRecordsTest + + + encodingID + 0 + languageID + 0 + nameID + 5 + platformID + 1 + string + Version 1.000 + + + encodingID + 1 + languageID + 1033 + nameID + 5 + platformID + 3 + string + Version 1.000 + + + encodingID + 0 + languageID + 0 + nameID + 6 + platformID + 1 + string + NameRecordsTest + + + encodingID + 1 + languageID + 1033 + nameID + 6 + platformID + 3 + string + NameRecordsTest + + + encodingID + 0 + languageID + 0 + nameID + 7 + platformID + 1 + string + NameRecordsTest is a trademark of Designer. + + + encodingID + 1 + languageID + 1033 + nameID + 7 + platformID + 3 + string + NameRecordsTest is a trademark of Designer. + + + encodingID + 0 + languageID + 0 + nameID + 8 + platformID + 1 + string + Designer + + + encodingID + 1 + languageID + 1033 + nameID + 8 + platformID + 3 + string + Designer + + + encodingID + 0 + languageID + 0 + nameID + 9 + platformID + 1 + string + Designer + + + encodingID + 1 + languageID + 1033 + nameID + 9 + platformID + 3 + string + Designer + + + encodingID + 0 + languageID + 0 + nameID + 10 + platformID + 1 + string + Copyright (c) 2014 by Designer. All rights reserved. + + + encodingID + 1 + languageID + 1033 + nameID + 10 + platformID + 3 + string + Copyright (c) 2014 by Designer. All rights reserved. + + + encodingID + 0 + languageID + 0 + nameID + 11 + platformID + 1 + string + http://www.example.com + + + encodingID + 1 + languageID + 1033 + nameID + 11 + platformID + 3 + string + http://www.example.com + + + encodingID + 0 + languageID + 0 + nameID + 12 + platformID + 1 + string + http://www.example.com + + + encodingID + 1 + languageID + 1033 + nameID + 12 + platformID + 3 + string + http://www.example.com + + + encodingID + 0 + languageID + 0 + nameID + 13 + platformID + 1 + string + license text + + + encodingID + 1 + languageID + 1033 + nameID + 13 + platformID + 3 + string + license text + + + postscriptFontName + NameRecordsTest + + diff --git a/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs.background/contents.plist b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs.background/contents.plist new file mode 100644 index 000000000..0c67376eb --- /dev/null +++ b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs.background/contents.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs.background/layerinfo.plist b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs.background/layerinfo.plist new file mode 100644 index 000000000..6fef788af --- /dev/null +++ b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs.background/layerinfo.plist @@ -0,0 +1,8 @@ + + + + + color + 0,0.6,0.7,0.7 + + diff --git a/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs/a.glif b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs/a.glif new file mode 100644 index 000000000..ffb93db83 --- /dev/null +++ b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs/a.glif @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs/contents.plist b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs/contents.plist new file mode 100644 index 000000000..1f9067eda --- /dev/null +++ b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs/contents.plist @@ -0,0 +1,8 @@ + + + + + a + a.glif + + diff --git a/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs/layerinfo.plist b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs/layerinfo.plist new file mode 100644 index 000000000..cde8a2993 --- /dev/null +++ b/tests/tx_data/input/bug1467_unknown_key_array.ufo/glyphs/layerinfo.plist @@ -0,0 +1,8 @@ + + + + + color + 1,0.75,0,0.7 + + diff --git a/tests/tx_data/input/bug1467_unknown_key_array.ufo/layercontents.plist b/tests/tx_data/input/bug1467_unknown_key_array.ufo/layercontents.plist new file mode 100644 index 000000000..8964c5699 --- /dev/null +++ b/tests/tx_data/input/bug1467_unknown_key_array.ufo/layercontents.plist @@ -0,0 +1,14 @@ + + + + + + foreground + glyphs + + + background + glyphs.background + + + diff --git a/tests/tx_data/input/bug1467_unknown_key_array.ufo/lib.plist b/tests/tx_data/input/bug1467_unknown_key_array.ufo/lib.plist new file mode 100644 index 000000000..3bde0253d --- /dev/null +++ b/tests/tx_data/input/bug1467_unknown_key_array.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + com.defcon.sortDescriptor + + + ascending + Adobe Latin 1 + type + characterSet + + + public.glyphOrder + + .notdef + space + a + + + diff --git a/tests/tx_data/input/bug1467_unknown_key_array.ufo/metainfo.plist b/tests/tx_data/input/bug1467_unknown_key_array.ufo/metainfo.plist new file mode 100644 index 000000000..555d9ce4c --- /dev/null +++ b/tests/tx_data/input/bug1467_unknown_key_array.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.github.fonttools.ufoLib + formatVersion + 3 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/fontinfo.plist new file mode 100644 index 000000000..b2684bba3 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/fontinfo.plist @@ -0,0 +1,26 @@ + + + + + postscriptFontName + bluesarray-string-val + postscriptFDArray + + + PrivateDict + + postscriptBlueValues + invalid-string-for-bluesvaluesarray + postscriptStdHW + + 35 + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/bluesarray-string.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/fontinfo.plist new file mode 100644 index 000000000..6056e7d1f --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/fontinfo.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-dict.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/fontinfo.plist new file mode 100644 index 000000000..efab079c7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/fontinfo.plist @@ -0,0 +1,27 @@ + + + + + postscriptFontName + empty-key-name-in-fdarray + postscriptFDArray + + + + SourceHanSans-Heavy-Generic + PaintType + 3 + PrivateDict + + postscriptBlueValues + + -250 + -250 + 1100 + 1100 + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name-fdarray.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/fontinfo.plist new file mode 100644 index 000000000..cb94b8af0 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/fontinfo.plist @@ -0,0 +1,10 @@ + + + + + + empty-key-value + trademark + Copyright 2014-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. Source is a trademark of Adobe in the United States and/or other countries. + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-name.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/fontinfo.plist new file mode 100644 index 000000000..9ca1ff291 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/fontinfo.plist @@ -0,0 +1,10 @@ + + + + + postscriptFontName + + trademark + Copyright 2014-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. Source is a trademark of Adobe in the United States and/or other countries. + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/empty-key-value.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/fontinfo.plist new file mode 100644 index 000000000..305802955 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/fontinfo.plist @@ -0,0 +1,17 @@ + + + + + postscriptFontName + fontmatrix-string + FontMatrix + invalid-string-for-fontmatrix + trademark + Copyright 2014-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. Source is a trademark of Adobe in the United States and/or other countries. + + + \ No newline at end of file diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/fontmatrix-string.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/fontinfo.plist new file mode 100644 index 000000000..cfff88676 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/fontinfo.plist @@ -0,0 +1,10 @@ + + + + + + empty-key-value + trademark + Copyright 2014-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. Source is a trademark of Adobe in the United States and/or other countries. + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/invalid-key-name.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/fontinfo.plist new file mode 100644 index 000000000..07cbbccc0 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/fontinfo.plist @@ -0,0 +1,7 @@ + + + + + missing-key-name + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name-2.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/fontinfo.plist new file mode 100644 index 000000000..5387b8647 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/fontinfo.plist @@ -0,0 +1,9 @@ + + + + + missing-key-name + postscriptFontName + first-key-missing + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-name.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/fontinfo.plist new file mode 100644 index 000000000..2d0b5ad79 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/fontinfo.plist @@ -0,0 +1,7 @@ + + + + + postscriptFontName + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value-2.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/fontinfo.plist new file mode 100644 index 000000000..a41733c49 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/fontinfo.plist @@ -0,0 +1,9 @@ + + + + + postscriptFontName + trademark + Copyright 2014-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. Source is a trademark of Adobe in the United States and/or other countries. + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/missing-key-value.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/fontinfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/fontinfo.plist new file mode 100644 index 000000000..06b7f9c9e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/fontinfo.plist @@ -0,0 +1,34 @@ + + + + + postscriptFontName + bluesarray-string-val + postscriptFDArray + + + FontName + + -250 + -250 + 1100 + 1100 + + PrivateDict + + postscriptBlueValues + invalid-string-for-bluesvaluesarray + postscriptStdHW + + 35 + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid00000.glif b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid00000.glif new file mode 100644 index 000000000..c80be8f93 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid00000.glif @@ -0,0 +1,40 @@ + + + + + com.adobe.type.cid.CID + 0 + com.adobe.type.cid.iFD + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid17899.glif b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid17899.glif new file mode 100644 index 000000000..555d8b7dd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid17899.glif @@ -0,0 +1,121 @@ + + + + + com.adobe.type.cid.CID + 17899 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid17900.glif b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid17900.glif new file mode 100644 index 000000000..ef69b7741 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid17900.glif @@ -0,0 +1,163 @@ + + + + + com.adobe.type.cid.CID + 17900 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid17901.glif b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid17901.glif new file mode 100644 index 000000000..f1ea06ec4 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/cid17901.glif @@ -0,0 +1,147 @@ + + + + + com.adobe.type.cid.CID + 17901 + com.adobe.type.cid.iFD + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/contents.plist b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/contents.plist new file mode 100644 index 000000000..e582a5ffd --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/glyphs/contents.plist @@ -0,0 +1,14 @@ + + + + + cid00000 + cid00000.glif + cid17899 + cid17899.glif + cid17900 + cid17900.glif + cid17901 + cid17901.glif + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/lib.plist b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/lib.plist new file mode 100644 index 000000000..c69db61f7 --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/lib.plist @@ -0,0 +1,21 @@ + + + + + public.glyphOrder + + cid00000 + cid17899 + cid17900 + cid17901 + + com.adobe.type.cid.CIDFontName + Minimal-UFO + com.adobe.type.cid.Registry + Adobe + com.adobe.type.cid.Ordering + Identity + com.adobe.type.cid.Supplement + 0 + + diff --git a/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/metainfo.plist b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/metainfo.plist new file mode 100644 index 000000000..776c3395e --- /dev/null +++ b/tests/tx_data/input/ufo-fontinfo-parsing/switched-string-and-array.ufo/metainfo.plist @@ -0,0 +1,10 @@ + + + + + creator + com.adobe.type.tx + formatVersion + 2 + + diff --git a/tests/tx_test.py b/tests/tx_test.py index dac112a14..877b70261 100644 --- a/tests/tx_test.py +++ b/tests/tx_test.py @@ -1215,3 +1215,50 @@ def test_non_FDArray_dict_parse(): ufo_input_path = get_input_path("nonCIDKeyed_nonFDArrayDict.ufo") arg = [TOOL, '-t1', '-f', ufo_input_path] assert subprocess.call(arg) == 0 + + +@pytest.mark.parametrize('file, msg, ret_code', [ + ("empty-key-name", b'', 0), + ("empty-key-name-fdarray", b'', 0), + ("invalid-key-name", b'', 0), + ("missing-key-name", b'', 0), + ("missing-key-name-2", b'', 0), + ("empty-key-value", b'Warning: Encountered empty for fontinfo ' + + b'key postscriptFontName. Skipping', 0), + ("missing-key-value", b'', 0), + ("missing-key-value-2", b'', 0), + ("bluesarray-string", b'', 0), + ("fontmatrix-string", b'', 0), + ("switched-string-and-array", b'', 0), + ("empty-dict", b'', 0) +]) +def test_ufo_fontinfo_parsing(file, msg, ret_code): + folder = "ufo-fontinfo-parsing/" + ufo_input_path = get_input_path(folder + file + ".ufo") + expected_path = get_expected_path(folder + file + ".subset") + output_path = get_temp_file_path() + arg = CMD + ['-s', '-e', '-a', '-o', 't1', '-f', + ufo_input_path, output_path] + stderr_path = runner(arg) + with open(stderr_path, 'rb') as f: + output = f.read() + assert (msg) in output + if (ret_code == 0): + expected_path = generate_ps_dump(expected_path) + output_path = generate_ps_dump(output_path) + assert differ([expected_path, output_path]) + else: + arg = [TOOL, '-t1', '-f', ufo_input_path] + assert subprocess.call(arg) == 6 + + +def test_unknown_key_bug1467(): + """ + Tests a UFO with an unknown key and an value. + The previous implementation of fontinfo.plist parsing would cause a crash + in this scenario. The switch to the libxml2 implementation resolves this. + """ + input_path = get_input_path("bug1467_unknown_key_array.ufo") + expected_path = get_expected_path("bug1467_unknown_key_array.txt") + stdout_path = runner(CMD + ['-s', '-o', 'dump', '0', '-f', input_path]) + assert differ([expected_path, stdout_path, '-l', '1'])