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):
|
def handle_undefined_char(self, font, cid):
|
||||||
if self.debug:
|
if self.debug:
|
||||||
print >>sys.stderr, 'undefined: %r, %r' % (font, cid)
|
print >>sys.stderr, 'undefined: %r, %r' % (font, cid)
|
||||||
return '?'
|
return '(cid:%d)' % cid
|
||||||
|
|
||||||
def receive_layout(self, ltpage):
|
def receive_layout(self, ltpage):
|
||||||
return
|
return
|
||||||
|
|
|
@ -399,6 +399,8 @@ class TrueTypeFont(object):
|
||||||
else:
|
else:
|
||||||
for c in xrange(sc, ec+1):
|
for c in xrange(sc, ec+1):
|
||||||
char2gid[c] = (c + idd) & 0xffff
|
char2gid[c] = (c + idd) & 0xffff
|
||||||
|
else:
|
||||||
|
assert 0
|
||||||
# create unicode map
|
# create unicode map
|
||||||
unicode_map = FileUnicodeMap()
|
unicode_map = FileUnicodeMap()
|
||||||
for (char,gid) in char2gid.iteritems():
|
for (char,gid) in char2gid.iteritems():
|
||||||
|
@ -668,7 +670,7 @@ class PDFCIDFont(PDFFont):
|
||||||
def main(argv):
|
def main(argv):
|
||||||
for fname in argv[1:]:
|
for fname in argv[1:]:
|
||||||
fp = file(fname, 'rb')
|
fp = file(fname, 'rb')
|
||||||
CFFFont(fp)
|
font = TrueTypeFont(fname, fp)
|
||||||
fp.close()
|
fp.close()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue