diff options
author | Julian Offenhäuser <offenhaeuser@protonmail.com> | 2022-11-22 19:46:29 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-11-25 22:44:47 +0100 |
commit | 9cb3b23377316805168b079f9ed6c7dbfca95213 (patch) | |
tree | 32685c1e9a89cc543422956bc71e9790b1053eff /Userland/Libraries/LibPDF/Renderer.h | |
parent | e748a94f80b6a7e819312518bb554b536e734a0f (diff) | |
download | serenity-9cb3b23377316805168b079f9ed6c7dbfca95213.zip |
LibPDF: Move all font handling to Type1Font and TrueTypeFont classes
It was previously the job of the renderer to create fonts, load
replacements for the standard 14 fonts and to pass the font size back
to the PDFFont when asking for glyph widths.
Now, the renderer tells the font its size at creation, as it doesn't
change throughout the life of the font. The PDFFont itself is now
responsible to decide whether or not it needs to use a replacement
font, which still is Liberation Serif for now.
This means that we can now render embedded TrueType fonts as well :^)
It also makes the renderer's job much more simple and leads to a much
cleaner API design.
Diffstat (limited to 'Userland/Libraries/LibPDF/Renderer.h')
-rw-r--r-- | Userland/Libraries/LibPDF/Renderer.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/Userland/Libraries/LibPDF/Renderer.h b/Userland/Libraries/LibPDF/Renderer.h index 75e57a80c3..9fb36c9d37 100644 --- a/Userland/Libraries/LibPDF/Renderer.h +++ b/Userland/Libraries/LibPDF/Renderer.h @@ -57,8 +57,6 @@ struct TextState { float word_spacing { 0.0f }; float horizontal_scaling { 1.0f }; float leading { 0.0f }; - FlyString font_family { "Liberation Serif" }; - String font_variant { "Regular" }; float font_size { 12.0f }; RefPtr<PDFFont> font; TextRenderingMode rendering_mode { TextRenderingMode::Fill }; @@ -221,8 +219,6 @@ struct Formatter<PDF::TextState> : Formatter<StringView> { builder.appendff(" word_spacing={}\n", state.word_spacing); builder.appendff(" horizontal_scaling={}\n", state.horizontal_scaling); builder.appendff(" leading={}\n", state.leading); - builder.appendff(" font_family={}\n", state.font_family); - builder.appendff(" font_variant={}\n", state.font_variant); builder.appendff(" font_size={}\n", state.font_size); builder.appendff(" rendering_mode={}\n", state.rendering_mode); builder.appendff(" rise={}\n", state.rise); |