summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2022-03-05 00:36:05 -0700
committerAndreas Kling <kling@serenityos.org>2022-03-07 10:53:57 +0100
commit7e1c823725c085e1efb796dfe98fca8f7d7857b7 (patch)
tree14ae963ec12d7e9e7e506b43e10635fbfd9612f8 /Userland/Libraries
parentc1aa8c4a444c56215d1744fe0ceaddeb6c9c503e (diff)
downloadserenity-7e1c823725c085e1efb796dfe98fca8f7d7857b7.zip
LibPDF: Fix the zoom-related text scaling issue
Previously, text spacing on a page would only look correct on very zoomed-in pages. When the page was zoomed out, the spacing between characters was very large. The cause for this was incorrect initial values for the Tc (character spacing) and Tw (word spacing) text parameters. The initial values were too large, but they were only about 3-5 pixels, which is why the error was only observable for smaller pages. The text placement still isn't perfect, but it is _much_ better!
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibPDF/Renderer.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibPDF/Renderer.h b/Userland/Libraries/LibPDF/Renderer.h
index eb8e0f2b63..cf10174df9 100644
--- a/Userland/Libraries/LibPDF/Renderer.h
+++ b/Userland/Libraries/LibPDF/Renderer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
+ * Copyright (c) 2021-2022, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -51,8 +51,8 @@ enum class TextRenderingMode : u8 {
};
struct TextState {
- float character_spacing { 3.0f };
- float word_spacing { 5.0f };
+ float character_spacing { 0.0f };
+ float word_spacing { 0.0f };
float horizontal_scaling { 1.0f };
float leading { 0.0f };
FlyString font_family { "Liberation Serif" };