LibPDF: Honor writing mode in TJ operator as well

This commit is contained in:
Nico Weber 2024-03-01 11:13:58 -05:00 committed by Andreas Kling
commit 9e502dcfe4
Notes: sideshowbarker 2024-07-17 00:23:42 +09:00
3 changed files with 12 additions and 6 deletions

View file

@ -598,7 +598,10 @@ RENDERER_HANDLER(text_show_string_array)
for (auto& element : elements) {
if (element.has_number()) {
float shift = element.to_float() / 1000.0f;
m_text_matrix.translate(-shift * text_state().font_size * text_state().horizontal_scaling, 0.0f);
if (text_state().font->writing_mode() == WritingMode::Horizontal)
m_text_matrix.translate(-shift * text_state().font_size * text_state().horizontal_scaling, 0.0f);
else
m_text_matrix.translate(0.0f, -shift * text_state().font_size);
m_text_rendering_matrix_is_dirty = true;
} else {
auto str = element.get<NonnullRefPtr<Object>>()->cast<StringObject>()->string();