mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-10-05 19:41:40 +00:00
don't hurt em size..breaking IE, will fix this later
This commit is contained in:
parent
4d996a14a3
commit
f02e1d4e1a
@ -359,9 +359,9 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
|
|||||||
|
|
||||||
{
|
{
|
||||||
// read metrics
|
// read metrics
|
||||||
|
int em = ff_get_em_size();
|
||||||
int ascent = ff_get_max_ascent();
|
int ascent = ff_get_max_ascent();
|
||||||
int descent = ff_get_max_descent();
|
int descent = ff_get_max_descent();
|
||||||
int em = ascent + descent;
|
|
||||||
if(em != 0)
|
if(em != 0)
|
||||||
{
|
{
|
||||||
info.ascent = ((double)ascent) / em;
|
info.ascent = ((double)ascent) / em;
|
||||||
|
4
src/ff.c
4
src/ff.c
@ -228,14 +228,14 @@ int ff_get_max_descent(void)
|
|||||||
void ff_set_ascent(int a)
|
void ff_set_ascent(int a)
|
||||||
{
|
{
|
||||||
cur_fv->sf->pfminfo.os2_winascent = 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;
|
cur_fv->sf->pfminfo.hhead_ascent = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_set_descent(int d)
|
void ff_set_descent(int d)
|
||||||
{
|
{
|
||||||
cur_fv->sf->pfminfo.os2_windescent = 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;
|
cur_fv->sf->pfminfo.hhead_descent = -d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ DIR = 'pdf'
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
with open('out.html','w') as outf:
|
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):
|
for f in os.listdir(DIR):
|
||||||
if not f.lower().endswith('.pdf'):
|
if not f.lower().endswith('.pdf'):
|
||||||
|
Loading…
Reference in New Issue
Block a user