[OS X TeX] A bit of everything (4/4)

Bruno Voisin bvoisin at me.com
Tue Mar 22 17:15:52 EDT 2011


European Modern
===============

European Modern was a set of commercial PostScript fonts from Y&Y, intermediate between the 7-bit Computer Modern and the Unicode Latin Modern: it was 8-bit, based on Computer Modern and contained pre-built accented characters for most European languages. In this sense, it may be seen as an outline version of the bitmap EC fonts, alternative to CM-Super and supposedly of better quality since it was prepared manually and hand-hinted. See

	http://www.tug.org/yandy/options.htm
	http://www.tug.org/yandy/em.htm

Since the open-sourcing of the Y&Y TeX system, European Modern may be found at

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em

Beware: if you download the EM fonts as part of a svn checkout of Y&Y TeX, using

	svn checkout http://yytex.googlecode.com/svn/trunk/ yytex-read-only

then each folder and sub-folder of the checkout will contain an invisible .svn folder which may be of significant size. I couldn't understand first why some tfm folders, though containing only say 50 TFM files of 4 kB, were about 1 MB in size in the Finder, then I went to the Terminal and "ls -al" revealed it all. You can erase the invisible .svn folders in all the subdirectories of the current directory by typing

	sudo find . -name .svn -exec rm -rf {} \;

sudo was needed in my case, though I don't know why. And the obvious "find . -name .svn -delete" didn't work, for some unknown reason either.

Back to topic: having looked at Lucida and MathTime already, it was only logical to look at this third and last Y&Y scalable font option for TeX. But I wasn't willing to spend any more time on TeX font issues, having had a large enough dose of TeX fonts for a whole lifetime. Then a few days ago Paolo Matteuci raised the issue twice, on the Textures mailing list and in an off-list message. He was quite persuasive, so I decided finally to have a look at European Modern, thinking this would be straightforward; again, I was wrong.

The original setups are described in the ReadMe files for Windows

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/README.txt

and for the Mac

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/macinto1.txt
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/macinto2.txt
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/manifest.txt

Based on the latter, it seems the Mac setup was distributed on 5 floppies, complete with metrics suitcases, screen fonts and printer fonts, plain TeX and LaTeX support files. These floppies are lost, but some remaining pieces are scattered in the Y&Y TeX repository. So the adaptation means essentially identifying what's relevant for TeX Live and fixing what needs to be fixed.


Fonts
-----

First come the fonts: get

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/pfb

throw away the SRC files and keep the 70 PFB files. The accompanying AFM files live in

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/afm

Metrics
-------

Second come the metrics. Four set of metrics are provided, corresponding to two different encodings for Windows:

- texnansi (aka LY1, aka 8y, aka TeX 'n ANSI), defined in <http://code.google.com/p/yytex/source/browse/trunk/fonts/vec/texnansi.vec>;

- tex256 (aka T1, aka 8t, aka Cork, aka EC or its precursor DC), defined in <http://code.google.com/p/yytex/source/browse/trunk/fonts/vec/tex256.vec>;

and two different encodings for the Mac:

- mac (aka Macintosh Standard Roman), defined in <http://code.google.com/p/yytex/source/browse/trunk/fonts/vec/mac.vec> and used in Textures < 1.6;

- texmac (aka LM1, aka LT1, aka Textures Macintosh), defined in <http://code.google.com/p/yytex/source/browse/trunk/fonts/vec/texmac.vec> and used in Textures >= 1.6.
	
It seems that the Y&Y TeX system for Windows performed on-the-fly re-encoding, storing both sets of metrics in parallel in encoding-dependent folders

	c:\yandy\fonts\tfm\texansi\tfm-em
	c:\yandy\fonts\tfm\tex256\tfm-em
	c:\yandy\fonts\tfm\nontext\tfm-emmi

and picking one particular folder at typeset time depending on the selected encoding. Other than that, in each encoding-specific folder the metrics had exactly the same names, like emr10.tfm.

This is not the way things are in TeX Live: each metrics bears a different name depending on the encoding, such as ptmr8y.tfm (texnansi) and ptmr8t.tfm (tex256) for Times-Roman, and it is based on these names alone that an encoding is picked at typeset time. Hence for EM you cannot have several encodings installed simultaneously: you must choose one encoding once and for good at install time, and stick with it afterwards.

This is most inconvenient, since characters will remain unavailable depending on your choice: texnansi has diacritics but not all the pre-accented letters of Eastern European languages, whereas tex256 has all these accents but no diacritics. See

	/Library/TeX/Root/texmf-dist/doc/latex/base/encguide.pdf

For Computer Modern and Latin Modern the latter has been alleviated by adding a supplementary encoding, called Text Companion (aka TS1, aka 8c) and containing all the diacritics. There is no such companion metrics for European Modern.

texmac is similar to texnansi in this respect: texnansi was designed to combine the 8-bit Windows ANSI encoding with the 7-bit TeX text encoding (aka OT1, aka 7t), and texmac was designed to combine the 8-bit Macintosh Standard Roman encoding with TeX text. So with texmac, as with texnansi, the Eastern European pre-accented letters are missing.

Moreover, in the tests I made it seems that some ligatures are also missing with texmac: for Lucida these were "<<" and ",,", here for European Modern it seems to be "``" for the typewriter fonts.

mac encoding, which has been superseded by texmac, is obsolete and irrelevant and may be discarded.

This leaves texnansi, tex256 and texmac to choose from. The following instructions consider all three and leave it to you to choose. What can only be said regarding texnansi vs texmac is that texnansi has prospered outside its Y&Y lineage, is widely used in the ConTeXt community and is actively supported on CTAN, see

	http://www.ctan.org/tex-archive/fonts/psfonts/ly1/

whereas texmac is mostly forgotten and never made it outside the Textures community.

The metrics sets are reconstructed by combining the 13 math metrics at the first level of

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/tfm

with the 57 text metrics inside, respectively,

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/tfm/texnansi
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/tfm/tex256
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/texmac

In the first two, discard tir.tfm. In the last, discard the math fonts emmi*.tfm, they are all faulty.

Mapping and reencoding
----------------------

Third come map files and encoding files. Two encoding files texnansi.enc and tex256.enc are already included in TeX Live; texmac.enc is available at

	http://code.google.com/p/yytex/source/browse/trunk/fonts/vec/texmac.enc

Three map files are provided at

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/psfonts/psfonts.emm
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/psfonts/psfonts.emt
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/psfonts/psfonts.emy

for texmac, tex256 and texnansi, respectively. In each, comment out the lines for the Computer Modern math fonts (cmsy5 ff.), since TeX Live already contains them and is configured for them.

(La)TeX support files
---------------------

Fourth come the plain TeX and LaTeX support files. These are spread between

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/latex2e
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/plain
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/tex

and similarly there are test and sample files spread between

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/latex2e
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/test
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/tex

The plain TeX macro file is

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/plain/emplain.tex

It must be supplemented for tex256 encoding by

	http://code.google.com/p/yytex/source/browse/trunk/tex/dcaccent.tex

and for texnansi encoding by texnansi.tex which is already in TeX Live. There is also a

	http://code.google.com/p/yytex/source/browse/trunk/tex/macaccen.tex

but close inspection reveals that it is for mac encoding, not texmac, and that for texmac no additional file is required.

Some preliminary editing of dcaccent.tex is required, though. Add at line 46

	\chardef\atcode=\catcode`\@     % save catcode of atsign
	\catcode`\@=11                  % make atsign `letter'

at line 502

	\catcode`\@=\atcode             % restore original catcode of atsign

and replace #1 by ##1 in lines 429-433, yielding

	\def\b##1{\oalign{##1\crcr\hidewidth
	    \vbox to.2ex{\hbox{\char9}\vss}\hidewidth}}%
	\def\c##1{\setbox0\hbox{##1}\ifdim\ht0=1ex\accent11 ##1
	  \else{\ooalign{\hidewidth\char11\hidewidth\crcr\unhbox0}}\fi}%
	}

Then, to use EM fonts in plain TeX, for LY1 encoding (ie texnansi) you'll write

	\input emplain
	\input texnansi

