From 68b7381b446d5534070a8e4ad46080ee68760a43 Mon Sep 17 00:00:00 2001 From: ueno Date: Sun, 14 Apr 2002 21:37:38 +0000 Subject: [PATCH] * bitmap-stipple.el (bitmap-stipple-frame-char-width): New function. (bitmap-stipple-frame-char-height): New function. --- lisp/bitmap-stipple.el | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lisp/bitmap-stipple.el b/lisp/bitmap-stipple.el index 5b3d5ee..13898b8 100644 --- a/lisp/bitmap-stipple.el +++ b/lisp/bitmap-stipple.el @@ -64,14 +64,30 @@ (goto-char (point-min)) (read (current-buffer))))) +(if (fboundp 'frame-char-width) + (defalias 'bitmap-stipple-frame-char-width 'frame-char-width) + (defun bitmap-stipple-frame-char-width (&optional frame) + "Width in pixels of characters in the font in frame FRAME. +If FRAME is omitted, the selected frame is used. +For a terminal screen, the value is always 1." + (font-instance-width (face-font (find-face 'default) frame 'ascii)))) + +(if (fboundp 'frame-char-height) + (defalias 'bitmap-stipple-frame-char-height 'frame-char-height) + (defun bitmap-stipple-frame-char-width (&optional frame) + "Height in pixels of a line in the font in frame FRAME. +If FRAME is omitted, the selected frame is used. +For a terminal frame, the value is always 1." + (font-instance-height (face-font (find-face 'default) frame 'ascii)))) + (defun bitmap-stipple-insert-pixmap (pixmap &optional center) "Insert PIXMAP in the current buffer. Optional argument CENTER specified, pixmap will be centered." (let (width height beg i) (or (facep 'bitmap-stipple-splash) (make-face 'bitmap-stipple-splash)) - (setq width (/ (car pixmap) (frame-char-width)) - height (/ (cadr pixmap) (frame-char-height))) + (setq width (/ (car pixmap) (bitmap-stipple-frame-char-width)) + height (/ (cadr pixmap) (bitmap-stipple-frame-char-height))) (set-face-foreground 'bitmap-stipple-splash "red") (set-face-stipple 'bitmap-stipple-splash pixmap) (if center (insert-char ?\n height)) -- 1.7.10.4