1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

do not use hacky zero font size

This commit is contained in:
Lu Wang 2012-08-24 19:15:15 +02:00
parent 34b12b774c
commit 1801ec52df
2 changed files with 22 additions and 18 deletions

View File

@ -20,7 +20,7 @@
#pdf-main .l {
position:absolute;
white-space:pre;
font-size:0;
font-size:1px;
transform-origin:0% 100%;
-ms-transform-origin:0% 100%;
-moz-transform-origin:0% 100%;

View File

@ -320,7 +320,28 @@ void HTMLRenderer::prepare_line(GfxState * state)
}
if(line_status == LineStatus::NONE)
{
new_line_status = LineStatus::DIV;
}
else
{
// align horizontal position
// try to merge with the last line if possible
double target = cur_tx - draw_tx;
if(abs(target) < param->h_eps)
{
// ignore it
}
else
{
// don't close a pending span here, keep the styling
double w;
auto wid = install_whitespace(target * draw_scale, w);
html_fout << format("<span class=\"_ _%|1$x|\">%2%</span>") % wid % (target > 0 ? " " : "");
draw_tx += w / draw_scale;
}
}
if(new_line_status != LineStatus::NONE)
{
@ -353,23 +374,6 @@ void HTMLRenderer::prepare_line(GfxState * state)
line_status = LineStatus::SPAN;
}
// align horizontal position
// try to merge with the last line if possible
double target = cur_tx - draw_tx;
if(abs(target) < param->h_eps)
{
// ignore it
}
else
{
// don't close a pending span here, keep the styling
double w;
auto wid = install_whitespace(target * draw_scale, w);
html_fout << format("<span class=\"_ _%|1$x|\">%2%</span>") % wid % (target > 0 ? " " : "");
draw_tx += w / draw_scale;
}
}
void HTMLRenderer::close_line()
{