From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: Re: latex mode, nexted subscripts are unreadable Date: Wed, 26 Sep 2007 03:41:39 -0400 Message-ID: References: <200709121812.l8CICXf18901@f7.net> <46E8698B.4040607@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1190792557 25927 80.91.229.12 (26 Sep 2007 07:42:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 26 Sep 2007 07:42:37 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org, timh@insightful.com, Karl Berry To: Jason Rumney Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 26 09:42:32 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IaRXT-000257-8T for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Sep 2007 09:42:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IaRXP-0001wE-Tk for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Sep 2007 03:42:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IaRXN-0001tH-Fw for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2007 03:42:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IaRXL-0001qT-P3 for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2007 03:42:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IaRXL-0001qD-K7 for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2007 03:42:23 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IaRXL-0008CL-BA for bug-gnu-emacs@gnu.org; Wed, 26 Sep 2007 03:42:23 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IaRWd-0004LE-Du; Wed, 26 Sep 2007 03:41:39 -0400 X-Spook: AMW DES brigand SHA Honduras Clinton Geraldton Rule Psix X-Ran: 2QgO-l\xHUKq@5*zXC;/Y\z{oLrr`8Z%`T;E_+X}Wci]`5+Oahgo0##1K&L`ZI0P|mG-Y? X-Hue: green X-Attribution: GM In-Reply-To: <46E8698B.4040607@gnu.org> (Jason Rumney's message of "Wed, 12 Sep 2007 23:34:51 +0100") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16618 Archived-At: Jason Rumney wrote: >> the nested suscripts are visible, but are still too tiny for comfort. >> And they're not clearly visible - the gray letters end up with most of >> the pixels light gray and a few of them darker. [...] > It depends on the font used and the antialiasing settings of the system. > I imagine you could reproduce it on X in the emacs-unicode-2 branch with > the xft font backend enabled, some tinkering with /etc/fonts/fonts.conf > (or whatever the fontconfig configuration file is on your system) and > Courier New or a similar poorly designed truetype font. I've been playing around with a way to set a minimum size for suscripts. Perhaps something like this patch against the CVS trunk? Eg try (setq tex-suscript-height-minimum 0.9) *** tex-mode.el 25 Sep 2007 00:29:33 -0700 1.204 --- tex-mode.el 26 Sep 2007 00:36:43 -0700 *************** *** 676,687 **** (put-text-property beg next 'display nil)) (setq beg next)))) (defface superscript ! '((t :height 0.8)) ;; :raise 0.2 "Face used for superscripts." :group 'tex) (defface subscript ! '((t :height 0.8)) ;; :raise -0.2 "Face used for subscripts." :group 'tex) --- 676,713 ---- (put-text-property beg next 'display nil)) (setq beg next)))) + (defcustom tex-suscript-height-ratio 0.8 + "Ratio of subscript/superscript height to that of the preceding text. + This is subject to the limit set by `tex-suscript-height-minimum'." + :type 'float + :group 'tex + :version "23.1") + + (defcustom tex-suscript-height-minimum 0.0 + "Integer or float limiting the minimum size of subscript/superscript text. + An integer is an absolute height in units of 1/10 point, a float + is a height relative to that of the default font. Zero means no minimum." + :type '(choice (integer :tag "Integer height in 1/10 point units") + (float :tag "Fraction of default font height")) + :group 'tex + :version "23.1") + + (defun tex-suscript-height (height) + "Return the integer height of subscript/superscript font in 1/10 points. + Not smaller than the value set by `tex-suscript-height-minimum'." + (ceiling (max (if (integerp tex-suscript-height-minimum) + tex-suscript-height-minimum + (* tex-suscript-height-minimum + (face-attribute 'default :height))) + ;; NB assumes height is integer. + (* height tex-suscript-height-ratio)))) + (defface superscript ! '((t :height tex-suscript-height)) ;; :raise 0.2 "Face used for superscripts." :group 'tex) (defface subscript ! '((t :height tex-suscript-height)) ;; :raise -0.2 "Face used for subscripts." :group 'tex)