LibPDF: Apply text matrix scale to character and word spacing

This commit is contained in:
Nico Weber 2023-07-22 11:32:53 -04:00 committed by Tim Flynn
parent e3cc05b935
commit 18b86b1868
Notes: sideshowbarker 2024-07-17 05:09:48 +09:00

View File

@ -754,7 +754,7 @@ PDFErrorOr<void> Renderer::show_text(DeprecatedString const& string)
auto font_size = text_rendering_matrix.x_scale() * text_state().font_size;
auto start_position = text_rendering_matrix.map(Gfx::FloatPoint { 0.0f, 0.0f });
auto end_position = TRY(text_state().font->draw_string(m_painter, start_position, string, state().paint_color, font_size, text_state().character_spacing, text_state().word_spacing, text_state().horizontal_scaling));
auto end_position = TRY(text_state().font->draw_string(m_painter, start_position, string, state().paint_color, font_size, text_state().character_spacing * text_rendering_matrix.x_scale(), text_state().word_spacing * text_rendering_matrix.x_scale(), text_state().horizontal_scaling));
// Update text matrix
auto delta_x = end_position.x() - start_position.x();