1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00

create empty glyphs if missing, in order to prevent displaying the .notdef glyph

This commit is contained in:
Lu Wang 2013-03-24 23:27:19 +08:00
parent 9531a3d8c2
commit 6b9b12afdd
2 changed files with 7 additions and 5 deletions

View File

@ -178,7 +178,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
if(param->debug)
{
auto fn = str_fmt("%s/__raw_font_%lld", param->tmp_dir.c_str(), info.id, param->font_suffix.c_str());
auto fn = str_fmt("%s/__raw_font_%llx", param->tmp_dir.c_str(), info.id, param->font_suffix.c_str());
tmp_files.add((char*)fn);
ofstream((char*)fn, ofstream::binary) << ifstream(filepath).rdbuf();
}

View File

@ -383,9 +383,11 @@ void ffw_set_widths(int * width_list, int mapping_len,
if(j == -1) continue;
SplineChar * sc = sf->glyphs[j];
if(sc == NULL) continue;
if(((sc->width > EPS)
if(sc == NULL)
{
sc = SFMakeChar(cur_fv->sf, cur_fv->map, j);
}
else if(((sc->width > EPS)
&& (((sc->width > width_list[i] + EPS) && (squeeze_wide))
|| ((sc->width < width_list[i] - EPS) && (stretch_narrow)))))
{
@ -396,7 +398,7 @@ void ffw_set_widths(int * width_list, int mapping_len,
FVTrans(cur_fv, sc, transform, NULL, fvt_alllayers | fvt_dontmovewidth);
}
sc->width = width_list[i];
SCSynchronizeWidth(sc, width_list[i], sc->width, cur_fv);
}
for(; i < map->enccount; ++i)