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

don't hurt em size..breaking IE, will fix this later

This commit is contained in:
Lu Wang 2012-09-14 17:53:54 +08:00
parent 4d996a14a3
commit f02e1d4e1a
3 changed files with 4 additions and 4 deletions

View File

@ -359,9 +359,9 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
{
// read metrics
int em = ff_get_em_size();
int ascent = ff_get_max_ascent();
int descent = ff_get_max_descent();
int em = ascent + descent;
if(em != 0)
{
info.ascent = ((double)ascent) / em;

View File

@ -228,14 +228,14 @@ int ff_get_max_descent(void)
void ff_set_ascent(int a)
{
cur_fv->sf->pfminfo.os2_winascent = a;
cur_fv->sf->pfminfo.os2_typoascent = a;
// cur_fv->sf->pfminfo.os2_typoascent = a;
cur_fv->sf->pfminfo.hhead_ascent = a;
}
void ff_set_descent(int d)
{
cur_fv->sf->pfminfo.os2_windescent = d;
cur_fv->sf->pfminfo.os2_typodescent = -d;
// cur_fv->sf->pfminfo.os2_typodescent = -d;
cur_fv->sf->pfminfo.hhead_descent = -d;
}

View File

@ -5,7 +5,7 @@ DIR = 'pdf'
import os
with open('out.html','w') as outf:
outf.write('<html><body><div style="position:absolute;top:0;left:0;width:80%;height:100%;"><iframe width="100%" height="100%" name="pdf"></iframe></div><div style="position:absolute;top:0;right:0;width:20%;height:100%;overflow:auto;text-align:right;">')
outf.write('<html><head><meta charset=\"utf-8\"></head><body><div style="position:absolute;top:0;left:0;width:80%;height:100%;"><iframe width="100%" height="100%" name="pdf"></iframe></div><div style="position:absolute;top:0;right:0;width:20%;height:100%;overflow:auto;text-align:right;">')
for f in os.listdir(DIR):
if not f.lower().endswith('.pdf'):