for T1 encoding (ie tex256) you'll write

	\input emplain
	\input dcaccent

and for LM1 (ie texmac) encoding you'll write

	\input emplain

The LaTeX dedicated package is

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/latex2e/em.sty

It must be supplemented for texmac encoding by a file lm1enc.def which is missing. I quickly hacked one by taking lt1enc.def from the textures-psfonts package by Vincent Jalby on the Textures 2.1 CD, renaming it to lm1enc.def and replacing

	\DeclareFontShape{LT1}{cmr}{m}{n}{<-> Times}{} 

by

	\DeclareFontShape{LM1}{cmr}{m}{n}{
	        <-6>    emr5
	        <6-7>   emr6
	        <7-8>   emr7
	        <8-9>   emr8
	        <9-10>  emr9
	        <10-12> emr10
	        <12-17> emr12
	        <17->   emr17
	      }{}

The test files

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/latex2e/testem.tex
	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/test/test_l2e.tex

contain a line

	\usepackage{emgreek}	 % needed for upright uppercase Greek

pointing to a package emgreek.sty which seems to correspond to the file

	http://code.google.com/p/yytex/source/browse/trunk/fonts/em/tex/emgreek.tex

However, this file does more harm than good: it makes exactly the opposite of what it's supposed to, namely the upright uppercase Greek characters disappear. Hence throw away emgreek.tex/sty, and comment out the lines calling it. 

Then, to use EM in LaTeX, for LY1 encoding use

	\usepackage[LY1]{fontenc}
	\usepackage{em}

for T1 encoding use

	\usepackage[T1]{fontenc}
	\usepackage{em}

and for LM1 encoding use

	\usepackage[LM1]{fontenc}
	\usepackage{em}

Another problem arises though: when a char size option other than the default [10pt] is chosen together with T1 encoding, for example by writing

	\documentstyle[11pt]{article}
	\usepackage[T1]{fontenc}
	\usepackage{em}

