Why are you doing that at all? It’s a dangerous practice because the hyphen has so many different uses. It could easily lead to a lot of frustration and/or confusion on the part of the end user, especially anyone using basic word-processing products.
It’s just for a little university project where I’m doing “logic” substitutions for a phonetic alphabet. The hyphen is the closest thing to a macron and when typing a hyphen and a letter, I want it to be the letter-with-macron-ontop.
I know it’s not a good practice, but I just wonder about the behaviour of MS Word and why it would work in all other applications. It doesn’t work on Word (win) and Word (mac)
There are many things that don’t work in Word compared to professional-level products such as InDesign.
My guess about why the hyphen doesn’t work in Word may have to do with how the programmers at Microsoft viewed hyphen usage along with how diacritical characters are normally accessed.
They likely never envisioned someone attempting to do what you are doing, i.e. programming a feature to make a diacritical character appear when keyboarding it in the manner one would expect of a ligature.
I think the hyphen is likely considered a special type of character given its uses – and the way different people use it, so you may never get it to work as you desire.
@George Thomas How’d I do that? Can you give me an example?
I’m building combinations of characters with their diacritics so the fit perfectly on top of the character. That’s why I completely subsitute the combination with a new glyph.
It varies. I’m on a mac, however the font substitutions should also work on Windows. And it does. Everything seems to work just fine, only the hyphen doesn’t.
@mekkablue I’m already considering ditching Word. I just wonderd why it wouldn’t work when everything else works.
I’d second what Tosche said. This is a problem that should not be solved with a font hack but by finding an input method. Handling this with a font hack is dirty and will probably cause you problems some day. Try to work with the technology, not against it.
@sepp88: You would make a macron from a hyphen by creating a new glyph named “macron”, copy/paste the hyphen into that window and adjust it for position. You then use that glyph to make all the composite characters that use the macron. The Glyphs manual should be more help to you with all the details. There’s more to it than what I’ve written here, and this really isn’t the place to go into the full details.
Then, regarding your method of input: The right way to do it is make the actual glyph rather than depending upon keyboarding every element. Then access the glyph through the various apps’ glyphs panels or whatever they may be called. Much easier and far more accurate.
You would type them using the correct keyboard commands or use the character palette of the app or the system. Then you either rely on mark positioning (using anchors) or build precomposed glyphs and substitute them in the ccmp feature. But you will need to keep the input text correct. Everything else will break searching, layout and will haunt you later.