bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: latex mode, nexted subscripts are unreadable


From: Glenn Morris
Subject: Re: latex mode, nexted subscripts are unreadable
Date: Wed, 26 Sep 2007 03:41:39 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

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)
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]