NAME chcmap - produce OpenType files with rearranged character map SYNOPSIS chcmap -osf|-sc|-expert suffix infile outfile DESCRIPTION Chcmap is intended to allow people to use OpenType fonts in programs that don't support OpenType. Such programs can only access the normal Windows character set. They can't get to additional items such as small caps, text figures, etc. The program reads an OpenType font and writes out a modified font, where the character mapping has been altered to let you access different elements. At the moment only three options are supported: OSF (a normal text font with text figures replacing the standard figures), SC/OSF (a font with small caps in place of the lowercase, and a few related changes), and expert (a font that lets you get at various random special characters that are otherwise inaccessible). These three arrangements are common in commercial fonts from Adobe and others. I use essentially the standard arrangement, although my expert fonts don't have quite all the characters of the Adobe ones. (Also, my expert fonts have fixed-width text figures. Since both the OSF and SC/OSF fonts have variable-width text figures, it seemed to make sense to let you access the fixed-width text figures from the expert font.) ARGUMENTS The first argument to the program specifies what characters you want to be able to access. There are currently three values implemented: -osf Variable width text figures moved where you expect the figures to be Minus moved onto the generic currency symbol, 164 -sc Variable width text figures moved where you expect the figures to be Minus moved onto the generic currency symbol, 164 Small caps moved into where the lowercase normally are. Small dollar and ampersand -expert This document should be accompanied by a file expertcharset.pdf. It shows the character set produced by the -expert option in graphical form. Small caps, as in SC/OSF. Small versions of the following, intended for use with small caps: exclamation # $ cent lb yen % 0/00 & ? ! inverted ? ! Small versions of the following accents marks, intend for use with small caps. [] shows where they are. hungarian umlaut ["], ', `, ^, ~, dieresis, breve [copyright], caron [a superior], single dot accent [logical not], macron, ring [degree], agonek [paragraph], cedilla, Raised characters, at the right height and size to be used in the top part of a fraction: figures [Egrave and following, i.e. alt-0200 + number] () , [<] . [>] cent [C] $ [F] - [_] Lowered characters, at the right height and size to be used in the bottom part of a fraction: figures [Ograve and following, i.e. alt-0210 + number] () [[]] , [German SS] . [Thorn] cent [U dieresis] $ [Y acute] - [3 superior] Slightly raised versions of several characters, intended to match text set in all caps: - angle brackets: << >> < > centered dot, en dash, em dash Superior small letters, for things like 1st. On the corresponding caps: a b d i l m o r s t F ligatures: ff [V] fi [W] fl [X] ffi [Y] ffl [Z] The digits are fixed width text digits Other random special characters: one dot leader [+] two dot leader [*] fraction bar [/] monetary colon [{] fitted 1 [|] Rupee [}] minus [generic currency sign] figure dash [2 superior] 1/8, 3/8, 5/8, 7/8 [A grave and following] 1/3, 2/3 [Adieresis and Aring] The -sc option mimicks the normal arrangement of Adobe SC/OSF fonts. The -expert option is very close to the standard Adobe expert sets, but I've added a few things (which required a couple of rearrangements). The second argument specifies a "suffix" for renaming the font. This requires some explanation: In addition to modifying the character map, you also need to change the name of the font. Two fonts can't have the same name. So the modified version needs its own name. The program produces the name automatically by adding a suffix to the family name. I recommend using OSF for OSF fonts, SC for SC fonts, and EXP for expert fonts. Fonts have several different names. The program attempts to handle them all consistently. E.g. Warnock Pro Semibold has a family name of Warnock Pro Smbd, a Postscript name of WarnockPro-Semibold, and a "preferred family" of Warnock Pro. The suffix is added to the "preferred family", resulting in Warnock Pro SC Semibold, Warnock Pro SC Smbd, WarnockProSC-Semibold, etc. If the names aren't consistent, the program should produce an error message. In such a case the program will have to be fixed to handle the pattern of names present in your font. The last two arguments are the input and output file names. The input should normally be a font file directly from Adobe. The output is your new, modified one. EXAMPLE chcmap -expert EXP MyriadPro-Regular.otf MyriadProEXP-Regular.otf ERRORS Most errors will cause the program to abort. However if it is unable to find some of the characters, it ignores them. This allows you to construct an expert font even if base font is missing some of the special characters. The error message will give the hex code of the characters it couldn't find. If you look at the source code, you'll see comments telling you what the various hex values are. CAVEATS This is a proof of concept, not a production-quality program. Thus the author explicitly disclaims all responsibility for what it may do. This program has only been tested on Adobe fonts. It depends upon the specific character codes that Adobe uses for small caps, text figures, etc. Since this is not specified in the Unicode standard, other vendors will almost certainly not make the same choice. The program assumes that obvious ranges, e.g. all lower-case letters, have continguous glyph indices. This is true for the fonts I've tried it with. Nothing is done to the CFF data (i.e. the actual Postscript font definition). The CFF definition has its own names, and a Unique ID. In theory these should all be changed. However in practice it appears that this is not a problem. At least with Windows 2000, the information that actually affects printing seems to come from the OpenType data, not the CFF data. However I make no guarantees. (Editing the CFF data would require at least as much additional work as writing the whole current program. At the moment I don't have time to do that.) OpenType files contain a good deal of information that is specific to the Mac and PC platform. This program only adjusts the PC data. I don't use Macs. Thus any Mac-specific code would be untested. I prefer not to do something than to do it and have it not work. OpenType files have the ability to define font names in multiple languages. The fonts I've tried don't do this. The code for renaming the font will almost certainly not work properly for fonts that use multiple languages for their names. AUTHOR Charles Hedrick, Rutgers University, March 31, 2000 hedrick@nbcs.rutgers.edu