# Is there a way to determine if a character exists in a font in a macro?

I'd like to make an `\interrobang` macro for my personal package of useful macros that prints the character `‽` (otherwise known as interrobang). However, some fonts don't have this character, and in that case I'd like to silently fall back to printing simply `!?`. Is there a way to do this?

What I get when I type the Unicode character in a macro and then use the macro in the document when the character is not available is:

``````! Undefined control sequence.
\u-default-8253 #1->\textinterrobang
``````
• – Alan Munn Oct 17 '16 at 15:17
• The u-default-xxx naming that you are using is non standard so you are presumably using some contributed package to set up characters. The answer will depend on that package mostly. – David Carlisle Oct 17 '16 at 15:17
• @DavidCarlisle: The only packages I'm using are: memoir (documentclass), [utf8x]{inputenc}, [T1]{fontenc}, mathpazo, berasans, microtype, tabularx, and my own package of macros (which does not itself load any packages). And I defined the interrobang macro as `\newcommand{\interrobang}{‽}. What in there might be causing the nonstandard notation? – scorchgeek Oct 17 '16 at 15:23
• yes it's utf8x (I'd use the standard utf8 unless there is something that really doesn't work in that case) (although `utf8x` is called as a package option to `inputenc` it is effectively a completely different package that redefines most of the original – David Carlisle Oct 17 '16 at 16:08
• It turned out that the OP’s problem was actually another one, but the sheer answer to the question as it is asked in the title is: exploit the `\iffontcher` conditional provide by e-TeX. – GuM Oct 17 '16 at 18:48

``````\providecommand\textinterrobang{!?}
then the error will go, and if any other font package defines this command to access a character in a font then `\providecommand` will do nothing.