diff lisp/w3/w3-xemac.el @ 122:d2f30a177268 r20-1b14

Import from CVS: tag r20-1b14
author cvs
date Mon, 13 Aug 2007 09:26:03 +0200
parents 7d55a9ba150c
children b980b6286996
line wrap: on
line diff
--- a/lisp/w3/w3-xemac.el	Mon Aug 13 09:25:31 2007 +0200
+++ b/lisp/w3/w3-xemac.el	Mon Aug 13 09:26:03 2007 +0200
@@ -1,7 +1,7 @@
 ;;; w3-xemac.el --- XEmacs specific functions for emacs-w3
 ;; Author: wmperry
-;; Created: 1997/04/01 19:23:21
-;; Version: 1.17
+;; Created: 1997/04/10 00:03:38
+;; Version: 1.18
 ;; Keywords: faces, help, mouse, hypermedia
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -35,6 +35,15 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Enhancements For XEmacs
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun w3-text-pixel-width (str &optional face)
+  "Return the pixel-width of a chunk of text STR with face FACE."
+  (let ((glyph (make-glyph str))
+	(todo (if (listp face) face (list face)))
+	(max 0))
+    (while (progn (set-glyph-face glyph (pop todo)) todo)
+      (setq max (max (glyph-width glyph) max)))
+    max))
+  
 (defun w3-mouse-handler (e)
   "Function to message the url under the mouse cursor"
   (interactive "e")