1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:57:44 +00:00

LibPDF: Pass Renderer to SimpleFont::draw_glyph()

This makes it available in Type3Font::draw_glyph().

No behavior change.
This commit is contained in:
Nico Weber 2023-11-14 10:18:36 -05:00 committed by Sam Atkins
parent bcc6439b5f
commit 126a0be595
8 changed files with 14 additions and 10 deletions

View file

@ -48,8 +48,6 @@ PDFErrorOr<void> SimpleFont::initialize(Document* document, NonnullRefPtr<DictOb
PDFErrorOr<Gfx::FloatPoint> SimpleFont::draw_string(Gfx::Painter& painter, Gfx::FloatPoint glyph_position, DeprecatedString const& string, Renderer const& renderer)
{
Color const& paint_color = renderer.state().paint_color;
auto const& text_rendering_matrix = renderer.calculate_text_rendering_matrix();
auto font_size = text_rendering_matrix.x_scale() * renderer.text_state().font_size;
@ -68,7 +66,7 @@ PDFErrorOr<Gfx::FloatPoint> SimpleFont::draw_string(Gfx::Painter& painter, Gfx::
else
glyph_width = m_missing_width; // FIXME: times m_font_matrix.x_scale() probably?
TRY(draw_glyph(painter, glyph_position, glyph_width, char_code, paint_color));
TRY(draw_glyph(painter, glyph_position, glyph_width, char_code, renderer));
auto tx = glyph_width;
tx += character_spacing;