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

Covered text handling: use class instead of inline style.

This commit is contained in:
Duan Yao 2014-06-27 01:31:24 +08:00
parent 39e171a737
commit ceb4e3eac6

View File

@ -38,7 +38,7 @@ void HTMLTextLine::append_unicodes(const Unicode * u, int l, double width)
{ {
if (l == 1) if (l == 1)
text.push_back(min(u[0], (unsigned)INT_MAX)); text.push_back(min(u[0], (unsigned)INT_MAX));
else else if (l > 1)
{ {
text.push_back(- decomposed_text.size() - 1); text.push_back(- decomposed_text.size() - 1);
decomposed_text.emplace_back(); decomposed_text.emplace_back();
@ -93,6 +93,8 @@ void HTMLTextLine::dump_char(std::ostream & out, int pos)
void HTMLTextLine::dump_chars(ostream & out, int begin, int len) void HTMLTextLine::dump_chars(ostream & out, int begin, int len)
{ {
static const Color transparent { true, {0, 0, 0} };
if (line_state.first_char_index < 0) if (line_state.first_char_index < 0)
{ {
for (int i = 0; i < len; i++) for (int i = 0; i < len; i++)
@ -116,7 +118,9 @@ void HTMLTextLine::dump_chars(ostream & out, int begin, int len)
{ {
if (!invisible_group_open) if (!invisible_group_open)
{ {
out << "<span style=\"color:transparent\">"; out << "<span class=\"" << all_manager.fill_color.get_css_class_name()
<< all_manager.fill_color.install(transparent) << " " << all_manager.stroke_color.get_css_class_name()
<< all_manager.stroke_color.install(transparent) << "\">";
invisible_group_open = true; invisible_group_open = true;
} }
dump_char(out, begin + i); dump_char(out, begin + i);