mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:18:12 +00:00
LibPDF: Add very basic support for Adobe Type 1 font rendering
Previously we would draw all text, no matter what font type, as Liberation Serif, which results in things like ugly character spacing. We now have partial support for drawing Type 1 glyphs, which are part of a PostScript font program. We completely ignore hinting for now, which results in ugly looking characters at low resolutions, but gain support for a large number of typefaces, including most of the default fonts used in TeX.
This commit is contained in:
parent
e6f29302a7
commit
b14f0950a5
9 changed files with 752 additions and 16 deletions
|
@ -632,6 +632,7 @@ struct CharDescriptor {
|
|||
|
||||
class Encoding : public RefCounted<Encoding> {
|
||||
public:
|
||||
static PDFErrorOr<NonnullRefPtr<Encoding>> create(HashMap<u16, CharDescriptor> descriptors);
|
||||
static PDFErrorOr<NonnullRefPtr<Encoding>> from_object(Document*, NonnullRefPtr<Object> const&);
|
||||
|
||||
static NonnullRefPtr<Encoding> standard_encoding();
|
||||
|
@ -642,6 +643,7 @@ public:
|
|||
static NonnullRefPtr<Encoding> zapf_encoding();
|
||||
|
||||
HashMap<u16, CharDescriptor> const& descriptors() const { return m_descriptors; }
|
||||
HashMap<String, u16> const& name_mapping() const { return m_name_mapping; }
|
||||
|
||||
CharDescriptor const& get_char_code_descriptor(u16 char_code) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue