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

unify asc/dsc for FF/Chrome

This commit is contained in:
Lu Wang 2012-08-31 10:24:26 +08:00
parent 6916ffb91b
commit c99f725c72
3 changed files with 15 additions and 7 deletions

3
TODO
View File

@ -1,3 +1,6 @@
issue_63 on FF
vertical position of non-embeded
option to embed local matched fonts for non-embedded ones option to embed local matched fonts for non-embedded ones
fake space detection fake space detection

View File

@ -255,6 +255,17 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const string & suffix,
if(param->single_html) if(param->single_html)
add_tmp_file(fn+(param->font_suffix)); add_tmp_file(fn+(param->font_suffix));
/*
* [Win|Typo|HHead][Ascent|Descent]
* Firefox & Chrome interprets the values in different ways
* Trying to unify them
*
* .pfa does not have such mess, convert to it and back
*/
add_tmp_file(fn+"_.pfa");
script_fout << format("Generate(%1%)") % (tmp_dir / (fn+"_.pfa")) << endl;
script_fout << "Close()" << endl;
script_fout << format("Open(%1%, 1)") % (tmp_dir / (fn+"_.pfa")) << endl;
script_fout << format("Generate(%1%)") % dest << endl; script_fout << format("Generate(%1%)") % dest << endl;
script_fout << "Close()" << endl; script_fout << "Close()" << endl;
script_fout << format("Open(%1%, 1)") % dest << endl; script_fout << format("Open(%1%, 1)") % dest << endl;
@ -267,11 +278,6 @@ void HTMLRenderer::install_embedded_font(GfxFont * font, const string & suffix,
} }
} }
/*
* Firefox & Chrome interprets the values in different ways
* Trying to unify them
*/
script_fout << "a=GetOS2Value(\"TypoAscent\")" << endl; script_fout << "a=GetOS2Value(\"TypoAscent\")" << endl;
script_fout << "d=GetOS2Value(\"TypoDescent\")" << endl; script_fout << "d=GetOS2Value(\"TypoDescent\")" << endl;
script_fout << "SetOS2Value(\"TypoAscent\", 0)" << endl; script_fout << "SetOS2Value(\"TypoAscent\", 0)" << endl;

View File

@ -380,12 +380,11 @@ void HTMLRenderer::close_line()
return; return;
// TODO class for height // TODO class for height
html_fout << format("<div style=\"left:%1%px;bottom:%2%px;height:%4%px;line-height:%5%px;\" class=\"l t%|3$x|\">") html_fout << format("<div style=\"left:%1%px;bottom:%2%px;height:%4%px;\" class=\"l t%|3$x|\">")
% line_x % line_x
% line_y % line_y
% line_tm_id % line_tm_id
% line_ascent % line_ascent
% (line_ascent * 2) // TODO: why?
; ;
html_fout << line_buf.rdbuf(); html_fout << line_buf.rdbuf();
line_buf.str(""); line_buf.str("");