Skip to content

Commit

Permalink
Merge pull request #1908 from catcombo/feature/fix-index-error-pdf-1.4
Browse files Browse the repository at this point in the history
Fix IndexError when rendering PDF version 1.4
  • Loading branch information
liZe authored Jul 12, 2023
2 parents 4043c1f + 9b81b57 commit 3e66794
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weasyprint/pdf/fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def build_fonts_dictionary(pdf, fonts, compress_pdf, subset, hinting):
})
if pdf.version <= b'1.4':
cids = sorted(font.widths)
padded_width = int(ceil(cids[-1] / 8))
padded_width = int(ceil((cids[-1] + 1) / 8))
bits = ['0'] * padded_width * 8
for cid in cids:
bits[cid] = '1'
Expand Down

0 comments on commit 3e66794

Please sign in to comment.