From 88bde718c5c85c7a376602d0ed087881e0225491 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Mon, 10 Sep 2012 02:38:40 +0800 Subject: [PATCH] fix tounicode --- src/HTMLRenderer/text.cc | 11 +++++------ src/pdf2htmlEX.cc | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/HTMLRenderer/text.cc b/src/HTMLRenderer/text.cc index c8e6f8c..ca1b5c1 100644 --- a/src/HTMLRenderer/text.cc +++ b/src/HTMLRenderer/text.cc @@ -155,11 +155,6 @@ string HTMLRenderer::dump_embedded_font (GfxFont * font, long long fn_id) void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo & info, bool get_metric_only) { - string suffix = get_suffix(filepath); - - for(auto iter = suffix.begin(); iter != suffix.end(); ++iter) - *iter = tolower(*iter); - ff_load_font(filepath.c_str()); int * code2GID = nullptr; @@ -168,7 +163,11 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo Gfx8BitFont * font_8bit = nullptr; - info.use_tounicode = (is_truetype_suffix(suffix) || (param->tounicode >= 0)); + string suffix = get_suffix(filepath); + for(auto iter = suffix.begin(); iter != suffix.end(); ++iter) + *iter = tolower(*iter); + + info.use_tounicode = (is_truetype_suffix(suffix) || (param->tounicode > 0)); if(!get_metric_only) { diff --git a/src/pdf2htmlEX.cc b/src/pdf2htmlEX.cc index 8400cf4..8b3fd31 100644 --- a/src/pdf2htmlEX.cc +++ b/src/pdf2htmlEX.cc @@ -137,7 +137,6 @@ int main(int argc, char **argv) try { create_directories(param.dest_dir); - create_directories(param.tmp_dir); } catch (const string & s) {