Skip to content

Read a symbolic TrueType font, so a scanned-era form says something - #14

Merged
tannevaled merged 1 commit into
mainfrom
deps/symbolic-truetype
Aug 28, 2026
Merged

Read a symbolic TrueType font, so a scanned-era form says something#14
tannevaled merged 1 commit into
mainfrom
deps/symbolic-truetype

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

extract v0.3.0 reads a symbolic TrueType font through its own character map. A
font flagged symbolic, with an embedded FontFile2 and neither /Encoding nor
/ToUnicode, used to yield no text at all — so the text of a document set in one
came back as a handful of stray characters.

Measured through this module's own front door:

pdfops text -pages 1 1999-schedule-i.pdf 10 -> 1 103 words
pdfops text -pages 1 1999-schedule-d.pdf 10 -> 312 words

pdftotext finds 1 105 and 314 on the same two pages. The two words are the
price of being stricter than the reference: neither poppler nor pdf.js consults
the character map for text — both default such a font to WinAnsiEncoding names
and hope — while this reports the character of the glyph that is actually
drawn, and stays silent where the font gives it no honest answer.

Across 118 843 arXiv PDFs not one byte of extracted text changes, and across
the 1 633 real forms four files gain text and none loses any.

pdffont v0.3.1 comes along, and where it applies ops v0.7.1.

…hing

extract v0.3.0 reads a symbolic TrueType font through its own character map. A
font flagged symbolic, with an embedded FontFile2 and neither /Encoding nor
/ToUnicode, used to yield no text at all — so the text of a document set in one
came back as a handful of stray characters.

Measured through this module's own front door:

  pdfops text -pages 1 1999-schedule-i.pdf     10 -> 1 103 words
  pdfops text -pages 1 1999-schedule-d.pdf     10 ->   312 words

pdftotext finds 1 105 and 314 on the same two pages. The two words are the
price of being stricter than the reference: neither poppler nor pdf.js consults
the character map for text — both default such a font to WinAnsiEncoding names
and hope — while this reports the character of the glyph that is actually
drawn, and stays silent where the font gives it no honest answer.

Across 118 843 arXiv PDFs not one byte of extracted text changes, and across
the 1 633 real forms four files gain text and none loses any.

pdffont v0.3.1 comes along, and where it applies ops v0.7.1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit b2348d5 into main Aug 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant