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/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 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..8d805b2 100644 --- a/pdf2htmlEX/src/pdf2htmlEX.cc +++ b/pdf2htmlEX/src/pdf2htmlEX.cc @@ -63,8 +63,6 @@ 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; #if ENABLE_SVG cerr << " cairo " << cairo_version_string() << endl; diff --git a/pdf2htmlEX/src/util/SignalHandler.cc b/pdf2htmlEX/src/util/SignalHandler.cc index c19eedc..f98edc5 100644 --- a/pdf2htmlEX/src/util/SignalHandler.cc +++ b/pdf2htmlEX/src/util/SignalHandler.cc @@ -157,7 +157,6 @@ 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"; #if ENABLE_SVG detailInfo = detailInfo + " cairo " + cairo_version_string() + "\n"; diff --git a/pdf2htmlEX/src/util/ffw.c b/pdf2htmlEX/src/util/ffw.c index 9dc1d0a..ff2473f 100644 --- a/pdf2htmlEX/src/util/ffw.c +++ b/pdf2htmlEX/src/util/ffw.c @@ -18,21 +18,20 @@ #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/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; @@ -127,9 +126,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 +524,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..50a7f50 100644 --- a/pdf2htmlEX/src/util/ffw.h +++ b/pdf2htmlEX/src/util/ffw.h @@ -25,9 +25,6 @@ void ffw_init(const char* progPath, int debug); void ffw_finalize(void); typedef struct ffw_version_info { - const char* gitVersion; - const char* majorVersion; - const char* minorVersion; const char* versionDate; } FFWVersionInfo ;