1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

fixed bugs of font & offset

This commit is contained in:
Lu Wang 2012-08-16 13:24:22 +08:00
parent 3b44d3059c
commit 4f49f6b795
2 changed files with 6 additions and 1 deletions

View File

@ -135,6 +135,10 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const string & suffix,
if(!font->isCIDFont()) if(!font->isCIDFont())
{ {
maxcode = 0xff; maxcode = 0xff;
if(suffix != ".ttf")
{
script_fout << "Reencode(\"unicode\")" << endl;
}
} }
else else
{ {
@ -145,7 +149,7 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const string & suffix,
} }
else else
{ {
script_fout << format("Reencode(\"original\")") << endl; script_fout << "Reencode(\"original\")" << endl;
int len; int len;
// code2GID has been stored for embedded CID fonts // code2GID has been stored for embedded CID fonts
code2GID = dynamic_cast<GfxCIDFont*>(font)->getCodeToGIDMap(nullptr, &len); code2GID = dynamic_cast<GfxCIDFont*>(font)->getCodeToGIDMap(nullptr, &len);

View File

@ -175,6 +175,7 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s)
// shift left // shift left
// TODO, create a class for this // TODO, create a class for this
html_fout << format("<span style=\"margin-left:%1%px\"></span>") % target; html_fout << format("<span style=\"margin-left:%1%px\"></span>") % target;
draw_tx += target / draw_scale;
} }
} }