then the EM fonts are superseded by EC in the output and the CM-Super fonts are used instead (sfrm1095.pfb instead of emr10.pfb here). It seems that, in this case, the definition of T1/cmr from t1cmr.fd built into the LaTeX format, namely

	\providecommand{\EC at family}[5]{%
	  \DeclareFontShape{#1}{#2}{#3}{#4}%
	  {<5><6><7><8><9><10><10.95><12><14.4>%
	   <17.28><20.74><24.88><29.86><35.83>genb*#5}{}}
	\DeclareFontFamily{T1}{cmr}{}
	\EC at family{T1}{cmr}{m}{n}{ecrm}

takes precedence over its redefinition in em.sty, namely

	\DeclareFontFamily{T1}{cmr}{}
	\DeclareFontShape{T1}{cmr}{m}{n}{
	        <-6>    emr5
	        <6-7>   emr6
	        <7-8>   emr7
	        <8-9>   emr8
	        <9-10>  emr9
	        <10-12> emr10
	        <12-17> emr12
	        <17->   emr17
	      }{}

To solve this, use instead

	\usepackage[LY1]{fontenc}
	\usepackage[T1]{em}

I'd have a hard time explaining why it works, but it does!

Installation
------------

Attached is an archive of a full European Modern setup for TeX Live, save the PFB font files for size considerations. These can be easily downloaded from the URL given in the first step above. You only have to choose one encoding, remove the TFM files for the other encodings and enable the map file for this encoding.

Namely, assuming a system-wide setup and an installation in /Library/TeX/Local, what you have to do for texnansi encoding is

	sudo rm -r /Library/TeX/Local/fonts/tfm/yandy/em-tex256
	sudo rm -r /Library/TeX/Local/fonts/tfm/yandy/em-texmac
	sudo mktexlsr
	sudo updmap-sys -H --enable Map psfonts.emy

for tex256 encoding

	sudo rm -r /Library/TeX/Local/fonts/tfm/yandy/em-texmac
	sudo rm -r /Library/TeX/Local/fonts/tfm/yandy/em-texnansi
	sudo mktexlsr
	sudo updmap-sys -H --enable Map psfonts.emt

and for texmac encoding

	sudo rm -r /Library/TeX/Local/fonts/tfm/yandy/em-tex256
	sudo rm -r /Library/TeX/Local/fonts/tfm/yandy/em-texnansi
	sudo mktexlsr
	sudo updmap-sys -H --enable Map psfonts.emm

For a user-specific setup in ~/Library/texmf replace the above by

	rm -r ~/Library/texmf/fonts/tfm/yandy/em-tex256
	rm -r ~/Library/texmf/fonts/tfm/yandy/em-texmac
	updmap --enable Map psfonts.emy

for texnansi encoding, and similarly for the other encodings.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: em.zip
Type: application/zip
Size: 1055364 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20110322/f4ac9a31/attachment.zip>
-------------- next part --------------



Y&Y
===

Finally, in several occasions in this series or the companion series for Textures, files have been mentioned related to plain TeX support by Y&Y.

My first contact with these files came with Lucida fonts, licensed from Y&Y and sold by Blue Sky Research. The LucidaBright #2 floppy contained

	fonttest.tex
	stanacce.tex
	texnansi.tex

the Lucida Expert Bright floppy contained

	macacce.tex
	stanacce.tex

and the file lcdplain.tex in these floppies contained three mysterious lines at the end

	% \input texnansi.tex if you are using `TeX n ANSI' encoding
	% \input ansiacce.tex if you are using Windows ANSI encoding
	% \input stanacce.tex if you are using Adobe StandardEncoding 

At the time I could not understand what this was about: the lines mentioned a file which wasn't there (ansiacce.tex), they did not mention one which was (macacce.tex), and obviously none of these files was of any use to Textures anyway.

This became more mysterious with gwTeX, based on teTeX, whose early versions had a MathTime support directory containing

	ansiacce.tex
	dcaccent.tex
	stanacce.tex
	texnansi.tex

In this support directory there were also files mtplain.tex and mtplainx.tex containing the three same mysterious lines at the end plus four other mysterious lines next to the beginning

	\input encode			% Read user encoding customizations:
					% use encodetx.tex for TeX 'n ANSI
					% use encodean.tex for Windows ANSI
					% use encodese.tex for Adobe StandardEncoding

and the additional files so mentioned,

	encodean.tex
	encodese.tex
	encodetx.tex

contained the even more mysterious lines

	% The following is for Adobe StandardEncoding (also \input stanacce.tex) 

	% The following is for Windows ANSI (also \input ansiacce.tex) 

	% The following is for TeX n ANSI (also \input texnansi.tex)

	% The following is for `DC' encoding (Cork Ireland TUG meeting 1990) [...] (also \input dcaccent.tex)

	% Following is for Macintosh `standard roman encoding' (\input macaccen.tex)

Only now, having done all those adaptations and inspected the Y&Y TeX Google code repository, am I now finally starting to make sense of this.

Here is a sketch table recapitulating, for each encoding, the associated VEC, ENC and plain TeX support files from the Y&Y TeX Google code repository:

	Adobe Standard			standard.vec	standard.enc	stanacce.tex	8a
	Windows ANSI			ansinew.vec	ansinew.enc	ansiacce.tex
	TeX n ANSI			texnansi.vec	texnansi.enc	texnansi.tex	8y, LY1
	Cork				tex256.vec	tex256.enc	dcaccent.tex	8t, T1, EC
	Macintosh Standard Roman	mac.vec				macaccen.tex
	Textures Macintosh		texmac.vec	texmac.enc			LM1, LT1
	Textures Typewriter Macintosh	texmax.vec					LM2

Following is an archive containing these plain TeX support files, in their latest versions corrected for EM, plus fonttest.tex for drawing glyph charts and plainmin.tex mentioned in mtplain.tex, together with the ENC files, minus those files which are already included in TeX Live and plus texmax.enc (see the second message in this series). It's likely what's already in TeX Live is amply sufficient, but in this way all the files referenced in the plain TeX macro files from Y&Y for Lucida, MathTime and EM are put together in one place.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: yandy.zip
Type: application/zip
Size: 44342 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/macosx-tex/attachments/20110322/f4ac9a31/attachment-0001.zip>


More information about the MacOSX-TeX mailing list