diff --git a/README.md b/README.md index 4432e28..290cabb 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,10 @@ The following projects have been consulted for pdf2htmlEX: ## Contact +Suggestions and questions are welcome. + +Please read the FAQ(https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ) beforehand. + * Lu Wang ### Special Thanks diff --git a/TODO b/TODO index 0ea638e..f8905d8 100644 --- a/TODO +++ b/TODO @@ -2,8 +2,6 @@ disable annotation valgrind -re-encoded only used glyphs - detect duplicate base fonts when embedding take care of spaces (simulate by ) diff --git a/src/HTMLRenderer/text.cc b/src/HTMLRenderer/text.cc index 90873f9..9372a36 100644 --- a/src/HTMLRenderer/text.cc +++ b/src/HTMLRenderer/text.cc @@ -175,8 +175,11 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo & info.use_tounicode = ((suffix == ".ttf") || (font->isCIDFont()) || (param->always_apply_tounicode)); + if(!get_metric_only) { + const char * used_map = font_preprocessor.get_code_map(hash_ref(font->getID())); + /* * Step 1 * dump the font file directly from the font descriptor and put the glyphs into the correct slots @@ -217,8 +220,6 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo & memset(cur_mapping2, 0, 256 * sizeof(char*)); - const char * used_map = font_preprocessor.get_code_map(hash_ref(font->getID())); - for(int i = 0; i < 256; ++i) { if(!used_map[i]) continue; @@ -293,6 +294,9 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo & int max_key = maxcode; for(int i = 0; i <= maxcode; ++i) { + if(!used_map[i]) + continue; + if((suffix != ".ttf") && (font_8bit != nullptr) && (font_8bit->getCharName(i) == nullptr)) { continue;