add fixes for issues 70, g9, 68, 66, and 65

This commit is contained in:
Stephen Gaito 2020-06-29 11:39:52 +00:00
parent a865e23b4a
commit 89c74c7b21
9 changed files with 28 additions and 15 deletions

View File

@ -40,7 +40,7 @@ cmake \
-DWITH_JPEG=ON \
-DWITH_PNG=ON \
-DWITH_TIFF=OFF \
-DWITH_NSS=OFF \
-DWITH_NSS3=OFF \
-DWITH_Cairo=ON \
..

View File

@ -59,6 +59,11 @@ WORKDIR /root
RUN chmod a+x $ALPINE_NAME.install && \
./$ALPINE_NAME.install
# make the /pdf directory the default working directory for any run of
# pdf2htmlEX
#
WORKDIR /pdf
ENTRYPOINT ["$PDF2HTMLEX_PREFIX/bin/pdf2htmlEX"]
DOCKERFILE_HERE_DOC

View File

@ -59,7 +59,12 @@ COPY ./$DPKG_NAME /root
RUN apt update && \
apt -y upgrade && \
apt -y --no-install-recommends install \
/root/$DPKG_NAME
/root/$DPKG_NAME
# make the /pdf directory the default working directory for any run of
# pdf2htmlEX
#
WORKDIR /pdf
ENTRYPOINT ["$PDF2HTMLEX_PREFIX/bin/pdf2htmlEX"]
DOCKERFILE_HERE_DOC

View File

@ -10,7 +10,11 @@ option(ENABLE_SVG "Enable SVG support, for generating SVG background images and
include_directories(${CMAKE_SOURCE_DIR}/src)
set(PDF2HTMLEX_VERSION "0.18.7")
# Read/Set Cmake's PDF2HTMLEX_VERSION directly from the shell environment
# variable PDF2HTMLEX_VERSION
#
set(PDF2HTMLEX_VERSION $ENV{PDF2HTMLEX_VERSION})
#
set(ARCHIVE_NAME pdf2htmlex-${PDF2HTMLEX_VERSION})
add_custom_target(dist
COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD

View File

@ -1,12 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 135e02f..97c7035 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
option(ENABLE_SVG "Enable SVG support, for generating SVG background images and converting Type 3 fonts" ON)
+include_directories(${CMAKE_INSTALL_PREFIX}/include)
include_directories(${CMAKE_SOURCE_DIR}/src)
set(PDF2HTMLEX_VERSION "0.15.0")

View File

@ -174,6 +174,10 @@ Specify the format of fonts extracted from the PDF file.
.B \-\-decompose\-ligature <0|1> (Default: 0)
Decompose ligatures. For example 'fi' \-> 'f''i'.
.TP
.B \-\-turn\-off\-ligatures <0|1> (Default: 0)
Explicitly tell browsers not to use ligatures.
.TP
.B \-\-auto\-hint <0|1> (Default: 0)
If set to 1, hints will be generated for the fonts using FontForge.

View File

@ -1001,6 +1001,10 @@ void HTMLRenderer::install_external_font(GfxFont * font, FontInfo & info)
void HTMLRenderer::export_remote_font(const FontInfo & info, const string & format, GfxFont * font)
{
string css_turn_off_ligatures = "";
if (param.turn_off_ligatures) {
css_turn_off_ligatures = "font-variant-ligatures:none;font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "hlig" 0, "calt" 0;";
}
string css_font_format;
if(format == "ttf")
{
@ -1055,6 +1059,7 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & form
f_css.fs << ")"
<< "format(\"" << css_font_format << "\");"
<< css_turn_off_ligatures
<< "}" // end of @font-face
<< "." << CSS::FONT_FAMILY_CN << info.id << "{"
<< "font-family:" << CSS::FONT_FAMILY_CN << info.id << ";"

View File

@ -51,6 +51,7 @@ struct Param
int embed_external_font;
std::string font_format;
int decompose_ligature;
int turn_off_ligatures;
int auto_hint;
std::string external_hint_tool;
int stretch_narrow_glyph;

View File

@ -170,6 +170,7 @@ void parse_options (int argc, char **argv)
.add("embed-external-font", &param.embed_external_font, 1, "embed local match for external fonts")
.add("font-format", &param.font_format, "woff", "suffix for embedded font files (ttf,otf,woff,svg)")
.add("decompose-ligature", &param.decompose_ligature, 0, "decompose ligatures, such as \uFB01 -> fi")
.add("turn-off-ligatures", &param.turn_off_ligatures, 0, "explicitly tell browsers not to use ligatures")
.add("auto-hint", &param.auto_hint, 0, "use fontforge autohint on fonts without hints")
.add("external-hint-tool", &param.external_hint_tool, "", "external tool for hinting fonts (overrides --auto-hint)")
.add("stretch-narrow-glyph", &param.stretch_narrow_glyph, 0, "stretch narrow glyphs instead of padding them")