bug-texinfo
[Top][All Lists]
Advanced

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

Patch to texinfo.tex for cleaner font handling


From: Shade, Eric D
Subject: Patch to texinfo.tex for cleaner font handling
Date: Mon, 19 Dec 2005 09:53:57 -0600

Hi.

I've attached a patch to the 2005-10-10.17 version of texinfo.tex to generalize and clean up fonts a bit.  A major benefit is being able to mix fonts from different families that need to be scaled differently to look right (usually, to make their x-heights match up).  To modify the fonts, you only need to change fontspecs on 18 consecutive lines.

If you like it, and would like to see it cleaned up or commented better, let me know.

The idea is to specify each font relative to a 10pt size, using a "fontspec": a pair of the form (fontname,ratio_to_10pt).  For example, for cmr10 the fontspec is just (cmr10,1).  For a PostScript font, the ratio will be 1 for the primary text font, but may be different from 1 for other fonts (particularly the typewriter and sans-serif fonts, if they come from different families).   When setting a font at a particular size, say 17.28pt for a heading, a little dimen hackery is used to compute a single dimension so the font can be loaded "at" the appropriate size, taking the fontspec ratio into account.

This scheme loads all fonts relative to a 10pt "base" font for each shape, so purists may be offended that it will load cmr10 at 12pt rather than cmr12.

I've included three versions of the fontspecs: one for the usual Computer Modern setup (currently commented out), one for Times using txfonts (currently active), and one I've been playing with that I really like: cmss10 for the text font, the Polish PostScript version of Concrete Roman for math and italics, and txbtt from txfonts for typewriter (also currently commented out).

This all should probably be generalized to allow different fonts outside of text.  When using cmss10 as a base font, I prefer cmssbx10 as text bold, cmssdc10 for titles, and cmssq8 for headers and footers.  Also, when mixing fonts it may be necessary to hack some math symbols; for example, when using cmss with Concrete Math, I need to hack in uppercase greek from Concrete Roman, because otherwise the cmss version is used.  I also haven't thought about whether a different mechanism for specifying leading is necessary.

Cheers,
Eric

--
Eric D. Shade, Ph.D
http://www.cs.missouristate.edu/~shade



Attachment: eds.patch
Description: eds.patch


reply via email to

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