From 534044a671c7e0350093d6953ceff5ff1844b36f Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 28 Aug 2026 11:25:57 +0200 Subject: [PATCH] deps: a form that converted to three hundred bytes now converts to eight thousand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 a document set in one converted to a heading and nothing else. Four US Department of Labor forms from 1999, converted to LaTeX: 1999-schedule-i 296 bytes, 16 words -> 8 565 bytes, 1 955 words 1999-5500-schedule-a 354 bytes, 32 words -> 10 550 bytes, 2 605 words 1999-schedule-d 325 bytes, 24 words -> 4 972 bytes, 540 words 1999-schedule-g 354 bytes, 32 words -> 6 466 bytes, 825 words Reading the page rather than the file: schedule I gave "2 0 9 9 0 0 0 1 1 M" and now gives "SCHEDULE I Financial Information -- Small Plan Official Use Only / (Form 5500) OMB No. 1210-0110 ...", which is 1 103 words against pdftotext's 1 105 on the same page. 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 actually gets drawn, and stays silent where the font gives it no honest answer. Co-Authored-By: Claude Opus 5 --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 4f92902..5d2406b 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,11 @@ module github.com/go-pdfkit/latex go 1.26.4 require ( - github.com/go-pdfkit/extract v0.2.0 + github.com/go-pdfkit/extract v0.3.0 github.com/go-pdfkit/reader v0.6.0 ) require ( - github.com/go-opentype/opentype v0.9.0 // indirect + github.com/go-opentype/opentype v0.12.0 // indirect github.com/go-pdfkit/pdffont v0.3.0 // indirect ) diff --git a/go.sum b/go.sum index b4467b4..c5582bb 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,9 @@ github.com/go-opentype/fonts v0.8.0 h1:77i3VPIH90GbstzNb21mk+an4WvEOe2idC6W+J0n0fw= github.com/go-opentype/fonts v0.8.0/go.mod h1:C6yQL2apHItfEZ5hztpsHF0S5mlX/hklLlq/Z5fRG/g= -github.com/go-opentype/opentype v0.9.0 h1:GFgcJ3nwTDp4NJr5O+Paw7lhZx5Jv/R+noZwvhYDlkM= -github.com/go-opentype/opentype v0.9.0/go.mod h1:AOixevJf7XQaH7+WG+OMIOZEbYPXfMqklVk26Y6YTUU= -github.com/go-pdfkit/extract v0.2.0 h1:ibx2C2mJTJjGzP9bRnrRnmvdeZjv9aTas6tSkeEiTeM= -github.com/go-pdfkit/extract v0.2.0/go.mod h1:7KJGmgvxjk9qqbDdjpaAcEzd4G3vq3ciHuuufVdLiu4= +github.com/go-opentype/opentype v0.12.0 h1:wBlcDi+3ZaNZXEt5z+Ixr11/cYYwi5W+jX6yTl/qr1I= +github.com/go-opentype/opentype v0.12.0/go.mod h1:AOixevJf7XQaH7+WG+OMIOZEbYPXfMqklVk26Y6YTUU= +github.com/go-pdfkit/extract v0.3.0 h1:w1ansrvMNqd+Hy1p5fo1orh6hM8meb+xCNKNap/7omM= +github.com/go-pdfkit/extract v0.3.0/go.mod h1:EOWOcx3o0HDC3ryCMoE9pwNIb3mwVmnXBSpTRfO1VdY= github.com/go-pdfkit/pdffont v0.3.0 h1:G5DKcAmsZJ0e17QhSrcUaL7PKEXKjUx4P/iGMl7bAbI= github.com/go-pdfkit/pdffont v0.3.0/go.mod h1:bfmNLna1l1CljNX/Utg55YzFylovfmI7sJnvgA3bzKI= github.com/go-pdfkit/reader v0.6.0 h1:KAabNOYUcTlZlNBTbG9bEhWP1NiZhjuhzUdavdTdfes=