show cid for unknown characters

git-svn-id: https://pdfminerr.googlecode.com/svn/trunk/pdfminer@275 1aa58f4a-7d42-0410-adbc-911cccaed67c
pull/1/head
yusuke.shinyama.dummy 2010-11-23 10:53:19 +00:00
parent 7374b81383
commit 9f78915ea6
2 changed files with 4 additions and 2 deletions

View File

@ -105,7 +105,7 @@ class PDFLayoutAnalyzer(PDFTextDevice):
def handle_undefined_char(self, font, cid):
if self.debug:
print >>sys.stderr, 'undefined: %r, %r' % (font, cid)
return '?'
return '(cid:%d)' % cid
def receive_layout(self, ltpage):
return

View File

@ -399,6 +399,8 @@ class TrueTypeFont(object):
else:
for c in xrange(sc, ec+1):
char2gid[c] = (c + idd) & 0xffff
else:
assert 0
# create unicode map
unicode_map = FileUnicodeMap()
for (char,gid) in char2gid.iteritems():
@ -668,7 +670,7 @@ class PDFCIDFont(PDFFont):
def main(argv):
for fname in argv[1:]:
fp = file(fname, 'rb')
CFFFont(fp)
font = TrueTypeFont(fname, fp)
fp.close()
return