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

asc/des not working..so re-enable intermediate save

This commit is contained in:
Lu Wang 2012-09-20 15:21:44 +08:00
parent 210c1edc70
commit 38e4281562
3 changed files with 6 additions and 5 deletions

2
TODO
View File

@ -1,3 +1,5 @@
remove intermediate save for asc/des
bug found in baidu(ubuntu...), bug_chn
option for tounicode-map

View File

@ -391,15 +391,13 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
// Generate an intermediate ttf font in order to retrieve the metrics
// TODO: see if we can get the values without save/load
/*
auto fn = str_fmt("%s/f%llx_.ttf", param->tmp_dir.c_str(), info.id);
add_tmp_file((char*)fn);
ffw_save((char*)fn);
ffw_close();
ffw_load_font((char*)fn);
*/
ffw_metric(&info.ascent, &info.descent, &info.em_size);
}
{
auto fn = str_fmt("%s/f%llx%s",

View File

@ -12,6 +12,7 @@
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include <math.h>
#include <fontforge.h>
#include <baseviews.h>
@ -252,8 +253,8 @@ void ffw_metric(double * ascent, double * descent, int * em_size)
int a = bb.maxy;
int d = bb.miny;
sf->descent += sf->ascent;
sf->ascent = 0;
sf->ascent = min((int)round(bb.maxy), em);
sf->descent = em - bb.maxy;
info->os2_winascent = a;
info->os2_typoascent = a;