1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:27:44 +00:00
serenity/Userland
Nico Weber f34da6396f LibPDF: Update font size after getting font from cache
Page 1 of 0000277.pdf does:

    BT 22 0 0 22  59  28 Tm /TT2 1 Tf
        (Presented at Photonics West OPTO, February 17, 2016) Tj ET
    BT 32 0 0 32 269 426 Tm /TT1 1 Tf
        (Robert W. Boyd) Tj ET
    BT 22 0 0 22 253 357 Tm /TT2 1 Tf
        (Department of Physics and) Tj ET
    BT 22 0 0 22 105 326 Tm /TT2 1 Tf
        (Max-Planck Centre for Extreme and Quantum Photonics) Tj ET

Every line begins a text operation, then updates the font matrix,
selects a font (TT2, TT1, TT2, TT1), draws some text and ends the text
operation.

`Tm` (which sets the font matrix) contains a scale, and uses that
to update the font size of the currently-active font (cf #20084).
But in this file, we `Tm` first and `Tf` (font selection) second,
so this updates the size of the old font. So when we pull it out
of the cache again on line 3, it would still have the old size
from the `Tm` on line 2.

(The whole text scaling logic in LibPDF imho needs a rethink; the
current approach also causes issues with zero-width glyphs which
currently lead to divisions by zero. But that's for another PR.)

Fixes another regression from c8510b58a3 (which I've accidentally
referred to by 2340e834cd in another commit).
2023-11-26 19:05:13 -05:00
..
Applets LibGfx: Remove indexed palette formats from Bitmap and Painter 2023-10-12 07:39:05 +02:00
Applications AK+Applications: Return value from JsonObject::get_double more often 2023-11-25 11:02:17 +01:00
BuggieBox checksum: Add support for BLAKE2b 2023-09-17 16:49:35 +03:30
Demos Userland+Tests: Remove uses of direct file loading for BitmapFont 2023-10-29 13:12:28 -06:00
DevTools Userland+Tests: Add initial riscv64 support 2023-11-10 10:30:08 -07:00
DynamicLoader Userland+Tests: Add initial riscv64 support 2023-11-10 10:30:08 -07:00
Games Spider: Make non-movable cards disabled :^) 2023-11-24 11:45:32 +00:00
Libraries LibPDF: Update font size after getting font from cache 2023-11-26 19:05:13 -05:00
Services LibWeb+LibWebView+Ladybird: Scale scroll-to CSS positions in PageHost 2023-11-24 17:19:08 -05:00
Shell Shell/PosixParser: Correctly parse the OR_IF token 2023-11-20 22:02:30 +03:30
Utilities headless-browser: Add flag to dump screenshots of failing ref-tests 2023-11-18 07:49:59 -05:00
CMakeLists.txt Userland: Add the BuggieBox program 2022-11-26 12:41:47 -07:00