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

always use default font files for base 14 fonts

This commit is contained in:
Lu Wang 2012-09-27 17:17:08 +08:00
parent 017cbb0711
commit e85ff593ee

View File

@ -11,8 +11,9 @@
#include <cmath>
#include <algorithm>
#include "Param.h"
#include <GlobalParams.h>
#include "Param.h"
#include "HTMLRenderer.h"
#include "namespace.h"
#include "util.h"
@ -109,15 +110,24 @@ void HTMLRenderer::install_base_font(GfxFont * font, GfxFontLoc * font_loc, Font
string psname(font_loc->path->getCString());
string basename = psname.substr(0, psname.find('-'));
GfxFontLoc * localfontloc = font->locateFont(xref, gFalse);
GfxFontLoc * localfontloc = font->locateFont(xref, gTrue);
if(param->embed_base_font)
{
if(localfontloc != nullptr)
{
embed_font(string(localfontloc->path->getCString()), font, info);
export_remote_font(info, param->font_suffix, param->font_format, font);
delete localfontloc;
return;
GooString * path = globalParams->findBase14FontFile(localfontloc->path, font);
if(path)
{
embed_font(string(path->getCString()), font, info);
export_remote_font(info, param->font_suffix, param->font_format, font);
delete localfontloc;
delete path;
return;
}
else
{
cerr << "Cannot embed base font: f" << hex << info.id << dec << ' ' << psname << endl;
}
}
else
{