diff options
| author | Kenichi Handa | 2007-08-23 12:13:24 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2007-08-23 12:13:24 +0000 |
| commit | 34764b731136816b9e346addd7997aceb41dfdbd (patch) | |
| tree | 644ffcc03f51bb09ef17a6e1e88ab1b1f0de22a9 /lisp | |
| parent | 3898f050065ab2f71b11efaaf0522d94ce78d924 (diff) | |
| download | emacs-34764b731136816b9e346addd7997aceb41dfdbd.tar.gz emacs-34764b731136816b9e346addd7997aceb41dfdbd.zip | |
(gamegrid-setup-default-font): Calculate a font
height that doesn't exceed the requested height by rounding off.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/play/gamegrid.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index 74158e7bfd3..dab015eb67b 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el | |||
| @@ -320,7 +320,14 @@ static unsigned char gamegrid_bits[] = { | |||
| 320 | (< max-height height)) | 320 | (< max-height height)) |
| 321 | (setq max-height height)))))) | 321 | (setq max-height height)))))) |
| 322 | (when (and max-height (< max-height 1)) | 322 | (when (and max-height (< max-height 1)) |
| 323 | (set-face-attribute gamegrid-face nil :height max-height))))) | 323 | (let ((default-font-height (face-attribute 'default :height)) |
| 324 | (resy (/ (display-pixel-height) (/ (display-mm-height) 25.4))) | ||
| 325 | point-size pixel-size) | ||
| 326 | (setq point-size (/ (* (float default-font-height) max-height) 10) | ||
| 327 | pixel-size (floor (* resy (/ point-size 72.27))) | ||
| 328 | point-size (* (/ pixel-size resy) 72.27)) | ||
| 329 | (set-face-attribute gamegrid-face nil | ||
| 330 | :height (floor (* point-size 10)))))))) | ||
| 324 | 331 | ||
| 325 | (defun gamegrid-initialize-display () | 332 | (defun gamegrid-initialize-display () |
| 326 | (setq gamegrid-display-mode (gamegrid-display-type)) | 333 | (setq gamegrid-display-mode (gamegrid-display-type)) |