From 265a7785bc4ca4519f15c4d3757b25f749cf9d0e Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 11 Aug 2012 22:46:05 +0800 Subject: [PATCH] working on CID fonts --- src/HTMLRenderer.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/HTMLRenderer.cc b/src/HTMLRenderer.cc index 9f58361..3f72071 100644 --- a/src/HTMLRenderer.cc +++ b/src/HTMLRenderer.cc @@ -564,17 +564,15 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const std::string & suf fontscript_fout << boost::format("Open(\"%1%/%2%%3%\",1)") % TMP_DIR % fn % suffix << endl; - //TODO - //for 8bit fonts, always read the UnicodeCMap - - auto ctu = font->getToUnicode(); int * code2GID = nullptr; if(ctu) { + // TODO: ctu could be CID2Unicode for CID fonts + int maxcode = 0; - if(font->getType() < fontCIDType0) + if(!font->isCIDFont()) { maxcode = 0xff; //TODO read code2GID for TrueType @@ -611,6 +609,7 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const std::string & suf ctu->decRefCnt(); } + fontscript_fout << boost::format("Generate(\"%1%.ttf\")") % fn << endl; export_remote_font(fn_id, ".ttf", "truetype", font);