From xemacs-m  Sun Sep 14 00:56:25 1997
Received: from server.sensei.co.uk (server.sensei.co.uk [193.132.124.5])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id AAA26217
	for <xemacs-beta@xemacs.org>; Sun, 14 Sep 1997 00:56:24 -0500 (CDT)
Received: from cerise.sensei.co.uk (glynn@muvies.demon.co.uk [158.152.66.14]) by server.sensei.co.uk (8.8.5/8.8.2) with ESMTP id GAA27328; Sun, 14 Sep 1997 06:55:49 +0100
Received: (from glynn@localhost) by cerise.sensei.co.uk (8.8.5/8.8.2) id GAA08956; Sun, 14 Sep 1997 06:58:54 +0100
Date: Sun, 14 Sep 1997 06:58:54 +0100
Message-Id: <199709140558.GAA08956@cerise.sensei.co.uk>
From: Glynn Clements <glynn@sensei.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: xemacs-beta@xemacs.org
CC: Hrvoje Niksic <hniksic@srce.hr>
Subject: patch: tetris.el
X-Mailer: VM 6.33 under 20.3 "Tirana" XEmacs  Lucid (beta20)


The following patch shrinks the default face until it is smaller than
the glyphs. This prevents gaps from appearing between the rows when
the default face is taller than the glyphs.

[Thanks to Hrvoje for pointing this out]

-- 
Glynn Clements <glynn@sensei.co.uk>


--- tetris.el~	Sat Sep 13 04:21:37 1997
+++ tetris.el	Sun Sep 14 06:44:16 1997
@@ -45,6 +45,7 @@
 ;; Modified: 1997-09-09, changed layout to work in a 22 line window
 ;; Modified: 1997-09-12
 ;;	fixed tetris-shift-down to deal with multiple rows correctly
+;; Modified: 1997-09-14, added tetris-setup-default-face
 ;; URL: ftp://sensei.co.uk/misc/tetris.el.gz
 ;; Tested with XEmacs 20.3-beta and Emacs 19.34
 ;; Reported to work with XEmacs 19.15 and 20.2
@@ -463,6 +464,16 @@
 			     nil 'remove-locale)
     (setq buffer-display-table tetris-display-table)))
 
+(defun tetris-setup-default-face ()
+  (cond ((eq tetris-display-mode 'glyph)
+	 (let* ((font-spec (face-property 'default 'font))
+		(name (font-name font-spec))
+		(glyph (aref tetris-display-table tetris-blank))
+		(height (glyph-height glyph)))
+	   (while (> (font-height font-spec) height)
+	     (setq name (x-find-smaller-font name))
+	     (add-spec-to-specifier font-spec name (current-buffer)))))))
+
 (defun tetris-hide-cursor ()
   (if (fboundp 'specifierp)
       (set-specifier text-cursor-visible-p nil (current-buffer))))
@@ -791,6 +802,7 @@
   (buffer-disable-undo (current-buffer))
 
   (tetris-initialize-display)
+  (tetris-setup-default-face)
   (tetris-set-display-table)
   (tetris-hide-cursor)
 

