From 020c00ede2c26672016f44d2ec94b4f2cfc1f1ab Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 21 Feb 2024 16:11:15 -0500 Subject: [PATCH] LibPDF/CFF: Use offset in accented_character() data Without this, the dieresis above an a is all the way to the left instead of over the letter. --- Userland/Libraries/LibPDF/Fonts/Type1FontProgram.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibPDF/Fonts/Type1FontProgram.cpp b/Userland/Libraries/LibPDF/Fonts/Type1FontProgram.cpp index c34a64819a..d7d06789c7 100644 --- a/Userland/Libraries/LibPDF/Fonts/Type1FontProgram.cpp +++ b/Userland/Libraries/LibPDF/Fonts/Type1FontProgram.cpp @@ -127,8 +127,10 @@ void Type1FontProgram::consolidate_glyphs() auto glyph_path = maybe_base_glyph.value().path(); auto maybe_accent_glyph = m_glyph_map.get(glyph.accented_character().accent_character); if (maybe_accent_glyph.has_value()) { + auto origin = glyph.accented_character().accent_origin; auto path = maybe_accent_glyph.value().path(); - glyph_path.append_path(move(path)); + Gfx::AffineTransform translation { 1, 0, 0, 1, origin.x(), origin.y() }; + glyph_path.append_path(path.copy_transformed(translation)); } glyph.path() = glyph_path; }