diff --git a/pdf2htmlEX.1.in b/pdf2htmlEX.1.in index f437a6f..59e1fa8 100644 --- a/pdf2htmlEX.1.in +++ b/pdf2htmlEX.1.in @@ -178,6 +178,12 @@ If set to 1, glyphs narrower than described in PDF will be stretched; otherwise .B --squeeze-wide-glyph <0|1> (Default: 1) If set to 1, glyphs wider than described in PDF will be squeezed; otherwise it will be truncated. +.TP +.B --override-fstype <0|1> (Default: 0) +Clear the fstype bits in TTF/OTF fonts. + +Turn this on if Internet Explorer complains about 'Permission must be Installable' AND you have permission to do so. + .SS Text .TP @@ -231,6 +237,8 @@ Specify user password .B --no-drm <0|1> (Default: 0) Override document DRM settings +Turn this on only when you have permission. + .SS Misc. .TP diff --git a/src/HTMLRenderer/font.cc b/src/HTMLRenderer/font.cc index 0f11453..4bb4b17 100644 --- a/src/HTMLRenderer/font.cc +++ b/src/HTMLRenderer/font.cc @@ -561,7 +561,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo /* * Step 5 - * Generate the font and load the metrics + * Generate the font, load the metrics and set the embeddig bits (fstype) * * Ascent/Descent are not used in PDF, and the values in PDF may be wrong or inconsistent (there are 3 sets of them) * We need to reload in order to retrieve/fix accurate ascent/descent, some info won't be written to the font by fontforge until saved. @@ -575,6 +575,8 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo ffw_load_font(cur_tmp_fn.c_str()); ffw_metric(&info.ascent, &info.descent); + if(param.override_fstype) + ffw_override_fstype(); ffw_save(fn.c_str()); ffw_close(); diff --git a/src/Param.h b/src/Param.h index 7a4a66b..e9e1f7b 100644 --- a/src/Param.h +++ b/src/Param.h @@ -48,6 +48,7 @@ struct Param std::string external_hint_tool; int stretch_narrow_glyph; int squeeze_wide_glyph; + int override_fstype; // text double h_eps, v_eps; diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index f54aafd..e17e531 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -131,6 +131,7 @@ void parse_options (int argc, char **argv) .add("external-hint-tool", ¶m.external_hint_tool, "", "external tool for hinting fonts (overrides --auto-hint)") .add("stretch-narrow-glyph", ¶m.stretch_narrow_glyph, 0, "stretch narrow glyphs instead of padding them") .add("squeeze-wide-glyph", ¶m.squeeze_wide_glyph, 1, "shrink wide glyphs instead of truncating them") + .add("override-fstype", ¶m.override_fstype, 0, "clear the fstype bits in TTF/OTF fonts") // text .add("heps", ¶m.h_eps, 1.0, "horizontal threshold for merging text, in pixels") diff --git a/src/util/ffw.c b/src/util/ffw.c index 122691e..31a96b4 100644 --- a/src/util/ffw.c +++ b/src/util/ffw.c @@ -414,3 +414,10 @@ void ffw_auto_hint(void) FVAutoHint(cur_fv); FVAutoInstr(cur_fv); } + +void ffw_override_fstype(void) +{ + *(int16 *)(&cur_fv->sf->pfminfo.fstype) = 0; + cur_fv->sf->pfminfo.pfmset = true; + cur_fv->sf->changed = true; +} diff --git a/src/util/ffw.h b/src/util/ffw.h index 2cfb9ef..bc87b4f 100644 --- a/src/util/ffw.h +++ b/src/util/ffw.h @@ -55,6 +55,7 @@ void ffw_set_widths(int * width_list, int mapping_len, //////////////////////// // others void ffw_auto_hint(void); +void ffw_override_fstype(void); #ifdef __cplusplus }