ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* more on missing ligatures
@ 2002-03-08 16:56 Bill McClain
  2002-03-09 20:38 ` Bill McClain
  0 siblings, 1 reply; 4+ messages in thread
From: Bill McClain @ 2002-03-08 16:56 UTC (permalink / raw)


I'm back to investigating why Context is not displaying ligatures from
my new Adobe Sabon font. I've discovered something else which may be a
clue: Context and plain pdftex differ in the glyphs they generate from
the same font file. I presume this is caused by some improper definition
at my end, but I don't know how to diagnose it.

In the jobs below, simple-p.tex is just plain tex. Note (a) the
ligatures don't work, (b) but the glyphs exist and can be referenced by
number, (c) certain (but not all?) accented characters are being
composed rather than using the proper glyphs. This is particularly
noticeable in the accented "A" glyphs. PDF file:
http://home.salamander.com/~wmcclain/simple-p.pdf.

The Context version of the same job is simple-c.tex. (a) and (b) are as
above, but for (c) it looks as if Context uses the correct glyphs rather
than composing the chars. PDF file:
http://home.salamander.com/~wmcclain/simple-c.pdf.

What does Context know that plain pdftex doesn't?

Finally, the sample file produced by texfont does produce the correct
ligatures: 
http://home.salamander.com/~wmcclain/texnansi-adobe-sabon.pdf.

I'm using:
pdfeTeX, Version 3.14159-1.00a-pretest-20010806-2.1 (Web2C 7.3.3.1)
(format=cont-en 2002.3.1)  8 MAR 2002 10:26
ConTeXt  ver: 2002.2.25  fmt: 2002.3.1  int: english  mes: english

The plain tex file:
* * * 
\pdfmapfile{+texnansi-adobe-sabon.map}

\def\Fi{\char12}
\def\Fl{\char8}
\def\OpenDquote{\char147}
\def\CloseDquote{\char148}
\def\Endash{\char150}
\def\Emdash{\char151}

\font\sabon=texnansi-raw-sar at 60pt
\sabon

fi fl `` '' -- ---

\Fi\ \Fl\  \OpenDquote\ \CloseDquote\ \Endash\ \Emdash

\`A \char192 

\'A \char193

\^A \char194

\~A \char195

\"A \char196

\AA \char197

\AE \char198

\c C \char199

\`a \char224

\bye
* * *

The Context file:
* * *
\def\Fi{\char12}
\def\Fl{\char8}
\def\OpenDquote{\char147}
\def\CloseDquote{\char148}
\def\Endash{\char150}
\def\Emdash{\char151}

\usetypescriptfile[type-sabon]
\usetypescript[Sabon]
\setupbodyfont[Sabon, 60pt]

\starttext
\noheaderandfooterlines

fi fl `` '' -- ---

\Fi\ \Fl\  \OpenDquote\ \CloseDquote\ \Endash\ \Emdash

\`A \char192 

\'A \char193

\^A \char194

\~A \char195

\"A \char196

\AA \char197

\AE \char198

\c C \char199

\`a \char224

\stoptext
* * *

-Bill


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: more on missing ligatures
  2002-03-08 16:56 more on missing ligatures Bill McClain
@ 2002-03-09 20:38 ` Bill McClain
  2002-03-11  0:34   ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Bill McClain @ 2002-03-09 20:38 UTC (permalink / raw)


Bill McClain wrote:
> 
> I'm back to investigating why Context is not displaying ligatures from
> my new Adobe Sabon font. I've discovered something else which may be a
> clue: Context and plain pdftex differ in the glyphs they generate from
> the same font file. I presume this is caused by some improper definition
> at my end, but I don't know how to diagnose it.

More info: the map file which texfont produces references the newly
created tfm files. However, it looks to me as if there is no ligature
information in those files. The virtual font files do have ligature
info, and when I change my font declarations to use the vf files (for
example, "texnansi-sar" instead of "texnansi-raw-sar"), then Context
produces the ligatures properly. 

I'm not sure how that can be, because "texnansi-sar" is not even listed
in the map file.

Is there some automatic linkage between the tfm and vf files which I am
missing? Or should the map file reference the vf files directly?

