mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
fix asc/des
This commit is contained in:
parent
8da7238037
commit
e2470203ab
@ -85,7 +85,6 @@ 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();
|
||||
|
@ -360,8 +360,8 @@ 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 ascent,descent;
|
||||
ff_metric(&ascent, &descent);
|
||||
int em = ascent + descent;
|
||||
|
||||
if(em != 0)
|
||||
|
20
src/ff.c
20
src/ff.c
@ -207,6 +207,26 @@ void ff_close(void)
|
||||
cur_fv = NULL;
|
||||
}
|
||||
|
||||
void ff_metric(int * ascent, int * descent)
|
||||
{
|
||||
*ascent = cur_fv->sf->ascent;
|
||||
*descent = cur_fv->sf->descent;
|
||||
|
||||
cur_fv->sf->pfminfo.os2_winascent = 0;
|
||||
cur_fv->sf->pfminfo.os2_typoascent = 0;
|
||||
cur_fv->sf->pfminfo.hhead_ascent = 0;
|
||||
cur_fv->sf->pfminfo.winascent_add = 0;
|
||||
cur_fv->sf->pfminfo.typoascent_add = 0;
|
||||
cur_fv->sf->pfminfo.hheadascent_add = 0;
|
||||
|
||||
cur_fv->sf->pfminfo.os2_windescent = 0;
|
||||
cur_fv->sf->pfminfo.os2_typodescent = 0;
|
||||
cur_fv->sf->pfminfo.hhead_descent = 0;
|
||||
cur_fv->sf->pfminfo.windescent_add = 0;
|
||||
cur_fv->sf->pfminfo.typodescent_add = 0;
|
||||
cur_fv->sf->pfminfo.hheaddescent_add = 0;
|
||||
}
|
||||
|
||||
int ff_get_em_size(void)
|
||||
{
|
||||
return (cur_fv->sf->pfminfo.os2_typoascent - cur_fv->sf->pfminfo.os2_typodescent);
|
||||
|
@ -29,6 +29,9 @@ void ff_reencode_raw2(char ** mapping, int mapping_len, int force);
|
||||
void ff_cidflatten(void);
|
||||
void ff_save(const char * filename);
|
||||
void ff_close(void);
|
||||
|
||||
// fix metrics and get them
|
||||
void ff_metric(int * ascent, int * descent);
|
||||
int ff_get_em_size(void);
|
||||
int ff_get_max_ascent(void);
|
||||
int ff_get_max_descent(void);
|
||||
|
Loading…
Reference in New Issue
Block a user