1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-04 17:18:40 +00:00

use old behaviour of em/asc/des

This commit is contained in:
Lu Wang 2012-09-16 21:34:07 +08:00
parent d9c728b911
commit 8b4ecd68ea
3 changed files with 6 additions and 3 deletions

View File

@ -85,6 +85,7 @@ void HTMLRenderer::LineBuffer::flush(void)
<< "\""
<< " class=\"l t" << tm_id
<< " h" << renderer->install_height(max_ascent)
<< "\" data-asc=\"" << max_ascent
<< "\">";
auto cur_state_iter = states.begin();

View File

@ -359,9 +359,11 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
{
// read metrics
int em = ff_get_em_size();
// 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

@ -229,14 +229,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;
}