PDF Output: Fix extracting text from generated PDFs not working if more than 100 characters per font are used in the text. Fixes #1857886 [Convert epub to pdf, pdf appearance looks correct, but some of the copied text is incorrect](https://bugs.launchpad.net/calibre/+bug/1857886)

This commit is contained in:
Kovid Goyal 2020-01-01 12:45:20 +05:30
parent 3bcf55d571
commit 6b348a0940
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -799,7 +799,6 @@ class CMap(object):
lines = ['1 begincodespacerange', '<{}> <{}>'.format(*map(ashex, (self.start_codespace, self.end_codespace))), 'endcodespacerange'] lines = ['1 begincodespacerange', '<{}> <{}>'.format(*map(ashex, (self.start_codespace, self.end_codespace))), 'endcodespacerange']
while chars: while chars:
group, chars = chars[:100], chars[100:] group, chars = chars[:100], chars[100:]
del chars[:100]
lines.append('{} beginbfchar'.format(len(group))) lines.append('{} beginbfchar'.format(len(group)))
for g in group: for g in group:
lines.append('<{}> <{}>'.format(*map(ashex, g))) lines.append('<{}> <{}>'.format(*map(ashex, g)))