1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 13:45:08 +00:00
serenity/Userland/Libraries/LibPDF/Fonts
Nico Weber 29396415d5 LibPDF: Add an initial implementation of type 3 glyph rendering
This is a very inefficient implementation: Every time a type 3 font
glyph is drawn, we parse its operator stream and execute all the
operators therein.

We'll want to instead cache the glyphs in bitmaps (at least in most
cases), like we do for other fonts. But it's a good first step, and
all the coordinate math seems to work in the files I've tested.

Good test files from pdfa dataset 0000.zip:

- 0000559.pdf page 1 (and 2): Has a non-default font matrix;
  text appears mirrored if the font matrix isn't handled correctly

- 0000425.pdf, page 1: Draws several glyphs in a single run;
  glyphs overlap if Renderer::render_type3_glyph() ignores the
  passed-in point

- 0000211.pdf, any page: Uses type 3 glyphs for all text.
  Good perf test (already "reasonably fast")

- 0000521.pdf, page 5 (or 7 or or 16): The little red flag in the
  purple box is a type 3 font glyph, and it's colored (which in part
  means the first operator is `d0`, while all the other documents above
  use `d1`)
2023-11-17 19:47:53 +00:00
..
CFF.cpp LibPDF: Don't over-read in charset formats 1 and 2 2023-10-23 09:31:11 -04:00
CFF.h LibPDF: Support offset size 3 in CFF index reading 2023-10-23 09:31:11 -04:00
PDFFont.cpp LibPDF: Add some scaffolding for type 3 fonts 2023-11-17 19:47:53 +00:00
PDFFont.h LibPDF: Pass Renderer to PDFFont::draw_string() 2023-11-17 19:47:53 +00:00
PS1FontProgram.cpp LibPDF: Implement support for callgsubr in CFF font programs 2023-10-18 10:50:32 -04:00
PS1FontProgram.h LibPDF: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
SimpleFont.cpp LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00
SimpleFont.h LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00
TrueTypeFont.cpp LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00
TrueTypeFont.h LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00
Type0Font.cpp LibPDF: Pass Renderer to PDFFont::draw_string() 2023-11-17 19:47:53 +00:00
Type0Font.h LibPDF: Pass Renderer to PDFFont::draw_string() 2023-11-17 19:47:53 +00:00
Type1Font.cpp LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00
Type1Font.h LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00
Type1FontProgram.cpp LibPDF: Change how CFF optional width prefix is stored 2023-11-14 10:10:34 +01:00
Type1FontProgram.h LibPDF: Change how CFF optional width prefix is stored 2023-11-14 10:10:34 +01:00
Type3Font.cpp LibPDF: Add an initial implementation of type 3 glyph rendering 2023-11-17 19:47:53 +00:00
Type3Font.h LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00