aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>2007-08-23 12:13:24 +0000
committerKenichi Handa <[email protected]>2007-08-23 12:13:24 +0000
commit34764b731136816b9e346addd7997aceb41dfdbd (patch)
tree644ffcc03f51bb09ef17a6e1e88ab1b1f0de22a9 /lisp
parent3898f050065ab2f71b11efaaf0522d94ce78d924 (diff)
(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.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index 74158e7bfd..dab015eb67 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -320,7 +320,14 @@ static unsigned char gamegrid_bits[] = {
(< max-height height))
(setq max-height height))))))
(when (and max-height (< max-height 1))
- (set-face-attribute gamegrid-face nil :height max-height)))))
+ (let ((default-font-height (face-attribute 'default :height))
+ (resy (/ (display-pixel-height) (/ (display-mm-height) 25.4)))
+ point-size pixel-size)
+ (setq point-size (/ (* (float default-font-height) max-height) 10)
+ pixel-size (floor (* resy (/ point-size 72.27)))
+ point-size (* (/ pixel-size resy) 72.27))
+ (set-face-attribute gamegrid-face nil
+ :height (floor (* point-size 10))))))))
(defun gamegrid-initialize-display ()
(setq gamegrid-display-mode (gamegrid-display-type))