-Bill


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: more on missing ligatures
  2002-03-09 20:38 ` Bill McClain
@ 2002-03-11  0:34   ` Hans Hagen
  2002-03-11 13:29     ` Bill McClain
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2002-03-11  0:34 UTC (permalink / raw)
  Cc: ntg-context

At 02:38 PM 3/9/2002 -0600, Bill McClain wrote:
>Bill McClain wrote:
> >
> > I'm back to investigating why Context is not displaying ligatures from
> > my new Adobe Sabon font. I've discovered something else which may be a
> > clue: Context and plain pdftex differ in the glyphs they generate from
> > the same font file. I presume this is caused by some improper definition
> > at my end, but I don't know how to diagnose it.
>
>More info: the map file which texfont produces references the newly
>created tfm files. However, it looks to me as if there is no ligature
>information in those files. The virtual font files do have ligature
>info, and when I change my font declarations to use the vf files (for
>example, "texnansi-sar" instead of "texnansi-raw-sar"), then Context
>produces the ligatures properly.
>
>I'm not sure how that can be, because "texnansi-sar" is not even listed
>in the map file.
>
>Is there some automatic linkage between the tfm and vf files which I am
>missing? Or should the map file reference the vf files directly?

If you use virtual fonts, as far as i know, tex itself uses the font:

   somefont.tfm

which is accompanied by a virtual companion

   somefont.vf

which can construct glyphs from multiple font files, in our case at least 
it uses the raw file, which is

   somefont-raw.tfm

Now, tex itself only needs the tfm file but dvips and the pdftex backend 
need the vf file in order to construct composed or manipulated glyphs. So, 
when vf was introduced, tex was not adapted, but dvips was,

I must admit that this model is not that clear -)

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: more on missing ligatures
  2002-03-11  0:34   ` Hans Hagen
@ 2002-03-11 13:29     ` Bill McClain
  0 siblings, 0 replies; 4+ messages in thread
From: Bill McClain @ 2002-03-11 13:29 UTC (permalink / raw)
  Cc: ntg-context

Hans Hagen wrote:

> Now, tex itself only needs the tfm file but dvips and the pdftex backend
> need the vf file in order to construct composed or manipulated glyphs. So,
> when vf was introduced, tex was not adapted, but dvips was,
> 
> I must admit that this model is not that clear -)

Ah! I think I see it now. This means the examples on my help page were
wrong also; I was referencing raw files when I shouldn't have. I've
corrected that now.

To summarize:

My mistake was thinking that the font names used in a tex job had to be
those listed in the map file. (And this happened to be true in my early
tests because the fonts I was using were not virtual). But, as you point
out, the map file is for the backend: associating a tfm file with the
glyph repository (pfb).

Tex (I have just learned), given a font name, searches in the usual font
places for a tfm file. Magically, it knows when a tfm has virtual vf
file of the same name. The vf file contains references to other tfm or
vf files. Eventually, when the backend runs, it needs the mapping from a
tfm to a pfb.

Using a real example:

Texfont produced for me:

    texmf/fonts/tfm/adobe/sabon/texnansi-raw-sar.tfm
    texmf/fonts/tfm/adobe/sabon/texnansi-sar.tfm

    texmf/fonts/vf/adobe/sabon/texnansi-sar.tfm

and a map file which contains:

    texnansi-raw-sar Sabon-Roman 4 < sar_____.pfb texnansi.enc

In my setup for this font, I use:

    \definefontsynonym[Sabon-Roman][texnansi-sar][encoding=texnansi]

Tex finds and uses the virtual font, which has the ligature info (the
raw file doesn't!)

The virtual font has a link to the raw font:

    vftovp texnansi-sar | grep FONTNAME
        (FONTNAME texnansi-raw-sar)

When the backend needs to generate the glyphs, it uses the
texnansi-raw-sar entry in the map file to find the pfb and encoding.

Simple, eh? (Honestly, bundling resources together has been a problem on
many systems I have used. Anyone ever program the Macintosh?)

-Bill


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-03-11 13:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-08 16:56 more on missing ligatures Bill McClain
2002-03-09 20:38 ` Bill McClain
2002-03-11  0:34   ` Hans Hagen
2002-03-11 13:29     ` Bill McClain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).