Skip to content

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

@chihyang

Description

@chihyang

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions