")
- % x
- % y
- % cur_tm_id
- % (cur_font_info.ascent * draw_font_size)
- % (2 * cur_font_info.ascent * draw_font_size)
- ;
+ state->transform(state->getCurX(), state->getCurY(), &line_x, &line_y);
+ line_tm_id = cur_tm_id;
+ line_height = cur_font_info.ascent * draw_font_size;
//resync position
draw_ty = cur_ty;
@@ -374,8 +365,9 @@ void HTMLRenderer::prepare_line(GfxState * state)
assert(false && "Bad value of new_line_status");
}
- html_fout << format("
")
+ line_buf << format("")
% cur_font_info.id % cur_fs_id % cur_color_id % cur_ls_id % cur_ws_id % cur_rise_id;
+ line_height = max(line_height, cur_font_info.ascent * draw_font_size);
line_status = LineStatus::SPAN;
}
@@ -385,6 +377,17 @@ void HTMLRenderer::close_line()
if(line_status == LineStatus::NONE)
return;
+ // TODO class for height
+ html_fout << format("")
+ % line_x
+ % (line_y + 1)
+ % line_tm_id
+ % line_height
+ % (line_height * 2)
+ ;
+ html_fout << line_buf.rdbuf();
+ line_buf.str("");
+
if(line_status == LineStatus::SPAN)
html_fout << "";
else
@@ -392,4 +395,5 @@ void HTMLRenderer::close_line()
html_fout << "
";
line_status = LineStatus::NONE;
+
}
diff --git a/src/HTMLRenderer/text.cc b/src/HTMLRenderer/text.cc
index 4e05162..6759765 100644
--- a/src/HTMLRenderer/text.cc
+++ b/src/HTMLRenderer/text.cc
@@ -205,7 +205,7 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s)
}
Unicode uu = (cur_font_info.use_tounicode ? check_unicode(u, uLen, code, font) : unicode_from_font(code, font));
- outputUnicodes(html_fout, &uu, 1);
+ outputUnicodes(line_buf, &uu, 1);
dx += dx1;
dy += dy1;