+ NLS_DIV // has to open a new
+ } new_line_state;
+
+ // The order is according to the appearance in check_state_change
+ // any state changed
+ bool all_changed;
+ // current position
+ double cur_tx, cur_ty; // real text position, in text coords
- // font & size
- const FontInfo * cur_font_info;
- bool font_changed;
- // cur_font_size is as in GfxState,
- // font_size_manager saves the final font size used in HTML
- double cur_font_size;
+ // cur_font_size and cur_text_tm are unscaled (the same as in PDF)
+ double cur_font_size;
+ // this is CTM * TextMAT in PDF
+ // [4] and [5] are ignored,
+ // as we'll calculate the position of the origin separately
+ double cur_text_tm[6]; // unscaled
- // transform matrix
- bool ctm_changed;
- bool text_mat_changed;
- // horizontal scaling
- bool hori_scale_changed;
- // this is CTM * TextMAT in PDF
- // [4] and [5] are ignored,
- // as we'll calculate the position of the origin separately
- double cur_text_tm[6]; // unscaled
+ bool text_pos_changed;
+ bool font_changed;
+ bool ctm_changed;
+ bool text_mat_changed;
+ bool hori_scale_changed;
+ bool letter_space_changed;
+ bool word_space_changed;
+ bool rise_changed;
- // letter spacing
- bool letter_space_changed;
- bool word_space_changed;
+ // font & size
+ const FontInfo * cur_font_info;
- // fill color
- long long cur_fill_color_id;
- GfxRGB cur_fill_color;
- bool cur_has_fill;
- bool fill_color_changed;
+ // fill color
+ long long cur_fill_color_id;
+ GfxRGB cur_fill_color;
+ bool cur_has_fill;
+ bool fill_color_changed;
- // stroke color
- long long cur_stroke_color_id;
- GfxRGB cur_stroke_color;
- bool cur_has_stroke;
- bool stroke_color_changed;
- bool rise_changed;
+ // stroke color
+ long long cur_stroke_color_id;
+ GfxRGB cur_stroke_color;
+ bool cur_has_stroke;
+ bool stroke_color_changed;
- // managers store values actually used in HTML (i.e. scaled)
- FontSizeManager font_size_manager;
- LetterSpaceManager letter_space_manager;
- WordSpaceManager word_space_manager;
- RiseManager rise_manager;
- WhitespaceManager whitespace_manager;
- HeightManager height_manager;
- LeftManager left_manager;
- TransformMatrixManager transform_matrix_manager;
- // optimize for web
- // we try to render the final font size directly
- // to reduce the effect of ctm as much as possible
-
- // the actual tm used is `real tm in PDF` scaled by 1/draw_text_scale,
- // so everything redenered should be multiplied by draw_text_scale
- double draw_text_scale;
+ // managers store values actually used in HTML (i.e. scaled)
+ FontSizeManager font_size_manager;
+ LetterSpaceManager letter_space_manager;
+ WordSpaceManager word_space_manager;
+ RiseManager rise_manager;
+ WhitespaceManager whitespace_manager;
+ HeightManager height_manager;
+ LeftManager left_manager;
+ TransformMatrixManager transform_matrix_manager;
- // the position of next char, in text coords
- // this is actual position (in HTML), which might be different from cur_tx/ty (in PDF)
- // also keep in mind that they are not the final position, as they will be transform by CTM (also true for cur_tx/ty)
- double draw_tx, draw_ty;
+ // optimize for web
+ // we try to render the final font size directly
+ // to reduce the effect of ctm as much as possible
+
+ // the actual tm used is `real tm in PDF` scaled by 1/draw_text_scale,
+ // so everything redenered should be multiplied by draw_text_scale
+ double draw_text_scale;
- // some metrics have to be determined after all elements in the lines have been seen
- // see TextLineBuffer.h
- class TextLineBuffer;
- friend class TextLineBuffer;
- TextLineBuffer * text_line_buf;
+ // the position of next char, in text coords
+ // this is actual position (in HTML), which might be different from cur_tx/ty (in PDF)
+ // also keep in mind that they are not the final position, as they will be transform by CTM (also true for cur_tx/ty)
+ double draw_tx, draw_ty;
- // for font reencoding
- int32_t * cur_mapping;
- char ** cur_mapping2;
- int * width_list;
+ // some metrics have to be determined after all elements in the lines have been seen
+ // see TextLineBuffer.h
+ class TextLineBuffer;
+ friend class TextLineBuffer;
+ TextLineBuffer * text_line_buf;
- Preprocessor preprocessor;
- TmpFiles tmp_files;
+ // for font reencoding
+ int32_t * cur_mapping;
+ char ** cur_mapping2;
+ int * width_list;
- // for string formatting
- StringFormatter str_fmt;
+ Preprocessor preprocessor;
+ TmpFiles tmp_files;
- ////////////////////////////////////////////////////
- // styles & resources
- ////////////////////////////////////////////////////
+ // for string formatting
+ StringFormatter str_fmt;
- std::unordered_map font_name_map;
- std::unordered_map fill_color_map, stroke_color_map;
+ ////////////////////////////////////////////////////
+ // styles & resources
+ ////////////////////////////////////////////////////
- const Param * param;
+ std::unordered_map font_name_map;
+ std::unordered_map fill_color_map, stroke_color_map;
- struct {
- std::ofstream fs;
- std::string path;
- } f_outline, f_pages, f_css;
+ const Param * param;
- static const std::string MANIFEST_FILENAME;
+ struct {
+ std::ofstream fs;
+ std::string path;
+ } f_outline, f_pages, f_css;
+
+ static const std::string MANIFEST_FILENAME;
};
} //namespace pdf2htmlEX