Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The font size of print definitions is incorrect on Linux. #338

Open
chihyang opened this issue Sep 15, 2024 · 0 comments
Open

The font size of print definitions is incorrect on Linux. #338

chihyang opened this issue Sep 15, 2024 · 0 comments

Comments

@chihyang
Copy link
Contributor

This is another issue related to #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:

(define/private (has/print-page dc page print?)
(if flow-locked?
#f
(begin
(recalc-lines dc #t)

(send snip draw dc (+ x dx) (+ down dy)
tleftx tstarty trightx tendy
dx dy
(if (pair? show-caret)
(cons p (+ p (snip->count snip)))
(if (eq? snip s-caret-snip)
show-caret
(if (and maybe-hilite?
(-endpos . > . p)
(-startpos . < . (+ p (snip->count snip))))
(cons (max 0 (- -startpos p))
(min (snip->count snip) (- -endpos p)))
'no-caret))))))

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant