show cid for unknown characters
git-svn-id: https://pdfminerr.googlecode.com/svn/trunk/pdfminer@275 1aa58f4a-7d42-0410-adbc-911cccaed67cpull/1/head
parent
7374b81383
commit
9f78915ea6
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue