Mercurial > hg > xemacs-beta
diff lisp/font.el @ 2685:64752935473d
[xemacs-hg @ 2005-03-25 15:58:02 by aidan]
Fix pixel-to-point conversion arithmetic in font.el--thank you, Ralf Angeli.
author | aidan |
---|---|
date | Fri, 25 Mar 2005 15:58:03 +0000 |
parents | 491f8cf78a9c |
children | ad2f4ae9895b 3742ea8250b5 |
line wrap: on
line diff
--- a/lisp/font.el Fri Mar 25 01:00:34 2005 +0000 +++ b/lisp/font.el Fri Mar 25 15:58:03 2005 +0000 @@ -311,8 +311,8 @@ a number, it is interpreted as the desired point size and returned unchanged. Otherwise SPEC must be a string consisting of a number and an optional type. The type may be the strings \"px\", \"pix\", or \"pixel\" (pixels), \"pt\" or -\"point\" (points), \"pa\" or \"pica\" (picas), \"in\" or \"inch\" (inches), \"cm\" -(centimeters), or \"mm\" (millimeters). +\"point\" (points), \"pa\" or \"pica\" (picas), \"in\" or \"inch\" (inches), +\"cm\" (centimeters), or \"mm\" (millimeters). 1 in = 2.54 cm = 6 pa = 25.4 mm = 72 pt. Pixel size is device-dependent." (cond @@ -351,7 +351,7 @@ (setq num (string-to-number spec)) (cond ((member type '("pixel" "px" "pix")) - (setq retval (* num (/ pix-width mm-width) (/ 25.4 72.0)))) + (setq retval (* num (/ mm-width pix-width) (/ 72.0 25.4)))) ((member type '("point" "pt")) (setq retval num)) ((member type '("pica" "pa"))