I'm trying to use fonts from the Nitti Basic family for programming. These fonts are packaged as OpenType PostScript OTF files.
Its U+002D (HYPHEN-MINUS) glyph works well as a hyphen, but not so well as a minus. For example, it doesn't line up with the horizontal bar of the plus sign. On the other hand, Nitti's glyph for U+2212 (MINUS) is perfect as a minus (of course), and this is what I need when programming. It's not feasible for me to actually use codepoint U+2212; after all, U+002D is what you get when you press the minus sign on the keyboard and it's what programming languages use for subtraction.
So instead I'd like to steal the glyph from U+2212 and use it for U+002D, so that that character looks like a minus sign.
How can I do it?
Update: Yes, it is possible to use U+002D as a hyphen in source code. As mentioned above, a minus sign is what I need.
For posterity, here's how to do it:
Obtain Adobe's AFDKO font tools and install them.
Put the OTF files into an empty directory.
Run ttx *.otf
to convert the OTF files to TTX (XML).
Edit each TTX file in a text editor:
In the cmap
section, change occurrences of hyphen
to minus
. This table maps characters to glyphs. Character U+002D was originally mapped to the hyphen glyph; this change maps it to the minus glyph.
Over the whole file, change ocurrences of NittiBasic
to NittiBasicM
and Nitti Basic
to Nitti Basic M
. This will distinguish the modified version of the font from the original once it's installed.
Rename the TTX files, replacing Nitti Basic
with Nitti Basic M
.
Run ttx -b *.ttx
to convert the TTX files back to OTF.
Finally, install the newly-created OTF files.