APPROVE COMMIT 21.5
NOTE: This patch has been committed.
This should be considered for 21.4, Vin.
lisp/ChangeLog addition:
2005-03-25 Ralf Angeli <angeli(a)iwi.uni-sb.de>
* font.el (font-spatial-to-canonical): Correct calculation of
return value for pixel-based input value.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: lisp/font.el
Index: lisp/font.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font.el,v
retrieving revision 1.16
diff -u -u -r1.16 font.el
--- lisp/font.el 2005/01/28 02:58:40 1.16
+++ lisp/font.el 2005/03/25 15:56:05
@@ -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"))
--
“I, for instance, am gung-ho about open source because my family is being
held hostage in Rob Malda’s basement. But who fact-checks me, or Enderle,
when we say something in public? No-one!” -- Danny O’Brien