Here's a ChangeLog update and a small patch that makes rtf-support work
better on X11; previously the code couldn't decode the font strings on
X (only those on Windows).
Steve, what's the normal procedure for checking this in? Do I just go
ahead or should I leave it a couple of days first to give other people
time to look at my patch?
Kind regards,
Alastair.
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/text-modes/ChangeLog,v
retrieving revision 1.42
diff -u -r1.42 ChangeLog
--- ChangeLog 2002/03/25 03:26:00 1.42
+++ ChangeLog 2002/03/29 12:40:01
@@ -1,3 +1,8 @@
+2002-03-29 Alastair J. Houghton <ajhoughton(a)lineone.net>
+
+ * rtf-support.el (rtf-spool-region): Fixed extraction of font
+ information [name, size etc...] on X11.
+
2002-03-25 Steve Youngs <youngs(a)xemacs.org>
* Makefile (VERSION): 1.40 released.
Index: rtf-support.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/text-modes/rtf-support.el,v
retrieving revision 1.1
diff -u -r1.1 rtf-support.el
--- rtf-support.el 2001/12/28 23:31:50 1.1
+++ rtf-support.el 2002/03/29 12:24:34
@@ -386,13 +386,26 @@
(mapc '(lambda (cur-face)
;; Extract font information
(setq font (font-name (face-property cur-face 'font)))
- (setq font (split-string font ":"))
- (setq font (list (nth 0 font)
- (nth 1 font)
- (nth 3 font)
- (if (length (nth 2 font))
- (string-to-number (nth 2 font))
- 10)))
+ (let ((type (console-type)))
+ (cond
+ ((eq type 'x)
+ (setq font (split-string font "-"))
+ (setq font (list (nth 2 font)
+ (nth 3 font)
+ (nth 4 font)
+ (cond
+ ((eq (nth 8 font) "*") 10)
+ ((> (length (nth 8 font)) 0)
+ (/ (string-to-number (nth 8 font)) 10))
+ (t 10)))))
+ (t
+ (setq font (split-string font ":"))
+ (setq font (list (nth 0 font)
+ (nth 1 font)
+ (nth 3 font)
+ (if (> (length (nth 2 font)) 0)
+ (string-to-number (nth 2 font))
+ 10))))))
;; Make a new font if necessary
(unless (assoc (nth 0 font) fonts)
--
Alastair J. Houghton <ajhoughton(a)lineone.net>
Show replies by date