Mercurial > emacs
comparison lisp/play/gamegrid.el @ 91013:850287d64489
(gamegrid-setup-default-font): Calculate a font
height that doesn't exceed the requested height by rounding off.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 23 Aug 2007 12:13:24 +0000 |
parents | f55f9811f5d7 |
children | b83d0dadb2a7 |
comparison
equal
deleted
inserted
replaced
91012:87ebf7823e2d | 91013:850287d64489 |
---|---|
318 (let ((height (cdr (image-size glyph)))) | 318 (let ((height (cdr (image-size glyph)))) |
319 (if (or (null max-height) | 319 (if (or (null max-height) |
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)) |
327 (setq gamegrid-display-table (make-display-table)) | 334 (setq gamegrid-display-table (make-display-table)) |
328 (setq gamegrid-face-table (make-vector 256 nil)) | 335 (setq gamegrid-face-table (make-vector 256 nil)) |