mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibPDF: Add missing character quirk for WinAnsiEncoding fonts
Fonts with the encoding name "WinAnsiEncoding" should render missing characters above character code 040 (octal) as a "bullet" character. This patch adds Encoding::should_map_to_bullet(char_code) which is then called by char_code_to_code_point() to check if the given char code should be displayed as a bullet instead. I didn't have a good way to test this, so I've only verified that it works by manually overriding inputs to the function during the rendering stage. This takes care of a FIXME in the Annex D part of the PDF specification.
This commit is contained in:
parent
f4f5b045ca
commit
d6a3be1615
4 changed files with 20 additions and 1 deletions
|
@ -96,7 +96,7 @@
|
|||
FN("]", bracketright, 93, 93, 93, 93) \
|
||||
FN(" ̆", breve, 198, 249, -1, 24) \
|
||||
FN("¦", brokenbar, -1, -1, 166, 166) \
|
||||
FN("•", bullet, 183, 165, 149, 128) /* FIXME: Note 3 */ \
|
||||
FN("•", bullet, 183, 165, 149, 128) \
|
||||
FN("c", c, 99, 99, 99, 99) \
|
||||
FN("ˇ", caron, 207, 255, -1, 25) \
|
||||
FN("ç", ccedilla, -1, 141, 231, 231) \
|
||||
|
@ -647,9 +647,13 @@ public:
|
|||
|
||||
CharDescriptor const& get_char_code_descriptor(u16 char_code) const;
|
||||
|
||||
bool should_map_to_bullet(u16 char_code) const;
|
||||
|
||||
protected:
|
||||
HashMap<u16, CharDescriptor> m_descriptors;
|
||||
HashMap<DeprecatedString, u16> m_name_mapping;
|
||||
|
||||
bool m_windows { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue