mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
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!
This commit is contained in:
parent
c1aa8c4a44
commit
7e1c823725
Notes:
sideshowbarker
2024-07-17 17:51:04 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/7e1c823725 Pull-request: https://github.com/SerenityOS/serenity/pull/12920
1 changed files with 3 additions and 3 deletions
|
@ -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" };
|
||||
|
|
Loading…
Reference in a new issue