1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:37:46 +00:00

LibPDF: Fix text positioning with operator TJ

As per spec, the positioning (or kerning) parameter of this operator
should translate the text matrix before the next showing of text.
Previously, this calculation was slightly wrong and also only applied
after the text was already shown.
This commit is contained in:
Julian Offenhäuser 2022-08-19 09:02:46 +02:00 committed by Sam Atkins
parent 563d91b6c4
commit 97ed4106e5
2 changed files with 6 additions and 5 deletions

View file

@ -98,8 +98,7 @@ private:
PDFErrorOr<void> handle_text_next_line_show_string_set_spacing(Vector<Value> const& args);
PDFErrorOr<void> set_graphics_state_from_dict(NonnullRefPtr<DictObject>);
// shift is the manual advance given in the TJ operator array
void show_text(String const&, float shift = 0.0f);
void show_text(String const&);
PDFErrorOr<NonnullRefPtr<ColorSpace>> get_color_space(Value const&);
ALWAYS_INLINE GraphicsState const& state() const { return m_graphics_state_stack.last(); }