From 7b5780ea83c13803811af040b639e1b3169569be Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Sat, 30 May 2020 06:20:37 +0000 Subject: [PATCH 1/3] updated fontforge to 20200314 --- buildScripts/buildFontforge | 51 +++++++--------------------- buildScripts/buildInstallLocallyApt | 4 --- buildScripts/versionEnvs | 4 +-- pdf2htmlEX/CMakeLists.txt | 4 +-- pdf2htmlEX/src/pdf2htmlEX.cc | 3 +- pdf2htmlEX/src/util/SignalHandler.cc | 2 +- pdf2htmlEX/src/util/ffw.c | 43 +++++++++++++---------- pdf2htmlEX/src/util/ffw.h | 2 -- 8 files changed, 43 insertions(+), 70 deletions(-) diff --git a/buildScripts/buildFontforge b/buildScripts/buildFontforge index 0dad173..e9c2c76 100755 --- a/buildScripts/buildFontforge +++ b/buildScripts/buildFontforge @@ -6,50 +6,25 @@ source buildScripts/reSourceVersionEnvs echo "" echo "-------------------------------------------------------------------" -echo "BUILDING FontForge" +echo "BUILDING FontForge (using CMake)" echo "-------------------------------------------------------------------" echo "" -# This is a work-around to fix TravisCI's declaration of PYTHON_CFLAGS -# which is then honoured exactly as is by the fontforge bootstrap and -# configure steps. -# -# see: https://github.com/travis-ci/travis-ci/issues/5301 (unfixed) -# - -echo "" -echo "PYTHON_CFLAGS:" -echo "-------------------------------" -export PYTHON_CFLAGS="$(python3-config --cflags) $PYTHON_CFLAGS" -echo $PYTHON_CFLAGS -echo "-------------------------------" -echo "" -echo "" -echo "PYTHON_LIBS:" -echo "-------------------------------" -export PYTHON_LIBS="$(python3-config --ldflags) $PYTHON_LIBS" -echo $PYTHON_LIBS -echo "-------------------------------" -echo "" - -# Can use "configure --disable-silent-rules" to debug configuration/make -# problems -# cd fontforge -./bootstrap +mkdir build -./configure \ - --prefix=$PDF2HTMLEX_PREFIX \ - --enable-python-scripting=3 \ - --disable-dependency-tracking \ - --disable-silent-rules \ - --disable-python-scripting \ - --disable-python-extension \ - --disable-shared \ - --enable-static \ - --with-pic \ - --without-x +cd build + +cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DCMAKE_INSTALL_PREFIX=$PDF2HTMLEX_PREFIX \ + -DENABLE_GUI:BOOL=OFF \ + -DENABLE_X11:BOOL=OFF \ + -DENABLE_PYTHON_SCRIPTING:BOOL=OFF \ + -DENABLE_PYTHON_EXTENSION:AUTO=OFF \ + .. # Apply any patches required for fontforge raw sources before we make # diff --git a/buildScripts/buildInstallLocallyApt b/buildScripts/buildInstallLocallyApt index 608a16d..7aa5e70 100755 --- a/buildScripts/buildInstallLocallyApt +++ b/buildScripts/buildInstallLocallyApt @@ -34,14 +34,10 @@ export PDF2HTMLEX_PREFIX=/usr/local ./buildScripts/buildPoppler || { echo 'buildPoppler FAILED' ; exit 1 ; } -#./buildScripts/installPoppler || { echo 'installPoppler FAILED' ; exit 1 ; } - ./buildScripts/getFontforge || { echo 'getFontforge FAILED' ; exit 1 ; } ./buildScripts/buildFontforge || { echo 'buildFontforge FAILED' ; exit 1 ; } -#./buildScripts/installFontforge || { echo 'installFontforge FAILED' ; exit 1 ; } - ./buildScripts/buildPdf2htmlEX || { echo 'buildPdf2htmlEX FAILED' ; exit 1 ; } ./buildScripts/installPdf2htmlEX || { echo 'installPdf2htmlEX FAILED' ; exit 1 ; } diff --git a/buildScripts/versionEnvs b/buildScripts/versionEnvs index 3412c83..f38df05 100755 --- a/buildScripts/versionEnvs +++ b/buildScripts/versionEnvs @@ -20,8 +20,8 @@ export POPPLER_VERSION=poppler-0.83.0 # see: https://github.com/fontforge/fontforge/releases # current working: 20190801 -#export FONTFORGE_VERSION=20200314 -export FONTFORGE_VERSION=20190801 +export FONTFORGE_VERSION=20200314 +#export FONTFORGE_VERSION=20190801 #export FONTFORGE_VERSION=20190413 #export FONTFORGE_VERSION=20190413 #export FONTFORGE_VERSION=20190317 diff --git a/pdf2htmlEX/CMakeLists.txt b/pdf2htmlEX/CMakeLists.txt index 2bc76a0..b617d20 100644 --- a/pdf2htmlEX/CMakeLists.txt +++ b/pdf2htmlEX/CMakeLists.txt @@ -73,9 +73,7 @@ include_directories( include_directories(${FONTFORGE_INCLUDE_DIRS}) link_directories(${FONTFORGE_LIBRARY_DIRS}) set(FONTFORGE_LIBRARIES ${FONTFORGE_LIBRARIES} - ${CMAKE_SOURCE_DIR}/../fontforge/fontforge/.libs/libfontforge.a - ${CMAKE_SOURCE_DIR}/../fontforge/Unicode/.libs/libgunicode.a - ${CMAKE_SOURCE_DIR}/../fontforge/gutils/.libs/libgutils.a + ${CMAKE_SOURCE_DIR}/../fontforge/build/lib/libfontforge.a ) set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} diff --git a/pdf2htmlEX/src/pdf2htmlEX.cc b/pdf2htmlEX/src/pdf2htmlEX.cc index edf32ee..9da5b19 100644 --- a/pdf2htmlEX/src/pdf2htmlEX.cc +++ b/pdf2htmlEX/src/pdf2htmlEX.cc @@ -63,9 +63,8 @@ void show_version_and_exit(const char * dummy = nullptr) cerr << "Copyright 2012-2015 Lu Wang and other contributors" << endl; cerr << "Libraries: " << endl; cerr << " poppler " << POPPLER_VERSION << endl; - cerr << " libfontforge " << ffwVersionInfo->majorVersion << "." << - ffwVersionInfo->minorVersion << "." << ffwVersionInfo->gitVersion << endl; cerr << " libfontforge (date) " << ffwVersionInfo->versionDate << endl; + cerr << " libfontforge (git) " << ffwVersionInfo->gitVersion << endl; #if ENABLE_SVG cerr << " cairo " << cairo_version_string() << endl; #endif diff --git a/pdf2htmlEX/src/util/SignalHandler.cc b/pdf2htmlEX/src/util/SignalHandler.cc index c19eedc..58a1301 100644 --- a/pdf2htmlEX/src/util/SignalHandler.cc +++ b/pdf2htmlEX/src/util/SignalHandler.cc @@ -157,8 +157,8 @@ void setupSignalHandler( detailInfo = detailInfo + "\n"; detailInfo = detailInfo + "Libraries:\n" ; detailInfo = detailInfo + " poppler " + POPPLER_VERSION + "\n"; - detailInfo = detailInfo + " libfontforge " + ffwVersionInfo->majorVersion + "." + ffwVersionInfo->minorVersion + "." + ffwVersionInfo->gitVersion + "\n"; detailInfo = detailInfo + " libfontforge (date) " + ffwVersionInfo->versionDate + "\n"; + detailInfo = detailInfo + " libfontforge (git) " + ffwVersionInfo->gitVersion + "\n"; #if ENABLE_SVG detailInfo = detailInfo + " cairo " + cairo_version_string() + "\n"; #endif diff --git a/pdf2htmlEX/src/util/ffw.c b/pdf2htmlEX/src/util/ffw.c index 9dc1d0a..e9a8aa4 100644 --- a/pdf2htmlEX/src/util/ffw.c +++ b/pdf2htmlEX/src/util/ffw.c @@ -18,21 +18,21 @@ #include "SignalHandler.h" -#include "ffw.h" // needed for: -#include "gfile.h" // FindProgDir -#include "fontforge-version-extras.h" // FONTFORGE_GIT_VERSION -#include "fontforge/autowidth.h" // FVRemoveKerns -#include "fontforge/bitmapchar.h" // SFReplaceEncodingBDFProps -#include "fontforge/cvimages.h" // FVImportImages -#include "fontforge/encoding.h" // (helpful as we have a name conflict) -#include "fontforge/fvfonts.h" // SFFindSlot -#include "fontforge/namelist.h" // UniFromName -#include "fontforge/savefont.h" // GenerateScript -#include "fontforge/splineorder2.h" // SFConvertToOrder2 -#include "fontforge/splineutil.h" // AltUniFree -#include "fontforge/splineutil2.h" // SplineFontNew -#include "fontforge/start.h" // InitSimpleStuff -#include "fontforge/tottf.h" // SFDefaultOS2Info +#include "ffw.h" // needed for: +#include "gfile.h" // FindProgDir +#include "fontforge-version-extras.h" // FONTFORGE_GIT_VERSION +#include "fontforge/autowidth.h" // FVRemoveKerns +#include "fontforge/bitmapchar.h" // SFReplaceEncodingBDFProps +#include "fontforge/cvimages.h" // FVImportImages +#include "fontforge/encoding.h" // (helpful as we have a name conflict) +#include "fontforge/fvfonts.h" // SFFindSlot +#include "fontforge/namelist.h" // UniFromName +#include "fontforge/savefont.h" // GenerateScript +#include "fontforge/splineorder2.h" // SFConvertToOrder2 +#include "fontforge/splineutil.h" // AltUniFree +#include "fontforge/splineutil2.h" // SplineFontNew +#include "fontforge/start.h" // InitSimpleStuff +#include "fontforge/tottf.h" // SFDefaultOS2Info static real EPS=1e-6; @@ -128,8 +128,6 @@ static FFWVersionInfo ffwVersionInfo; const FFWVersionInfo* ffw_get_version_info(void) { ffwVersionInfo.gitVersion = FONTFORGE_GIT_VERSION; - ffwVersionInfo.majorVersion = xstr(FONTFORGE_VERSION_MAJOR); - ffwVersionInfo.minorVersion = xstr(FONTFORGE_VERSION_MINOR); ffwVersionInfo.versionDate = FONTFORGE_VERSION; return &ffwVersionInfo; @@ -528,7 +526,16 @@ void ffw_import_svg_glyph(int code, const char * filename, double ox, double oy, memset(cur_fv->selected, 0, cur_fv->map->enccount); cur_fv->selected[enc] = 1; - int ok = FVImportImages(cur_fv, (char*)filename, fv_svg, 0, -1); + ImportParams ip; + InitImportParams(&ip); + int ok = FVImportImages( + cur_fv, + (char*)filename, + fv_svg, + 0 /*toback*/, + true /*preclear*/, + &ip + ); if(!ok) err("Import SVG glyph failed"); diff --git a/pdf2htmlEX/src/util/ffw.h b/pdf2htmlEX/src/util/ffw.h index 1e5e35f..ed9dc04 100644 --- a/pdf2htmlEX/src/util/ffw.h +++ b/pdf2htmlEX/src/util/ffw.h @@ -26,8 +26,6 @@ void ffw_finalize(void); typedef struct ffw_version_info { const char* gitVersion; - const char* majorVersion; - const char* minorVersion; const char* versionDate; } FFWVersionInfo ; From 930915df348ea7e0084d98c2f280aa083b89af39 Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Sat, 30 May 2020 06:59:21 +0000 Subject: [PATCH 2/3] removed fontforge git version as it is not a stable representation of 20200314 version --- pdf2htmlEX/src/pdf2htmlEX.cc | 1 - pdf2htmlEX/src/util/SignalHandler.cc | 1 - pdf2htmlEX/src/util/ffw.c | 2 -- pdf2htmlEX/src/util/ffw.h | 1 - 4 files changed, 5 deletions(-) diff --git a/pdf2htmlEX/src/pdf2htmlEX.cc b/pdf2htmlEX/src/pdf2htmlEX.cc index 9da5b19..8d805b2 100644 --- a/pdf2htmlEX/src/pdf2htmlEX.cc +++ b/pdf2htmlEX/src/pdf2htmlEX.cc @@ -64,7 +64,6 @@ void show_version_and_exit(const char * dummy = nullptr) cerr << "Libraries: " << endl; cerr << " poppler " << POPPLER_VERSION << endl; cerr << " libfontforge (date) " << ffwVersionInfo->versionDate << endl; - cerr << " libfontforge (git) " << ffwVersionInfo->gitVersion << endl; #if ENABLE_SVG cerr << " cairo " << cairo_version_string() << endl; #endif diff --git a/pdf2htmlEX/src/util/SignalHandler.cc b/pdf2htmlEX/src/util/SignalHandler.cc index 58a1301..f98edc5 100644 --- a/pdf2htmlEX/src/util/SignalHandler.cc +++ b/pdf2htmlEX/src/util/SignalHandler.cc @@ -158,7 +158,6 @@ void setupSignalHandler( detailInfo = detailInfo + "Libraries:\n" ; detailInfo = detailInfo + " poppler " + POPPLER_VERSION + "\n"; detailInfo = detailInfo + " libfontforge (date) " + ffwVersionInfo->versionDate + "\n"; - detailInfo = detailInfo + " libfontforge (git) " + ffwVersionInfo->gitVersion + "\n"; #if ENABLE_SVG detailInfo = detailInfo + " cairo " + cairo_version_string() + "\n"; #endif diff --git a/pdf2htmlEX/src/util/ffw.c b/pdf2htmlEX/src/util/ffw.c index e9a8aa4..ff2473f 100644 --- a/pdf2htmlEX/src/util/ffw.c +++ b/pdf2htmlEX/src/util/ffw.c @@ -20,7 +20,6 @@ #include "ffw.h" // needed for: #include "gfile.h" // FindProgDir -#include "fontforge-version-extras.h" // FONTFORGE_GIT_VERSION #include "fontforge/autowidth.h" // FVRemoveKerns #include "fontforge/bitmapchar.h" // SFReplaceEncodingBDFProps #include "fontforge/cvimages.h" // FVImportImages @@ -127,7 +126,6 @@ static FFWVersionInfo ffwVersionInfo; const FFWVersionInfo* ffw_get_version_info(void) { - ffwVersionInfo.gitVersion = FONTFORGE_GIT_VERSION; ffwVersionInfo.versionDate = FONTFORGE_VERSION; return &ffwVersionInfo; diff --git a/pdf2htmlEX/src/util/ffw.h b/pdf2htmlEX/src/util/ffw.h index ed9dc04..50a7f50 100644 --- a/pdf2htmlEX/src/util/ffw.h +++ b/pdf2htmlEX/src/util/ffw.h @@ -25,7 +25,6 @@ void ffw_init(const char* progPath, int debug); void ffw_finalize(void); typedef struct ffw_version_info { - const char* gitVersion; const char* versionDate; } FFWVersionInfo ; From e4c666b4bf280c3d29c0d58cde78d4a973f12b91 Mon Sep 17 00:00:00 2001 From: Stephen Gaito Date: Sat, 30 May 2020 07:46:22 +0000 Subject: [PATCH 3/3] corrected ill advised copy of libfontconfig into appImage --- buildScripts/createAppImage | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buildScripts/createAppImage b/buildScripts/createAppImage index 1cb86d2..e9fd107 100755 --- a/buildScripts/createAppImage +++ b/buildScripts/createAppImage @@ -31,9 +31,11 @@ make install prefix=$PDF2HTMLEX_PREFIX DESTDIR=../imageBuild/appDir cd ../imageBuild -# force libfontconfig into AppImage (linuxdeploy blacklists libfontconfig) +# force libfontconfig into AppImage (linuxdeploy blacklists libfontconfig) +# (turned off since libfontconfig needs to be matched to the underlying +# OS's collection of fonts and /etc/fonts configuration files) # -cp /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 appDir/usr/lib/ +#cp /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 appDir/usr/lib/ LINUX_DEPLOY_APP_IMAGE=linuxdeploy-$MACHINE_ARCH.AppImage