[Textures] A bit of everything (1/7)

Paolo Matteucci p.n.matteucci at gmail.com
Mon Apr 4 11:03:50 EDT 2011


Nuntio vobis gaudium magnum: habemus… mappam! :-)

2011/3/28 Paolo Matteucci <p.n.matteucci at gmail.com>
>
> I think I can shed some light on this: the PFB to CFF ("PS-flavo[u]red" OTF) conversion tests I ran for the greek fonts above [with both FontForge and FontLab Studio] were successful in creating the relevant OTF files, "but" placed the characters into the *correct* Unicode slots, which Font Book, Linotype FontExplorer, FontForge, FontLab Studio, etc. could all interpret correctly, but Textures couldn’t because —I believe— it doesn’t have a, say, "Unicode" encoding to render the fonts against.
> Actually, I think the CFF route is the way to go, in that Mac OS X is likely to keep on supporting PS-flavoured OpenType fonts in the future (unlike the old Mac Type 1 fonts), and no degradation should be involved in the PFB to CFF conversion, aside from sparing us all the "malarkey" associated with the LWFN + FFIL combination.

After a lot of faffing about over the past weekend(s) (all to my
wife’s "delectation"!), I finally managed to figure out what was going
wrong with FontForge: FontForge uses an *old* "Macintosh Latin"
(a.k.a., more properly, "Mac OS Roman") encoding —see the change log
at http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT.

Using an up-to-date version of the encoding, although I still couldn’t
get LWFNs/FFILs to play ball, I did manage to create [PS] OTFs (i.e.
CFFs) that do… which I think is even better for the reasons explained
earlier! :-)

So here is what I have done (with some linked "goodies") for whoever
is interested.

[All this was tested with Textures 2.2.0b16, so I can’t guarantee it
will definitely work with the recently released v2.2.0b17 (thank you
for the info, Bruno!). I will also intentionally ignore the problems
that *might* affect OTFs in Mac OS 10.6.7 (they didn’t affect mine!),
for which see http://tug.org/pipermail/xetex/2011-April/020321.html.]

1) First of all, I installed MacPorts (http://www.macports.org/) and
the relevant FontForge port: I don’t think this step was strictly
necessary, but MacPorts provides a more up-to-date and "more complete"
[…and localized! :-)] version than the pre-compiled binary one you can
find around [and mentioned by Bruno in the first message of this
thread], though still not the very latest release (which I couldn’t be
bothered to try and compile from source!). You can then run FontForge
as a standard Mac app from /Applications/MacPorts/: this will open X11
and the fontforge binary located in /opt/local/bin/ behind the scenes
for you.

2) Load the up-to-date Mac OS Roman encoding into FontForge from the
Encoding > Load Encoding menu option, and give it a name (say,
"MacOSRoman": this will not clash with the built-in [outdated]
"Macintosh Latin"/"mac"encoding). In theory, FontForge can load the
file http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT
directly, *but* converts it internally to its "PS format" and in doing
so changes to .notdef all the characters in the 0x00–ox1F range
(rather than giving them generic Unicode names), so, the next time you
run FontForge (after quitting the application, that is) any
re-encoding will miss all these characters! :-/ So I’ve included the
correct PS encoding here:
http://dl.dropbox.com/u/14921737/TeX/Textures/FontForge.zip. Just drop
the the Encoding.ps file into ~/.FontForge or, if you already have
custom encodings, paste the MacOSRoman encoding definition contained
therein into yours.

3) The above ZIP file also contains a new version of the convert.pe
script for you to convert PFB fonts to OTFs in bulk (remember: I’m
assuming we are using the MacPorts version of the fontforge binary
here): just change the path contained in the second line of the
scripts to point to your home directory subtree. As before, place
convert.pe into the folder where your PFBs are, cd to it in the
Terminal and issue

    $ chmod +x convert.pe

to make the script executable. Then while still in the Terminal run

    $ ./convert.pe *.pfb

to generate all your [PS-favoured, Mac-re-encoded] OTFs.

4a) Your OTFs being already [re-]encoded in the Mac OS Roman encoding,
you should be able to use the corresponding CTAN TFMs directly with no
need to change their encodings within Textures or EdMetrics. This
works great for the 944 (!) cbgreek fonts. Hoping I’m not infringing
any copyright, here is the link to the result:
http://dl.dropbox.com/u/14921737/TeX/Textures/cbgreek.zip (17.9 MB!
—they may slow down Textures considerably: you may want to start with
the 10 pt ones [1000 magnification] only ["type1ec" option: see
http://ctan.sqsol.co.uk/fonts/greek/cbfonts/cbgreek.pdf]).

4b) Unfortunately, I couldn’t get the tipa TFMs
(http://www.ctan.org/tex-archive/fonts/tipa/) to play ball at all, so
I went the EdMetrics route described by Bruno:
http://email.esm.psu.edu/pipermail/textures/2011-March/000044.html.
You can find both the OTFs and the Textures metrics (1.6 MB) here:
http://dl.dropbox.com/u/14921737/TeX/Textures/tipa.zip.

    Happy TeXing!

    Paolo



More information about the Textures mailing list