diff --git a/pdf2htmlEX.1 b/pdf2htmlEX.1 index 26cfdc1..b2ab507 100644 --- a/pdf2htmlEX.1 +++ b/pdf2htmlEX.1 @@ -92,7 +92,7 @@ For some versions of Firefox, however, there will be a problem when the font siz .B --always-apply-tounicode <0|1> (Default: 0) A ToUnicode map may be provided for fonts in PDF which indicates the 'meaning' of the characters. -However often there is better "ToUnicode" info in Type 1 fonts, and sometimes the ToUnicode map provided is wrong. So by default pdf2htmlEX will find the Unicode value directly from the fonts instead of ToUnicode map. This behavior may be changed by turning on this switch. +However often there is better "ToUnicode" info in Type 0/1 fonts, and sometimes the ToUnicode map provided is wrong. So by default pdf2htmlEX will find the Unicode value directly from the fonts instead of ToUnicode map. This behavior may be changed by turning on this switch. .TP .B --space-as-offset <0|1> (Default: 0) Treat space characters as offsets, which may increase the size of the output. diff --git a/src/HTMLRenderer/text.cc b/src/HTMLRenderer/text.cc index 27d82c2..a6b9bc5 100644 --- a/src/HTMLRenderer/text.cc +++ b/src/HTMLRenderer/text.cc @@ -173,8 +173,7 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo & Gfx8BitFont * font_8bit = nullptr; - info.use_tounicode = ((suffix == ".ttf") || (font->isCIDFont()) || (param->always_apply_tounicode)); - + info.use_tounicode = ((suffix == ".ttf") || (param->always_apply_tounicode)); if(!get_metric_only) { @@ -217,7 +216,7 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo & unordered_set nameset; bool name_conflict_warned = false; - memset(cur_mapping2, 0, 256 * sizeof(char*)); + memset(cur_mapping2, 0, 0x100 * sizeof(char*)); for(int i = 0; i < 256; ++i) { @@ -287,7 +286,7 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo & bool name_conflict_warned = false; auto ctu = font->getToUnicode(); - memset(cur_mapping, 0, maxcode * sizeof(int32_t)); + memset(cur_mapping, 0, 0x10000 * sizeof(int32_t)); if(code2GID) maxcode = min(maxcode, code2GID_len - 1);