[Textures] PSNFSS metrics

Bruno Voisin bvoisin at me.com
Thu May 31 04:54:54 EDT 2012


A recent post dealt with getting one of the Textures metrics for the Base 35 PostScript fonts, HelveticaO, to work in Textures 2.2. Other of these metrics were left aside, which do not work either in Textures 2.2; namely, all the metrics that are built by applying the SlantFont and ExtendFont operators to the fonts.

Here's how to circumvent this, based on the same technique as for HelveticaO. In short, we create slanted and extended fonts with FontForge, to go with each metric. The following has been done with the binary FontForge_macunivX.5-20090923.pkg.zip from <http://sourceforge.net/projects/fontforge/files/fontforge-executables/>.

First thing: do no operate on the TrueType version of the Base 35 fonts, shipped with GhostPDL, contrary to what I said in my previous post; use instead the PostScript version available on CTAN at <http://www.ctan.org/tex-archive/fonts/urw/base35>. When the TrueType version is used for transformation in FontForge followed by export to TrueType, and the exported font is used in Textures, then the result looks correct in Textures and, when printed to PDF, in Preview, but it does not look correct in Adobe Reader/Acrobat.

Here is an example with rpplro (slanted Palatino) viewed in Acrobat. testfont.tex has been used to draw a font table in Textures, with the slanted font created from the TrueType version (top) and Postscript version (bottom), and the typeset window printed to PDF. The difference is clearly visible:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PS vs TT.png
Type: image/png
Size: 133073 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/textures/attachments/20120531/1f4727b1/attachment.png>
-------------- next part --------------


Next, we have to convert the SlantFont and ExtendFont dvips instructions into FontForge transformations:

- FontForge's Oblique menu item slants the font by an angle in degrees counted counterclockwise. The dvips manual does not define what a SlantFont factor is; it seems likely this factor is that, s, defined on p. 141 at the beginning of chapter 15 "Transformations" of the METAFONTbook. Then, with theta the FontForge angle,

	theta = - arctan(s)

- FontForge's Condense/Extend menu item extends a font by percentages applied separately to Counters and Side Bearings. Not knowing exactly what dvips does, I just applied the same percentage to both. When extending an italic font, make sure the box "Correct for Italic Angle" is unchecked.

To be less esoteric, here are the associated dialogs:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: FontForge Oblique.png
Type: image/png
Size: 13263 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/textures/attachments/20120531/1f4727b1/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FontForge Condense.png
Type: image/png
Size: 13549 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/textures/attachments/20120531/1f4727b1/attachment-0002.png>
-------------- next part --------------


Attached is a file (to be viewed in TextEdit in plain text mode, with 8-chars tabs) listing, for all the transformed fonts involved in current PSNFSS, the TeX metrics name, the name of the associated PFB font from CTAN, its PostScript name, the dvips transformation, its FontForge equivalent, and the name I chose for the transformed font. This name is set in the Font Info dialog.

For example, regarding URWPalladioL-Roma (the clone of Palatino) the list goes as:

TFM names	PFB names	dvips names		dvips transforms	FontForge transforms		FontForge names

pplr8rn		uplr8a		URWPalladioL-Roma	.82 ExtendFont		Condense/Extend Scale 82%	URWPalladioL-RomaNarr
pplro8r 	uplr8a		URWPalladioL-Roma	.167 SlantFont		Oblique Slant -9.48?		URWPalladioL-Slan
pplrr8re	uplr8a		URWPalladioL-Roma	1.2 ExtendFont		Condense/Extend Scale 120%	URWPalladioL-RomaExte
pplru8r		uplri8a		URWPalladioL-Ital	-.1763 SlantFont	Oblique Slant 10.00?		URWPalladioL-Unsl

(the suffix Narr for narrow was chosen instead of the more standard Cond for condensed, to avoid a name clash for rphvrrn with the existing NimbusSanL-ReguCond).

In practice, what needs to be done is:

- Open the PFB file in FontForge.

- Use Edit > Select > Select All to select all the glyphs.

- Go to Element > Style to apply the transformation.

- Go to Element > Font Info to set the new name of the font. You may chose the recommended name in the list above (in the "FontForge names" column), or any other name to your liking. The names I changed are Fontname (the PostScript name, such as URWPalladioL-RomaNarr) and "Name For Humans" (its developed version, such as URW Palladio L Roman Narrow).

- Use File > Generate Fonts to convert the result to TrueType format. Select "TrueType (Symbol)" for usyr (the Symbol clone) and "TrueType" for all the other fonts.

Afterward, you will need to edit the associated metrics (defined in /Applications/Textures.app/Contents/Resources/Metrics/NFSS metrics). You can simply do that within Textures in the TeX Metrics window, by editing the name in the "PS fontname" column. For example:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TeX Metrics.png
Type: image/png
Size: 43661 bytes
Desc: not available
URL: <http://email.esm.psu.edu/pipermail/textures/attachments/20120531/1f4727b1/attachment-0003.png>
-------------- next part --------------


Hope that covers everything!

Bruno Voisin

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PSNFSS Transforms.txt
URL: <http://email.esm.psu.edu/pipermail/textures/attachments/20120531/1f4727b1/attachment.txt>


More information about the Textures mailing list