drracket icon indicating copy to clipboard operation
drracket copied to clipboard

Print Definitions drops line numbers on/after page 12

Open dfried00 opened this issue 8 years ago • 1 comments

Summary

When printing a file from DrRacket using File... Print Definitions..., with line numbering enabled, the line numbers disappear somewhere on page 12. Changing the font size causes it to print more or less numbers - they stop on page 12, not a particular line number.

This is on Mac OS X 10.12.6 with Racket 6.10.1.

To reproduce

  1. Create a new Racket file with 690 lines. The first line should be #lang racket, and the last one ;;; Line 690 is here. The rest of the lines should be empty.

  2. In the View menu, make sure line numbers are enabled.

  3. Click on line 1. Click Print Definitions in the File menu. The resulting PDF should have at least 12 pages (if not, increase the DrRacket font size). The line numbering terminates before the end of the file (indicated by the comment line).

(this bug report written by myself and @david-christiansen)

dfried00 avatar Sep 22 '17 22:09 dfried00

This was reported again today on the Racket Discord server and I can confirm it still happens in Racket 8.1.0.6 CS on Windows 10. On my machine, it always stops somewhere on page 10 (not on page 12, as for dfried00).

I discovered the call to get-visible-line-range from gui-lib/framework/private/text-line-numbers.rkt always gets back a limited range. Debugging further, I found that it looks for which lines are visible in the range x,y=0,0 and w,h=10000,10000. I found these numbers in get-view in gui-lib/mred/private/wxme/editor-canvas.rkt and changed them to 10000000 each, and it fixed the problem for my test document – line numbers printed on every line!

These view numbers appear to be a view used specifically when printing. It makes sense to have all line numbers visible when printing, so perhaps setting these numbers to an absurdly high value is actually the proper fix?

plane avatar Jun 15 '21 18:06 plane