unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Jason Rumney <jasonr@gnu.org>
Cc: bug-gnu-emacs@gnu.org, timh@insightful.com,
	Karl Berry <karl@freefriends.org>
Subject: Re: latex mode, nexted subscripts are unreadable
Date: Wed, 26 Sep 2007 03:41:39 -0400	[thread overview]
Message-ID: <rzodfpx498.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <46E8698B.4040607@gnu.org> (Jason Rumney's message of "Wed, 12 Sep 2007 23:34:51 +0100")

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)
  




  parent reply	other threads:[~2007-09-26  7:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-12 18:12 latex mode, nexted subscripts are unreadable Karl Berry
2007-09-12 22:34 ` Jason Rumney
2007-09-13  0:48   ` Tim Hesterberg
2007-09-13 15:03     ` Drew Adams
2007-09-26  7:41   ` Glenn Morris [this message]
2007-09-12 23:40 ` Tim Hesterberg
2007-09-14  0:24   ` Karl Berry
2007-09-14 16:47     ` Tim Hesterberg
  -- strict thread matches above, loose matches on Subject: below --
2007-09-06 23:21 Tim Hesterberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rzodfpx498.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=jasonr@gnu.org \
    --cc=karl@freefriends.org \
    --cc=timh@insightful.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).