The font size of print definitions is incorrect on Linux.
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 68
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Description
This is another issue related to https://github.com/racket/gui/issues/336. Suppose #336 is fixed, "File > Print definitions... > [print dialogue opens]" does print non-blank pages on Linux. But the font size of the printed file is larger than the font size set in the preference or "View > Decrease Font Size/Increase Font Size". According to the documentation:
A “point” for font sizing is equivalent to (/ 96 72) drawing units.
So the actual print font size is 1.33 times the set font size. This really makes it painful on Linux because we have to change the font size of the editor when printing and change it back after printing. On Windows there is no such problem. It seems page calculation/draw is done in the following code:
https://github.com/racket/gui/blob/03b7ffaab6ba1bd5b16907b95a1a0f12e9dd6135/gui-lib/mred/private/wxme/text.rkt#L5956-L5960
https://github.com/racket/gui/blob/03b7ffaab6ba1bd5b16907b95a1a0f12e9dd6135/gui-lib/mred/private/wxme/text.rkt#L5631-L5643
Here snip's font is used for both page number calculation and printing. Is there a way to automatically scale when printing so that the print font size is adjusted to the actual font size?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the page calculation and drawing code in gui-lib/mred/private/wxme/text.rkt at lines 5956-5960 and 5631-5643, then review the linked display-resolution documentation. Trace how the snip font is used for page calculation and printing on Linux. Done means Print definitions uses the configured editor font size without requiring the user to change it before and after printing.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100