# Is it possible to make TIPA's fonts available to fontspec?

I've finally accepted that it's not worth trying to use TIPA with fontspec, however, I do like its font. Specifically, I wish to continue using Latin Modern/Computer Modern as much as possible and, naturally, I don't really want a separate font for IPA. Worse still, there are some glyphs that simply aren't available in Latin Modern, Computer Modern, or even Computer Modern Unicode, such as the m̐, that's:

As you can see, TIPA does have the character. Computer Modern Unicode, however, does not. The "combining candrabindu" character has Unicode codepoint U+0310 and, as you can see, this codepoint is greyed out in the cm-unicode font table. (The full glyph is properly formed from a bog standard m and U+0310 combining candrabindu.)

So, suppose I forget the TIPA package and throw out the T3 encoding, can I at least use the font, either in its original metafont form, or perhaps by converting it to .TTF format?

Obviously throwing out the T3 encoding will be a not inconsiderable headache, seeing as how the glyphs will be difficult to access and the input file will likely be a mess. My input file is already a mess, though, because of the Sanskrit font I'm using, which has all of the tasty stuff in the private use area, Unicode not being ideal for Vedic Sanskrit, so I can live with that.

(Willing to accept alternative solutions, but not too willing to sacrifice Latin/Computer Modern (Unicode))

If anybody would like something to play about with, this will get TIPA to produce a m̐:

\documentclass[12pt]{article}
\usepackage{tipa}

\begin{document}

\textipa{\textdotbreve{m}}

\end{document}


And this

\documentclass[12pt]{article}
\usepackage{fontspec}
\setmainfont{cmunrm.otf}

\begin{document}

m̐

\end{document}


Will produce an m with a box next to it.

Attempting to mix TIPA with fontspec will ... will not go well.

• And your minimal example is...? – cfr Dec 10 '15 at 0:36
• Well, I wasn't really sure what kind of MWE I could supply when asking for a way to convert TIPAs fonts to .TTF, or have fontspec use them directly (I believe the answer in this case is usually convert them to .TTF. Unfortunately, the T3 encoding appears to me to make that more difficult). But as I'm often to be found around the site asking for MWEs, I've given something to experiment with – Au101 Dec 10 '15 at 0:48
• You could give an MnWE instead i.e. I'd like this to work, but it doesn't.... – cfr Dec 10 '15 at 0:50
• Sadly, I believe I already know from this that what I would like to work isn't going to work. I should have linked to that question in the first place, really, sorry about that. But the solution there is: use computer modern unicode, TIPA won't play with fontspec. But cm-unicode does not have everything I need. So, I need either to abandon computer modern (and friends), or make TIPA's fonts work with fontspec, and that's an under the bonnet font-y kind of a job, rather than a LaTeX code sort of a job – Au101 Dec 10 '15 at 0:54
• Sorry, but I'm not seeing much development going on in the CMU fonts. :( Would typing \dotbreve{m} be good? – egreg Dec 10 '15 at 0:54

You can fake the accent (until you're able to convince the maintainers of cm-unicode into adding it to the fonts).

\documentclass{article}
\usepackage{fontspec}
\setmainfont{cmunrm.otf}

% breve=02D8
% dot=02D9

\DeclareRobustCommand{\dotbreve}[1]{%
\begingroup
\sbox0{#1}%
\sbox2{\ooalign{\hidewidth^^^^02d8\hidewidth\cr\kern-0.025em^^^^02d9\cr}}%
\ooalign{%
\hidewidth\raisebox{\dimexpr\ht0-1ex}{\box2}\hidewidth\cr
\box0\cr
}%
\endgroup
}

\begin{document}

\dotbreve{m}\dotbreve{g}\dotbreve{A}

\end{document}


Alternative solution: use another font just for the accent glyph.

\documentclass{article}
\usepackage{fontspec}
\setmainfont{cmunrm.otf}
\newfontfamily{\altaccentfont}{FreeSerif}

\DeclareRobustCommand{\candrabindu}[1]{{%
\edef\currentfont{\the\font}%
\altaccentfont\accent"0981\currentfont#1%
}}

\begin{document}

\candrabindu{m}\candrabindu{g}\candrabindu{A}

\end{document}


You may prefer U+0310 from Linux Libertine

\documentclass{article}
\usepackage{fontspec}
\setmainfont{cmunrm.otf}
\newfontfamily{\altaccentfont}{Linux Libertine O}

\DeclareRobustCommand{\candrabindu}[1]{%
{\edef\currentfont{\the\font}\altaccentfont\accent"0310\currentfont#1}%
}

\begin{document}

\candrabindu{m}\candrabindu{g}\candrabindu{A}

\end{document}


• Don't expect to see any requests being implemented. Straight from the horse's mouth: "the development of the fonts is stopped and no further versions are expected". – Sverre Dec 10 '15 at 11:42
• the first example you show is the nicest (in my opinion) except for two things: the dot is too large, and it is lower than ideal. if you could smallify the dot while keeping it centered horizontally with the top at the same level as the top of the larger dot, it would be very much nicer. – barbara beeton Dec 10 '15 at 15:01
• I'm just wondering if it's possible to adapt the last part of your answer here (using Linux Libertine O for the accent) for use with italics. I've found the approach works well if I set the main font to be an italic font, but if I instead set up a specific italic font, issue \itshape and then, later, use the \candrabindu command, the accent is quite off centre – Au101 Dec 14 '15 at 1:10
• @Au101 Using accents from different fonts has this problem, I'm afraid. – egreg Dec 14 '15 at 1:18
• I thought you'd say that. \DeclareRobustCommand{\cb}[1]{% {\edef\currentfont{\the\font}% \upshape\altaccentfont\accent"0310\currentfont#1}% } works quite well, but I'm not sure how sinful it is :P – Au101 Dec 14 '15 at 1:24
\documentclass{article}
\usepackage{fontspec}
\setmainfont{cmunrm.otf}
\newfontface\LL{Linux Libertine O}
\def\dbm#1{{\LL#1\char"0310}}

\begin{document}
main font CM

\dbm{m}\dbm{g}

\end{document}


• This is just using a different font that has the combining character. But the OP explicitly says he doesn't want to use a different font. – Sverre Dec 10 '15 at 11:44
• "(Willing to accept alternative solutions, but not too willing to sacrifice Latin/Computer Modern (Unicode))" ... He was talking about CM! – user2478 Dec 10 '15 at 12:02
• Yes? Libertine is not CM. TIPA is. That's why he wants to use the TIPA glyphs with CM. – Sverre Dec 10 '15 at 12:04
• Ah yes, I read it the other way round. Will provide an alternative solution. – user2478 Dec 10 '15 at 12:06
• @Sverre: and done ... – user2478 Dec 10 '15 at 12:10