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

LibPDF: Pass PDFFont::draw_glyph() a char code instead of a code point

We would previously pass this function a unicode code point, which is
not actually what we want here.

Instead, we want the "raw" code point, with the font itself deciding
whether or not it needs to be re-mapped.

This same mistake in terminology applied to PS1FontProgram.
This commit is contained in:
Julian Offenhäuser 2022-11-22 23:08:17 +01:00 committed by Andreas Kling
parent 8532ca1b57
commit dd82a026f8
5 changed files with 20 additions and 20 deletions

View file

@ -20,11 +20,11 @@ class PS1FontProgram : public RefCounted<PS1FontProgram> {
public:
PDFErrorOr<void> parse(ReadonlyBytes const&, size_t cleartext_length, size_t encrypted_length);
RefPtr<Gfx::Bitmap> rasterize_glyph(u32 code_point, float width);
Gfx::Path build_char(u32 code_point, float width);
RefPtr<Gfx::Bitmap> rasterize_glyph(u32 char_code, float width);
Gfx::Path build_char(u32 char_code, float width);
RefPtr<Encoding> encoding() const { return m_encoding; }
Gfx::FloatPoint glyph_translation(u32 code_point, float width) const;
Gfx::FloatPoint glyph_translation(u32 char_code, float width) const;
private:
struct Glyph {