Skip to content

Commit

Permalink
[waterfallplot] fix crash
Browse files Browse the repository at this point in the history
update pdflib/fontpdf.py to address crash
closes #1092
  • Loading branch information
josh-hadley committed Feb 19, 2020
1 parent ba14c29 commit 8bb24c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/afdko/pdflib/fontpdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,12 @@ def makeWaterfallPDF(params, pdfFont, doProgressBar):

numWaterfallsOnPage = int(pageHeight / waterfallHeight)
numWaterFalls = len(glyphLists)
numPages = int(ceil(float(numWaterFalls) / numWaterfallsOnPage))

if numWaterfallsOnPage > 0:
numPages = int(ceil(float(numWaterFalls) / numWaterfallsOnPage))
else:
numPages = int(ceil(float(numWaterFalls)*pageHeight / waterfallHeight))

if numPages == 0:
numPages = 1
doTitle(rt_canvas, pdfFont, params, numGlyphs, numPages)
Expand Down

0 comments on commit 8bb24c9

Please sign in to comment.