diff --git a/TODO b/TODO index 6ea8be2..f983f2d 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ +optimize font_size & transform matrix tracking c++ classes for different states == Future: == diff --git a/src/HTMLRenderer/HTMLRenderer.h b/src/HTMLRenderer/HTMLRenderer.h index 605fe8d..ad1ce8e 100644 --- a/src/HTMLRenderer/HTMLRenderer.h +++ b/src/HTMLRenderer/HTMLRenderer.h @@ -277,7 +277,6 @@ class HTMLRenderer : public OutputDev double cur_font_size; // transform matrix - long long cur_ttm_id; bool ctm_changed; bool text_mat_changed; // horizontal scaling diff --git a/src/HTMLRenderer/TextLineBuffer.cc b/src/HTMLRenderer/TextLineBuffer.cc index 147446e..810b6a4 100644 --- a/src/HTMLRenderer/TextLineBuffer.cc +++ b/src/HTMLRenderer/TextLineBuffer.cc @@ -27,7 +27,7 @@ using std::endl; void HTMLRenderer::TextLineBuffer::reset(GfxState * state) { state->transform(state->getCurX(), state->getCurY(), &x, &y); - tm_id = renderer->cur_ttm_id; + tm_id = renderer->transform_matrix_manager.get_id(); } void HTMLRenderer::TextLineBuffer::append_unicodes(const Unicode * u, int l) diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index 2a22ef2..50fc36a 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -341,13 +341,14 @@ void HTMLRenderer::pre_process(PDFDoc * doc) void HTMLRenderer::post_process() { // dump css - font_size_manager .dump_css(f_css.fs); - letter_space_manager.dump_css(f_css.fs); - word_space_manager .dump_css(f_css.fs); - rise_manager .dump_css(f_css.fs); - whitespace_manager .dump_css(f_css.fs); - height_manager .dump_css(f_css.fs); - left_manager .dump_css(f_css.fs); + font_size_manager .dump_css(f_css.fs); + letter_space_manager .dump_css(f_css.fs); + word_space_manager .dump_css(f_css.fs); + rise_manager .dump_css(f_css.fs); + whitespace_manager .dump_css(f_css.fs); + height_manager .dump_css(f_css.fs); + left_manager .dump_css(f_css.fs); + transform_matrix_manager.dump_css(f_css.fs); // close files f_outline.fs.close(); diff --git a/src/HTMLRenderer/state.cc b/src/HTMLRenderer/state.cc index 157d699..80da91c 100644 --- a/src/HTMLRenderer/state.cc +++ b/src/HTMLRenderer/state.cc @@ -115,12 +115,13 @@ void HTMLRenderer::reset_state() cur_stroke_color_id = install_stroke_color(&cur_stroke_color); cur_has_stroke = false; - rise_manager .reset(); - height_manager.reset(); + rise_manager .reset(); + height_manager .reset(); + transform_matrix_manager.reset(); // no need to reset whitespace or left - cur_tx = cur_ty = 0; + cur_tx = cur_ty = 0; draw_tx = draw_ty = 0; reset_state_change();