Re: font-latex-make-title-faces using scaled font height rather than size

Ralf Angeli <[email protected]> Thu, 10 Mar 2005 09:26:11 +0100
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
* Steven E. Harris (2005-03-09) writes:

> Starting a new document and inserting a \section{} macro, I noticed
> the new font-latex-title-(1|2|3)-face fonts. The fonts looked too big
> to my taste, so I decided to look into how they're initialized to
> their default values.

I had the same impression in case of XEmacs but didn't come around
figuring out a better alternative for `face-height'.

> However, (face-height 'default) returns 16. Related functions
> `face-ascent' and `face-descent' return 12 and 4 respectively. They
> all add up, but these are apparently not font /sizes/.
>
> Using (face-height 'default) as the base size for scaling produces a
> family of 19, 23, and 28. More likely we're looking for a family that
> scales from a base of 10, producing 12, 14, and 17.
>
> We need some function to get the size of a face. In XEmacs, at least,
> I had a hard time figuring out how to get there, but did find a
> way. Unfortunately, it requires converting, string to a number, then a
> number to a string, concatenating that string with another, then using
> a regexp to pull that number back out of the string. Only the last
> part is my fault.

Great!  Thanks for looking at this.  I checked a change based on your
findings into CVS.

I don't know if GNU Emacs is any better, but it really is disgusting
through what hoops one has to jump to get the font size.

> For now I have only been able to investigate the proposal on a single
> system (XEmacs 21.4.13 on Cygwin), and imagine that the font queries
> may required adaptation for Emacs.

No, Emacs supports scaling of fonts via the :height face attribute.
You can see that in `font-latex-make-title-faces' in the else-part of
the `(featurep 'xemacs)' condition.

-- 
Ralf