I have successfully converted Adobe Garamond Pro some time ago. Proceed at own risk.
Start with creating a directory where you put the OTF files and the script otfinst.py
. You need to configure the script to fit your requirements.
1. Set the encoding
For T1, the relevant part of the script should be edited as the following:
encoding = 'T1'
encodings = { 'T1':
{ 'berryencoding': '8t',
'commandline': '-e fontools_t1',
},
}
2. Set where to put the fonts
Using kpsewhich
, the script finds your TEXMFHOME
directory automatically, but it needs to be told the location for fonts. I am not sure about other operating systems, but using MacTeX with Mac OS X, there are three possible directories:
/usr/local/texlive/2011
– requires root access; should not be modified by a user;
/usr/local/texlive/texmf-local
– requires root access;
~/Library/texmf
– this is the TEXMFHOME
that kpsewhich
finds, so you need to specify the route from here.
The route in the script is already set correctly: localfontsdir = '/tex/latex/localfonts/'
3. Which OpenType options to support
As the script clearly explains, it picks one choice from each element and takes all permutations. Kerning and ligatures are always selected and one of the additional choices is support for old numerals (onum
), so it should satisfy your needs.
4. Set the Berry name
The Berry names are used by LaTeX to identify the font family and corresponding fonts. There is also Berry encoding for options, such as lining numerals, old numerals, bold, semibold, etc. I am not an expert, but I think that by combining these two, LaTeX chooses the appropriate files (as I can do the same manually).
If your font family is not included in this document, you should run otfinfo --family
to get its name and then make a custom Berry name. Therefore:
$otfinfo --family Crimson-Roman.otf
Suppose the output was Crimson
. Think of an original 3-letter designation (not to interfere with existing fonts), e.g. c12
and edit the script accordingly:
berryname = { 'Minion Pro' : 'pmn',
<missing part>
'Hypatia Sans Pro' : 'phy',
'Crimson' : 'c12',
}
5. Save and run
Save and run the script. In Mac OS X, cd
to the directory containing the fonts and the script and run:
$sudo python otfinst.py Crimson*
Enter the root/superuser password (because of texhash
at the end) and you should see the activity. After the script ends, it runs the mentioned texhash
, but I had to run it again myself later as I did not have nfssext-cfr.sty
. Anyway, you should now explore the configured localfonts
directory inside TEXMFHOME
and there should be a file called crimson.sty
. Open it to see the available commands e.g. to set old numerals. You may need to download the nfssext-cfr.sty
in case you do not already have it (put it in the same directory and run $sudo texhash
again).
6. Test
Create a test file with \usepackage{crimson}
in the preamble and compile using pdfTeX. It should be working properly.