jagpdf.Exception: 04-2001a Checksum of TrueType font table failed.

62 views
Skip to first unread message

Kim,Young-Kyun

unread,
Dec 17, 2009, 12:25:20 AM12/17/09
to jag...@googlegroups.com
Hi! I'm Korean developer.

The error occured using jagPDF and some TTF font.

Below is my test code.
---------------------------------------------------------------
import jagpdf

doc = jagpdf.create_file("test.pdf")
doc.page_start(597.6, 848.68)

Font = doc.font_load( "file=gulim.ttf; size=20; enc=utf-8" )
doc.page().canvas().text_font(Font)
doc.page().canvas().text(100, 800, u'\uac00\ub098\ub2e4\ub77c')

doc.page_end()
doc.finalize()
---------------------------------------------------------------

Below is error Message.
---------------------------------------------------------------
Traceback (most recent call last):
File "D:\prj\secu\TestWork\dbgrandom\t.py", line 15, in <module>
doc.finalize()
File "C:\devtool\python25\Lib\site-packages\jagpdf.py", line 73, in finalize
def finalize(*args): return _jagpdf.Document_finalize(*args)
jagpdf.Exception: 04-2001a Checksum of TrueType font table failed.
---------------------------------------------------------------
Other than "gulim.ttf" don't make this error.

gulim.ttf is widely used as default font for Korean in Linux
distribution - debian, ubuntu, fedora.
Also, this works well with PIL, reportlab.

gulim.ttf can be obtained from
http://kldp.net/projects/baekmuk/download/1429?filename=baekmuk-ttf-2.2.tar.gz
develop environment : XP SP3, python 2.5.4, jagPDF 1.4.0

regards..

Jaroslav Grešula

unread,
Dec 17, 2009, 3:19:15 AM12/17/09
to jag...@googlegroups.com

Hi,

I have already seen this problem with a couple of other fonts. My
assumption is that most applications simply ignore checksums in ttf. I
have already disabled checksum verification in the JagPDF development
branch[1] so the next version should work with these fonts.

Unfortunately, there is not much you can do about this problem right
now unless you are willing to build JagPDF from the latest source. A
provisional (untested) solution could be to run a Microsoft tool
called FastFont[2] on gulim.ttf - that could fix the checksums.

regards,
--
Jarda

[1] http://github.com/jgresula/jagpdf/commit/9f8659962bdc695c309f5709611e7d7505ab7562
[2] http://www.microsoft.com/typography/tools/tools.aspx

Reply all
Reply to author
Forward
0 new messages