I would like to use a Multiple Master font with a width axis for the HZ-program (=Herman Zapf Programm, equivalent to the microtype-package of LaTeX)

In standard configuration, ConTeXt (and microtype) stretches fonts horizontally to fit into a line. I want ConTeXt not to stretch the font, but to use different font files with different widths, which I provide. One font file for each width.

What do I have to do to make ConTeXt use my Open Type Fonts instead of stretching?

Multiple Master font for you to test

For this first test, I created 21 instances of a multiple master font (Adobe Serif, comes with Adobe Reader for free) with different widths. The instances are called AdobeSerifMM_400_500.otf to AdobeSerifMM_400_700.otf. The first number in each filename, 400, is the weight, which is constant. The last number is the width, going from 500 (3-7% narrower) over 600 (normal) to 700 (3-7% wider) in +10-steps.

I suppose, I am not allowed to share the fonts, but I can share the way to create them:

  • find and copy zy______.* files from Adobe Reader folder

  • create afm-file with pfm2afm.exe zy______.pfm from the pfm2afm-package from ctan

  • create instances, running width from 500 to 700 mmpfb --weight=400 --width=600 --precision=0 ZY______.PFB > AdobeSerifMM_400_600.pfb with LCDF-Typetools (http://www.lcdf.org/type/)

  • create empty kerning tables t1rawafm.exe < AdobeSerifMM_400_600.pfb > AdobeSerifMM_400_600.afm

  • convert these Type1-fonts to OTF-format. I used http://www.freefontconverter.com/. For the future I plan using offline tools like this: http://www.adobe.com/devnet/opentype/afdko/topic_overview.html

  • now you have Open Type Font Instances of the same font with different widths

FYI: Here are four PDF-files with the four extreme instances of AdobeSerifMM. https://www.dropbox.com/sh/dpi4ok0yl17tchn/4hWB2LwJ9X

  • 2
    I don't know the answer of your question, but why are you converting the fonts to afm files. The standard way to use fonts with ConTeXt is to use OTF fonts directly. – Aditya Nov 11 '13 at 23:17
  • 1
    (1) pdftex/luatex will only find the fonts if their names follow the pattern <font>(+-)<step>, so AdobeSerifMM_400-100.otf through AdobeSerifMM_400.otf (the default) up to AdobeSerifMM_400+100.otf. (2) You also need map entries for each font. (3) I don't know whether it will work with OpenType fonts at all or only with Type 1 fonts. – Robert Nov 12 '13 at 3:42
  • Aditya: Multiple Master Fonts native format is Type1 (AFM/PFB/PFM). So the MM-instances are also Type1. I convert the instances to OTF, so that ConTeXt can use them without further work. So the resulting files are OTF. Robert: Thanks, years ago I found a usenet- or mail-list-thread about ConTeXt, MM and the "+-"-pattern you describe. I cannot find it anymore. I think it worked with Type1-fonts. What kind of mapping is necessary? Do you have a search term for me? – Hanseat Nov 12 '13 at 14:35
  • 1
    It may be worthwhile to ask this question on the context mailing list – Aditya Nov 12 '13 at 21:21
  • 2
    From looking at context's luatex-fonts-ext.lua, it seems that expansion will always be automatic, meaning that your prepared font instances will be simply ignored. A quick test confirms this. So you should indeed ask on the context list and make a feature request. – Robert Nov 13 '13 at 20:28