From 3506805092033fdb0b4312cf70accd77bd0e8bf1 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 24 Aug 2012 08:21:20 +0200 Subject: [PATCH 1/2] .. --- src/HTMLRenderer/text.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/HTMLRenderer/text.cc b/src/HTMLRenderer/text.cc index 2d53e4f..2e6f8ca 100644 --- a/src/HTMLRenderer/text.cc +++ b/src/HTMLRenderer/text.cc @@ -185,7 +185,7 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s) while (len > 0) { auto n = font->getNextChar(p, len, &code, &u, &uLen, &dx1, &dy1, &ox, &oy); - + if(!(_equal(ox, 0) && _equal(oy, 0))) { cerr << "TODO: non-zero origins" << endl; @@ -195,6 +195,8 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s) { ++nSpaces; } + + // TODO: don't use ToUnicode Map for nonttf fonts if((uLen > 0) && (all_of(u, u+uLen, isLegalUnicode))) { From d920cbdc835dd19d3b7cfdbb280f342565771a92 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 24 Aug 2012 09:10:45 +0200 Subject: [PATCH 2/2] should get the mapping without ToUnicode, instead of disabling it --- src/HTMLRenderer/install.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/HTMLRenderer/install.cc b/src/HTMLRenderer/install.cc index 7632027..d0c381d 100644 --- a/src/HTMLRenderer/install.cc +++ b/src/HTMLRenderer/install.cc @@ -135,9 +135,9 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const string & suffix, if(!font->isCIDFont()) { + maxcode = 0xff; if(suffix == ".ttf") { - maxcode = 0xff; script_fout << "Reencode(\"original\")" << endl; int buflen; char * buf = nullptr; @@ -155,8 +155,6 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const string & suffix, } else { - // don't reencode non-ttf 8bit fonts with ToUnicode - maxcode = 0; script_fout << "Reencode(\"unicode\")" << endl; } }