1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17:35 +00:00

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
parent c69797fda9
commit 9e502dcfe4
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();