diff --git a/pdf2htmlEX.1.in b/pdf2htmlEX.1.in index b57f592..9a5ffcb 100644 --- a/pdf2htmlEX.1.in +++ b/pdf2htmlEX.1.in @@ -151,7 +151,7 @@ Specify whether the local matched fonts, for fonts not embedded in PDF, should b If this switch is off, only font names are exported such that web browsers may try to find proper fonts themselves, and that might cause issues about incorrect font metrics. .TP -.B --font-format (Default: ttf) +.B --font-format (Default: woff) Specify the format of fonts extracted from the PDF file. .TP diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in index 0da0f84..01a4b30 100644 --- a/share/pdf2htmlEX.js.in +++ b/share/pdf2htmlEX.js.in @@ -183,15 +183,15 @@ // scale the content box { - var s = this.content_box.style; - s.msTransform = s.webkitTransform = s.transform = 'scale('+this.cur_scale.toFixed(3)+')'; + var cbs = this.content_box.style; + cbs.msTransform = cbs.webkitTransform = cbs.transform = 'scale('+this.cur_scale.toFixed(3)+')'; } // stretch the page frame to hold the place { - var s = this.p.style; - s.height = (this.original_height * this.cur_scale) + 'px'; - s.width = (this.original_width * this.cur_scale) + 'px'; + var ps = this.p.style; + ps.height = (this.original_height * this.cur_scale) + 'px'; + ps.width = (this.original_width * this.cur_scale) + 'px'; } }, /* return if any part of this page is shown in the container */ diff --git a/src/HTMLRenderer/font.cc b/src/HTMLRenderer/font.cc index 35ad668..4599297 100644 --- a/src/HTMLRenderer/font.cc +++ b/src/HTMLRenderer/font.cc @@ -746,17 +746,17 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo /* * Step 3 - * - * Reencode to Unicode Full such that FontForge won't ditch unicode values larger than 0xFFFF - * * Generate the font as desired - * */ + + // Reencode to Unicode Full such that FontForge won't ditch unicode values larger than 0xFFFF ffw_reencode_unicode_full(); - string cur_tmp_fn = (char*)str_fmt("%s/__tmp_font1.%s", param.tmp_dir.c_str(), param.font_format.c_str()); + // Due to a bug of Fontforge about pfa -> woff conversion + // we always generate TTF first, instead of the format specified by user + string cur_tmp_fn = (char*)str_fmt("%s/__tmp_font1.%s", param.tmp_dir.c_str(), "ttf"); tmp_files.add(cur_tmp_fn); - string other_tmp_fn = (char*)str_fmt("%s/__tmp_font2.%s", param.tmp_dir.c_str(), param.font_format.c_str()); + string other_tmp_fn = (char*)str_fmt("%s/__tmp_font2.%s", param.tmp_dir.c_str(), "ttf"); tmp_files.add(other_tmp_fn); ffw_save(cur_tmp_fn.c_str()); diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index 85d7254..7da4150 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -140,7 +140,7 @@ void parse_options (int argc, char **argv) // fonts .add("embed-external-font", ¶m.embed_external_font, 1, "embed local match for external fonts") - .add("font-format", ¶m.font_format, "ttf", "suffix for embedded font files (ttf,otf,woff,svg)") + .add("font-format", ¶m.font_format, "woff", "suffix for embedded font files (ttf,otf,woff,svg)") .add("decompose-ligature", ¶m.decompose_ligature, 0, "decompose ligatures, such as \uFB01 -> fi") .add("auto-hint", ¶m.auto_hint, 0, "use fontforge autohint on fonts without hints") .add("external-hint-tool", ¶m.external_hint_tool, "", "external tool for hinting fonts (overrides --auto-hint)")