diff --git a/.github/workflows/alpine-x86_64.yml b/.github/workflows/alpine-x86_64.yml index dd4a8d76..6907cd64 100644 --- a/.github/workflows/alpine-x86_64.yml +++ b/.github/workflows/alpine-x86_64.yml @@ -51,6 +51,7 @@ jobs: - name: Create cache storage and cache key run: | mkdir ${{ env.VCPKG_DEFAULT_BINARY_CACHE }} + git config --global --add safe.directory $(pwd) git submodule status > sm.txt - name: Process cache @@ -61,10 +62,14 @@ jobs: - name: Configure CMake run: | - cmake -B . -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-linux -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-linux -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build - run: cmake --build . --config ${{env.BUILD_TYPE}} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} - name: Test well formed files run: ./tests/resources/check_correctness.sh -r -s @@ -100,6 +105,7 @@ jobs: - name: Create cache storage and cache key run: | mkdir ${{ env.VCPKG_DEFAULT_BINARY_CACHE }} + git config --global --add safe.directory /__w/libemf2svg/libemf2svg git submodule status > sm.txt - name: Process cache @@ -110,13 +116,17 @@ jobs: - name: Configure CMake run: | - cmake -B . -DCMAKE_BUILD_TYPE=Release \ - -DVCPKG_TARGET_TRIPLET=x64-linux \ - -DLONLY=ON \ - -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DVCPKG_TARGET_TRIPLET=x64-linux \ + -DLONLY=ON \ + -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build - run: cmake --build . --config ${{env.BUILD_TYPE}} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} - name: Checkout shell test framework uses: actions/checkout@v3 diff --git a/.github/workflows/macos-arm64.yml b/.github/workflows/macos-arm64.yml index a96b1503..66409f5e 100644 --- a/.github/workflows/macos-arm64.yml +++ b/.github/workflows/macos-arm64.yml @@ -48,14 +48,18 @@ jobs: - name: Configure CMake run: | - cmake -B ${{ github.workspace }} \ - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -DVCPKG_TARGET_TRIPLET=arm64-osx \ - -DLONLY=ON \ + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DVCPKG_TARGET_TRIPLET=arm64-osx \ + -DLONLY=ON \ -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build - run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} + - name: Checkout shell test framework uses: actions/checkout@v3 diff --git a/.github/workflows/macos-x86_64.yml b/.github/workflows/macos-x86_64.yml index 7a170cd8..d7c16168 100644 --- a/.github/workflows/macos-x86_64.yml +++ b/.github/workflows/macos-x86_64.yml @@ -31,10 +31,16 @@ jobs: brew install --HEAD LouisBrunner/valgrind/valgrind - name: Configure CMake - run: cmake -B ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + run: | + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - name: Build - run: cmake --build ${{ github.workspace }} --config ${{ env.BUILD_TYPE }} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} + - name: Test well formed files working-directory: ${{ github.workspace }} @@ -79,14 +85,17 @@ jobs: - name: Configure CMake run: | - cmake -B ${{ github.workspace }} \ - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -DVCPKG_TARGET_TRIPLET=x64-osx \ - -DLONLY=ON \ - -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DVCPKG_TARGET_TRIPLET=x64-osx \ + -DLONLY=ON \ + -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build - run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} - name: Checkout shell test framework uses: actions/checkout@v3 diff --git a/.github/workflows/msys-x86_64.yml b/.github/workflows/msys-x86_64.yml index bbaa5552..89eedd63 100644 --- a/.github/workflows/msys-x86_64.yml +++ b/.github/workflows/msys-x86_64.yml @@ -59,17 +59,21 @@ jobs: - name: Configure run: | - cmake -B . -DCMAKE_BUILD_TYPE=Release \ - -DVCPKG_TARGET_TRIPLET=x64-mingw-static \ - -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DVCPKG_TARGET_TRIPLET=x64-mingw-static \ + -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build - run: cmake --build . --config ${{env.BUILD_TYPE}} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} - name: Smoke test run: | - ./emf2svg-conv.exe --version - ./emf2svg-conv.exe -i tests/resources/emf/test-000.emf -o test-000.svg + ./build/emf2svg-conv.exe --version + ./build/emf2svg-conv.exe -i tests/resources/emf/test-000.emf -o test-000.svg ls | grep test-000.svg build-for-ruby: @@ -119,13 +123,17 @@ jobs: - name: Configure run: | - cmake -B . -DCMAKE_BUILD_TYPE=Release \ - -DVCPKG_TARGET_TRIPLET=x64-mingw-static \ - -DLONLY=ON \ - -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DVCPKG_TARGET_TRIPLET=x64-mingw-static \ + -DLONLY=ON \ + -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build - run: cmake --build . --config ${{env.BUILD_TYPE}} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} - name: Checkout shell test framework uses: actions/checkout@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d85fe1ae..3d38e6f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: rm -rf libemf2svg/vcpkg/.git* rm -rf libemf2svg/tests tar cvzf libemf2svg.tar.gz libemf2svg - sha256sum libemf2svg.tar.gz > libemf2svg.tar.gz.sha256 + sha256sum -b libemf2svg.tar.gz > libemf2svg.tar.gz.sha256 - name: Release uses: softprops/action-gh-release@v1 diff --git a/.github/workflows/ubuntu-aarch64.yml b/.github/workflows/ubuntu-aarch64.yml index a138cbb0..c6602b40 100644 --- a/.github/workflows/ubuntu-aarch64.yml +++ b/.github/workflows/ubuntu-aarch64.yml @@ -45,17 +45,20 @@ jobs: - name: Configure CMake run: | - cmake -B ${{ github.workspace }} \ - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \ -DVCPKG_TARGET_TRIPLET=arm64-linux - name: Build - run: cmake --build ${{ github.workspace }} --config ${{env.BUILD_TYPE}} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} - name: Smoke test run: | - qemu-aarch64 -L /usr/aarch64-linux-gnu ${{ github.workspace }}/emf2svg-conv --version - qemu-aarch64 -L /usr/aarch64-linux-gnu ${{ github.workspace }}/emf2svg-conv \ + qemu-aarch64 -L /usr/aarch64-linux-gnu ${{ github.workspace }}/build/emf2svg-conv --version + qemu-aarch64 -L /usr/aarch64-linux-gnu ${{ github.workspace }}/build/emf2svg-conv \ -i ${{ github.workspace }}/tests/resources/emf/test-000.emf -o test-000.svg ls | grep test-000.svg diff --git a/.github/workflows/ubuntu-x86_64.yml b/.github/workflows/ubuntu-x86_64.yml index 2a0ee745..afac24ce 100644 --- a/.github/workflows/ubuntu-x86_64.yml +++ b/.github/workflows/ubuntu-x86_64.yml @@ -29,10 +29,15 @@ jobs: sudo apt-get install libxml2-utils valgrind - name: Configure CMake - run: cmake -B ${{ github.workspace }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} + run: | + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - name: Build - run: cmake --build ${{ github.workspace }} --config ${{env.BUILD_TYPE }} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE }} - name: Test well formed files working-directory: ${{ github.workspace }} @@ -61,10 +66,15 @@ jobs: run: sudo pip install cpp-coveralls - name: Configure CMake - run: cmake -B ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug -DGCOV=ON + run: | + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Debug -DGCOV=ON - name: Build - run: make coverage + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} - name: Report run: | @@ -104,13 +114,17 @@ jobs: - name: Configure CMake run: | - cmake -B . -DCMAKE_BUILD_TYPE=Release \ - -DVCPKG_TARGET_TRIPLET=x64-linux \ - -DLONLY=ON \ - -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release \ + -DVCPKG_TARGET_TRIPLET=x64-linux \ + -DLONLY=ON \ + -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build - run: cmake --build . --config ${{env.BUILD_TYPE}} + run: | + cd build + cmake --build . --config ${{env.BUILD_TYPE}} - name: Checkout shell test framework uses: actions/checkout@v3 diff --git a/.github/workflows/windows-x86_64.yml b/.github/workflows/windows-x86_64.yml index b3410557..5b91e58a 100644 --- a/.github/workflows/windows-x86_64.yml +++ b/.github/workflows/windows-x86_64.yml @@ -38,14 +38,10 @@ jobs: key: ${{ github.workflow }}-vcpkg-${{ hashFiles('sm.txt') }} - name: Configure - run: > - cmake - -B ${{ github.workspace }} - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake + run: cmake -B . -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake - name: Build - run: cmake --build ${{ github.workspace }} --config ${{env.BUILD_TYPE}} + run: cmake --build . --config ${{env.BUILD_TYPE}} - name: Smoke test run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f6c64af..40ffd0fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ project (emf2svg) set(emf2svg_VERSION_MAJOR 1) set(emf2svg_VERSION_MINOR 7) -set(emf2svg_VERSION_PATCH 0) +set(emf2svg_VERSION_PATCH 1) set(emf2svg_VERSION ${emf2svg_VERSION_MAJOR}.${emf2svg_VERSION_MINOR}.${emf2svg_VERSION_PATCH}) if(VCPKG_TARGET_TRIPLET) diff --git a/README.md b/README.md index a5c00633..11ed6e5b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ libemf2svg ========== -[![Ubuntu-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/ubuntu-x86_64.yml/badge.svg)](https://github.com/metanorma/libemf2svg/actions/workflows/ubuntu-x86_64.yml) [![Ubuntu-aarch64](https://github.com/metanorma/libemf2svg/actions/workflows/ubuntu-aarch64.yml/badge.svg)](https://github.com/metanorma/libemf2svg/actions/workflows/ubuntu-aarch64.yml) [![Alpine-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/alpine-x86_64.yml/badge.svg)](https://github.com/metanorma/libemf2svg/actions/workflows/alpine-x86_64.yml) +[![Ubuntu-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/ubuntu-x86_64.yml/badge.svg?branch=master)](https://github.com/metanorma/libemf2svg/actions/workflows/ubuntu-x86_64.yml) [![Ubuntu-aarch64](https://github.com/metanorma/libemf2svg/actions/workflows/ubuntu-aarch64.yml/badge.svg?branch=master)](https://github.com/metanorma/libemf2svg/actions/workflows/ubuntu-aarch64.yml) [![Alpine-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/alpine-x86_64.yml/badge.svg?branch=master)](https://github.com/metanorma/libemf2svg/actions/workflows/alpine-x86_64.yml) -[![MacOS-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/macos-x86_64.yml/badge.svg)](https://github.com/metanorma/libemf2svg/actions/workflows/macos-x86_64.yml) [![MacOS-arm64](https://github.com/metanorma/libemf2svg/actions/workflows/macos-arm64.yml/badge.svg)](https://github.com/metanorma/libemf2svg/actions/workflows/macos-arm64.yml) [![Windows-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/windows-x86_64.yml/badge.svg)](https://github.com/metanorma/libemf2svg/actions/workflows/windows-x86_64.yml) [![MSys-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/msys-x86_64.yml/badge.svg)](https://github.com/metanorma/libemf2svg/actions/workflows/msys-x86_64.yml) +[![MacOS-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/macos-x86_64.yml/badge.svg?branch=master)](https://github.com/metanorma/libemf2svg/actions/workflows/macos-x86_64.yml) [![MacOS-arm64](https://github.com/metanorma/libemf2svg/actions/workflows/macos-arm64.yml/badge.svg?branch=master)](https://github.com/metanorma/libemf2svg/actions/workflows/macos-arm64.yml) [![Windows-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/windows-x86_64.yml/badge.svg?branch=master)](https://github.com/metanorma/libemf2svg/actions/workflows/windows-x86_64.yml) [![MSys-x86_64](https://github.com/metanorma/libemf2svg/actions/workflows/msys-x86_64.yml/badge.svg?branch=master)](https://github.com/metanorma/libemf2svg/actions/workflows/msys-x86_64.yml) [![Coverage Status](https://coveralls.io/repos/github/metanorma/libemf2svg/badge.svg?branch=master)](https://coveralls.io/github/metanorma/libemf2svg?branch=master) @@ -231,9 +231,13 @@ EMF+ RECORDS: ChangeLogs ---------- +1.7.1: + +* added width and heigt attributes for svg even when Y-coordinates are repaired + 1.7.0: -* refactor build scripts to facilitate better portability and ruby integration +* refactor build scripts to facilitate better portability and ruby integration 1.6.0: diff --git a/src/lib/emf2svg_rec_control.c b/src/lib/emf2svg_rec_control.c index 1a3ff309..036e3b1d 100644 --- a/src/lib/emf2svg_rec_control.c +++ b/src/lib/emf2svg_rec_control.c @@ -142,10 +142,12 @@ void U_EMRHEADER_draw(const char *contents, FILE *out, drawingStates *states) { fprintf(out, "xmlns:%s=\"http://www.w3.org/2000/svg\"", states->nameSpace); } - + // https://www.w3.org/TR/SVG2/coords.html if (states->fixBrokenYTransform) { - fprintf(out, ">\n"); - fprintf(out, "<%sg transform=\"translate(0.0000, 0.0000)\">\n", + fprintf(out, " width=\"%.4f\" height=\"%.4f\">\n", + states->imgWidth + 1, + states->imgHeight + 1); + fprintf(out, "<%sg transform=\"translate(0.0000, 0.00 00)\">\n", states->nameSpaceString); } else { fprintf(out, " width=\"%.4f\" height=\"%.4f\">\n", states->imgWidth, diff --git a/tests/resources/check_correctness.sh b/tests/resources/check_correctness.sh index f618c103..ef905459 100755 --- a/tests/resources/check_correctness.sh +++ b/tests/resources/check_correctness.sh @@ -89,7 +89,7 @@ cd $ABSPATH . ./colors.sh rm -rf $OUTDIR mkdir -p $OUTDIR -CMD="`$RL -f ../../emf2svg-conv`" +CMD="`$RL -f ../../build/emf2svg-conv`" OUTDIR=`$RL -f $OUTDIR` DTD=`$RL -f ./svg11-flat.dtd` for emf in `find $EMFDIR -type f -name "*.emf" |sort` diff --git a/tests/resources/emf-ea/EA-test-file-101.emf b/tests/resources/emf-ea/EA-test-file-101.emf new file mode 100755 index 00000000..5d92ca6e Binary files /dev/null and b/tests/resources/emf-ea/EA-test-file-101.emf differ diff --git a/tests/resources/emf-ea/EA-test-file-102.emf b/tests/resources/emf-ea/EA-test-file-102.emf new file mode 100755 index 00000000..4d955c6c Binary files /dev/null and b/tests/resources/emf-ea/EA-test-file-102.emf differ diff --git a/tests/resources/lcheck.sh b/tests/resources/lcheck.sh index b90255a1..8430d37f 100755 --- a/tests/resources/lcheck.sh +++ b/tests/resources/lcheck.sh @@ -83,6 +83,6 @@ DIR_ROOT="$( cd "$DIR1" && pwd )" DIR_TESTS="$( cd "$DIR0/.." && pwd)" echo "Running libemf2svg linkage tests" -probe="$DIR_ROOT/libemf2svg" +probe="$DIR_ROOT/build/libemf2svg" # shellcheck source=/dev/null . "$DIR_TESTS"/shunit2/shunit2 diff --git a/vcpkg.json b/vcpkg.json index fd785183..f4e97852 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "libemf2svg", - "version-string": "1.7.0", + "version-string": "1.7.1", "dependencies": [ "libxml2", "libpng",