[comp.text.tex] Space around CM characters

jeffrey@cs.chalmers.se (Alan Jeffrey) (03/18/91)

I'm currently editing up a Local Guide for our new installation of
LaTeX (Frank and Rainer's font selection scheme is running very
nicely, thank you very much) so I stuck together a book design for it.
I'm going for that informal chatty computer-manual go-faster-stripes
look, so sections start a new page, and have a heading which looks
like

   Title in cmssi17 magstep 2
   ----------------------------------------------
                  Lots of text down here which is
                  run in good old cmr12, chugging
                  along being dull.

Only if you look carefully, you discover that actually what you get is

    Title in cmssi17 magstep 2
   ----------------------------------------------

Where did that extra space come from, I wondered, so I trawled all the
way through all my macros, trying to find a space that I'd left lying
around when we could possibly be in horizontal mode, and nope, there
wasn't one.  So out of desparation I tried \section{\vrule Title
in...} and got
   
   | Title in cmssi17 magstep 2
   ----------------------------------------------

that is {\em the space is there in cmssi17 itself.}  GRRRRRRR...  How
are we meant to use this as a display font if it produces ragged
margins?  I can live with cmr12 having these spaces hard-wired, as
it's a body font, and you won't notice a slightly ragged margin, but
in a display font this is appalling!

In general, one big problem with setting display material in CM fonts
is that the metrics won't tell you where character inside the box is.
For example, a sans-serif H looks like

   +------+
   | *  * |
   | **** |
   | *  * |
   +------+
    ^    ^

but there's no way to find out the two indicated gaps.  So setting
display material automatically is impossible (or at least
non-trivial).

I suppose the solution is to include some more kerning information
(perhaps include an `edge of line' character similar to the `edge of
word' that currently exists).  But this probably involves re-writing
huge amounts of the CMR MF code.  Oh well, we'll just have to live
with second-rate display setting.

Cheers,

Alan.
Alan Jeffrey         Tel: +46 31 72 10 98         jeffrey@cs.chalmers.se
Department of Computer Sciences, Chalmers University, Gothenburg, Sweden

jeffrey@cs.chalmers.se (Alan Jeffrey) (03/19/91)

As a (slightly more constructive) followup to my previous posting
about display fonts...  One solution would be to create a virtual font
that acts as a pointer to the font you'd like to use for display
material, only with an extra character added (chuck out something you
don't need, like the hard space character).  This new character would
have zero width, no black ink, and would kern in such a fashion as to
remove the side-bearings and add in some correction for slant.  This
could then be used as an `edge of line' character in display.  So
(writing _ for `edge of line')

   \hbox to \textwidth{\it_This is a display\hfil yalpsid a si sihT_}\hrule

would come out as

   This is a display                     yalpsid a si sihT
   -------------------------------------------------------

rather than

    This is a display                     yalpsid a si sihT
   -------------------------------------------------------

which is what you get at the moment.

Does this seem reasonable?  (Mind you, it means yet another
non-standard character-set encoding, sigh...)

Alan.
Alan Jeffrey         Tel: +46 31 72 10 98         jeffrey@cs.chalmers.se
Department of Computer Sciences, Chalmers University, Gothenburg, Sweden