1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00
serenity/Userland/Libraries/LibPDF/Fonts
Nico Weber d2f3288666 LibPDF: Apply text matrix to each glyph's position
We still don't apply it to the glyph itself, so they don't show up
scaled or rotated, but they're at the right spot now.

One big thing this here hsa going for it is that the final glyph
position is now calculated with just
`ext_rendering_matrix.map(glyph_position)`.

Also, character_spacing and word_spacing are now used unmodified
in the SimpleFont::draw_string() loop. This also means we no longer
have to undo a scale when updating the position in
`Renderer::show_text()`.

Most of the rest stays pretty yucky though. The root cause of many
problems is that ScaledFont has its rendering sized baked into the
object. We want to render fonts at size font_size times scale from
text matrix times scale from current transformation matrix (but
not size from hotizontal_scaling). So we have to make that the
font_size, but then we have to undo that in a bunch of places to
get the actualy font size.

This will eventually get better when LibPDF moves off ScaledFont.
2024-01-18 14:01:30 +01:00
..
CFF.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
CFF.h LibPDF: Support offset size 3 in CFF index reading 2023-10-23 09:31:11 -04:00
PDFFont.cpp LibPDF: Add some scaffolding for type 3 fonts 2023-11-17 19:47:53 +00:00
PDFFont.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
PS1FontProgram.cpp Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
PS1FontProgram.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
SimpleFont.cpp LibPDF: Apply text matrix to each glyph's position 2024-01-18 14:01:30 +01:00
SimpleFont.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TrueTypeFont.cpp LibPDF: Tweak vertical position of truetype fonts 2024-01-17 08:44:07 +00:00
TrueTypeFont.h LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00
Type0Font.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Type0Font.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Type1Font.cpp LibPDF: Tweak vertical position of truetype fonts 2024-01-17 08:44:07 +00:00
Type1Font.h LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00
Type1FontProgram.cpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Type1FontProgram.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Type3Font.cpp LibPDF: Add an initial implementation of type 3 glyph rendering 2023-11-17 19:47:53 +00:00
Type3Font.h LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00