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

Bug#193444: further information again



Here's further analysis.

The following test file produces incorrect results (slanted dollar
instead of slanted sterling) for the last two cases.  AFAIK, this is a
LaTeX bug distinct from the original bug I found, but it confirms I
know what's going on in general with the sterling and dollar glyphs.
The ways to fix it are the same as the ways described below for
Helvetica (i.e., create a new font cmssu10.mf and map cmss/m/ui to it
and so on, or add a kludge that redefines the commands to produce
sterling glyphs).

    \documentclass{article}
    \begin{document}

    roman: \pounds 1

    italic: {\itshape \pounds 2}

    slanted: {\slshape \pounds 3}

    sans-serif roman: {\sffamily \pounds 4}

    sans-serif italic: {\sffamily\itshape \pounds 5}

    sans-serif slanted: {\sffamily\slshape \pounds 6}

    \end{document}

The CM sans-serif upshape sterling is correct because of some font
substitutions set up specifically to cover the sterling/dollar issue.
For reference from my last email:

   dollar, roman:    upshape
   dollar, sl/it:    slshape
   sterling, roman:  itshape
   sterling, sl/it:  ui      (= "upright italic" otherwise, I think)

Here is a log of a source calling for CM sans-serif upshape sterling:

    LaTeX Font Warning: Font shape `OT1/cmss/m/ui' in size <10> not available
    (Font)              Font shape `OT1/cmr/m/ui' tried instead on input line 18.

What happens there?  \pounds -> \textsterling -> select ui shape ->
fall back from cmss/ui to cmr/ui -> glyph in position of '$', which is
correct (or at least reasonable: it's recognizably not a sans-serif
glyph, but it's the right symbol, a sterling not a dollar).

Here is the corresponding log for the Helvetica (PHV and \sffamily)
sterling:

    (/usr/share/texmf/tex/latex/psnfss/ot1phv.fd
    File: ot1phv.fd 2001/06/04 scalable font definitions for OT1/phv.
    )
    LaTeX Font Info:    Font shape `OT1/phv/m/ui' in size <10> not available
    (Font)              Font shape `OT1/phv/m/it' tried instead on input line 18.
    LaTeX Font Info:    Font shape `OT1/phv/m/it' in size <10> not available
    (Font)              Font shape `OT1/phv/m/sl' tried instead on input line 18.
     [1


What happens there?  \pounds -> \textsterling -> select ui shape ->
fall back from phv/ui to phv/it -> fall back from phv/it to phv/sl ->
glyph in position of '$', which is INcorrect (see referenced table at
top, it is the slanted/italic dollar glyph, as expected).

Helvetica defines n and sl; ui -> it -> sl.  We have only two OT1
"alphabets" (n and sl) whereas in CM we have four (n sl it ui).

To imitate CM, ot1phv.fd would need to define a mapping for two new
font files, which would have to be created.  Doing that seems to me to
be too much work and complication just to solve the dollar/sterling
problem.  So here is an alternative.  Don't touch ot1phv.fd and
instead redefine \pounds, \textsterling, \mathsterling, simply to
produce the right glyph from the PostScript-encoded font (or whatever
font files already exist and have the sterling and slanted-sterling
Helvetica glyphs in them -- if no such files exist and we have to
create them, we might as well duplicate the CM hack).  The
redefinitions would do \newfont if necessary (on first use in a file).
The majority of files do not use a sterling glyph and no extra work
will be done or resources used in these cases.  I've done this kind of
hack before many times to pull a single glyph out of a PostScript font
without messing around with different encodings.  All that messing
around gets easier as this software matures, but in this case I think
we go back to the bald kludge.  The CM system is a kludge itself, and
duplicating that kludge in Helvetica is more work than doing a new
simpler kludge.

I'll also try to see what other OT1 fonts have analogous problems and
I'll look to see how psnfss is assembled and built since one might be
able to correct the problem in one place for all affected psnfss
fonts.



Reply to: