8

I'm trying to type the phonetic transcription of some words with tipa but it's not compiling correctly and the glyphs don't show up. Here's a MWE of my code compiled with LuaLaTeX:

\documentclass[11pt,a5paper]{book}

\usepackage{geometry}
    \geometry{
        includehead = true,
        headheight = 15pt,
        includefoot = true,
        inner = 1.5 cm,
        outer = 1 cm,
        top = 1.5 cm,
        bottom = 1.5 cm,
    }

\usepackage{fontspec}
    \setmainfont{GaramondPremrPro}[
        Extension = .otf,
        UprightFont = *,
        BoldFont = *-Bd,
        ItalicFont = *-It,
        BoldItalicFont = *-BdIt,
        ]

\usepackage{polyglossia}
    \setdefaultlanguage{english}
    \disablehyphenation
\usepackage{tipa}

\begin{document}

In the bigynnyng god made of nouȝt\footnote{Nouȝt: nought /\textipa{n\textopeno :t}/} heuene and erthe.

\end{document}

The error that occurs is the following:

Font \T3/cmr/m/n/9=tipa9 at 9pt not loadable: metric data not found or bad. ...e{Nouȝt: nought /\textipa{n\textopeno :t}/}

Font shape `T3/GaramondPremrPro(0)/m/n' undefined(Font) using `T3/cmr/m/n' instead

Some font shapes were not available, defaults substituted.

Is that a way to make it compile properly or change the font used in textipa to computer modernor something similar? I need to get the right symbols for the phonetic transcriptions.

Levy
  • 1,167
  • 7
    Better avoid the tipa package with luatex and use a font which has the needed glyphs. See e.g. https://tex.stackexchange.com/a/249260/2388. – Ulrike Fischer Jul 08 '19 at 15:49
  • 7
    Whoever has downvoted this question, please either comment as to why or retract your vote. This seems like a perfectly well-formed question: it has a MWE, and an error message. What else could make it clearer? – Alan Munn Jul 08 '19 at 17:58
  • The real problem here is not tipa in a Unicode engine but a problem with your local installation – Frank Mittelbach Jul 11 '19 at 21:14
  • @UlrikeFischer the issue you cite from 2015 works perfectly for me ... I think this was early days fontspec ... – Frank Mittelbach Jul 11 '19 at 22:00
  • 1
    @FrankMittelbach I didn't link to an issue, only to an answer showing how to use unicode fonts for this. Beside this: the main problem with tipa in T3 is that it doesn't copy&paste correctly. E.g. /nᴐ:t/ copies at /nO:t/. In the back of my mind I'm always thinking about accessibility and the necessity to get correct unicode. – Ulrike Fischer Jul 11 '19 at 22:19
  • @UlrikeFischer agreed accessibility is an issue, but so is \tone which depending on use case can be an essential feature that tipa (but not unicode fonts by themselves) offers – Frank Mittelbach Jul 12 '19 at 08:36
  • @FrankMittelbach one can get around the cut and paste problem (at least in luatex) with \pdfglyphtounicode, but at least for the standard tipa fonts this means mapping ascii: \pdfglyphtounicode{O}{1D10} as the type1 fonts don't use sensible glyph names. So if autoinst now supports T3 (I wonder who triggered this ....) one should check if this leads to better glyph names. – Ulrike Fischer Jul 12 '19 at 08:46

2 Answers2

6

Since you’re using fontspec, instead of loading tipa, you should select a Unicode font that supports IPA. If you can use fontspec, you no longer need the legacy package tipa. If you have a lot of data transcribed in \textipa format, consider using a script to auto-convert it. You can enter your IPA symbols as UTF-8, using the input method of your choice, or a character map. In fact, you can do this in LaTeX 3 even if you use the tipa fonts.

You could simply pick a main font that has IPA symbols, but here is an example of switching to a supplementary font.

\documentclass{article}
% Changed the geometry to fit in a TeX.SX MWE
\usepackage[paperwidth=10cm, paperheight=4cm]{geometry}

\usepackage{fontspec}
    \defaultfontfeatures{Scale = MatchLowercase}
    \setmainfont{EB Garamond}[Scale=1.0]
    \newfontfamily\ipafont{Charis SIL}

\usepackage{polyglossia}
    \setdefaultlanguage{english}
    \disablehyphenation

\DeclareTextFontCommand\textphonetic{\ipafont}

\begin{document}

In the bigynnyng god made of nouȝt\footnote{Nouȝt: nought \textphonetic{/nᴐ:t/}}
heuene and erthe.

\end{document}

Garamond/Charis font sample

Here, I matched Garamond to Charis SIL (which is actually based on Bitstream Charter). Other free fonts that contain IPA symbols include Doulos SIL (matching Times), Andika, Gentium Plus and DejaVu Sans. The Unicode clone of Computer Modern that does is CMU Serif. Many commercial fonts now do as well.

An alternative to defining a \textphonetic is to use ucharclasses to automatically load a different font family for IPA symbols. This package has been abandoned for years, however, and only works in XeTeX. If you’re really turning hyphenation off, I would strongly recommend you compile in LuaLaTeX and \usepackage{microtype} to get font expansion. This will improve your word spacing immensely.

I don’t recommend it, but: should you want to keep using tipa commands, you can look up their Unicode values and patch them in individually.

\newcommand\textopeno{{\ipafont\symbol{"1D10}}}

or more simply, to use the currently-selected font

\newcommand\textopeno{ᴐ}

Technically, it is possible (in theory) to keep using the legacy tipa encoding in the same document as Unicode using luainputenc, but if I said anything more about that, poor Ulrike Fischer might have a heart attack. And she doesn’t deserve that.

PS

Frank Mittlebach correctly adds to my answer that the reason you’re getting this error is that tipa does not appear to be properly installed. The T3 Computer Modern Roman font that your TeX engine is looking for as a fallback ought to be installed on TeX Live 2019, but isn’t being found.

Even so, I highly recommend using Unicode over the legacy 8-bit encoding. The advantages include the ability to enter IPA symbols in your source file, and to copy, paste and search your PDF.

Based on a comment from him, the following workaround answers your literal question, which was how to use the 8-bit cmr font from tipa with fontspec. I don’t recommend it.

\documentclass{article}
% Changed the geometry to fit in a TeX.SX MWE
\usepackage[paperwidth=10cm, paperheight=4cm]{geometry}

\usepackage{tipa}
\usepackage{fontspec}
    \defaultfontfeatures{Scale = MatchLowercase}
    \setmainfont{EB Garamond}[Scale=1.0, NFSSFamily = cmr]

\begin{document}

In the bigynnyng god made of nouȝt\footnote{Nouȝt: nought \textipa{/n\textopeno :t/}}
heuene and erthe.

\end{document}

enter image description here

As of July 2019, the font families this works with on CTAN are cmr, cmss, cmtt, phv and ptm, but more are in the pipeline now that it’s possible to make T3 fonts from OpenType fonts automatically. You could produce a T3 font from an OpenType font locally—but there is literally no reason whatsoever to go through that rigmarole if you have the Unicode font and are already using fontspec. (The only conceivable reason to ever do this is to work around the requirements of a site that only accepts 8-bit encodings but allows you to supply your own 8-bit fonts. Someday soon, I hope, those sites will catch up to this century.) You would need more work to enable UTF-8 IPA symbols in your input this way as well.

Davislor
  • 44,045
4

Despite all the statements in the comments and the other answers, the actual reason for the problem is not that a "legacy" package is used with LuaLaTeX it is simply that the installation of the OP has a problem.

Font \T3/cmr/m/n/9=tipa9 at 9pt not loadable: metric data not found or bad

If this line shows up then either the metric file for tipa9 is bad or it is missing. So my guess is that the same problem would appear if tipa is being used with pdftex. I don't have GaramondPremPro so can't exactly reproduce the example but simplying it and using EB Garamond works perfectly for me in either LuaLaTeX or XeLaTeX.

The second line (a warning)

Font shape T3/GaramondPremrPro(0)/m/n' undefined(Font) usingT3/cmr/m/n' instead

probably came first, because what it says is that the requested encoding T3 is not available for the current font and so T3/cmr/m/n was used instead (and then that one had a ftm problem resulting in the error above.

The third one simply reiterates that some font substitution happened because the Garamond font wasn't available in T3 but only in TU and therefore a different font got selected for the IPA chars (or not because of the local problem).

So basically if you use the tipa package you get IPA chars in Computer Modern unless you change something, but you can change to other fonts because there are other fonts available with T3 encoding and there will probably soon a few more as autoinst now supports that encoding as well.

So as an example:

\documentclass[11pt]{book}

\setlength\textheight{3cm}

\usepackage{fontspec}
\setmainfont{EB Garamond}

\usepackage{tipa}

\begin{document}

In the bigynnyng god made of nouȝt\footnote{Nouȝt: nought /\textipa{n\textopeno :t}/} heuene and erthe.


Alternative settings:

\renewcommand\tipaencoding
   {\fontencoding{T3}\fontfamily{ptm}\selectfont}

Or\footnote{Nouȝt: nought /\textipa{n\textopeno :t}/} heuene and erthe.

\renewcommand\tipaencoding
   {\fontencoding{T3}\fontfamily{LinguisticsPro-LF}\selectfont}


Or\footnote{Nouȝt: nought /\textipa{n\textopeno :t}/} heuene and erthe.

\end{document}

gives

enter image description here

People suggested that using a Unicode engine means you should not use tipa (or can't) but it is simply not true. There is nothing wrong with using a otf font that does have IPA symbols included. However, tipa gives you an input syntax that in many cases is quite concise and may be easier to input than direct unicode symbols. You also may have older texts or texts that need to work with all engines. A possible area where tipa offers support that you don't get otherwise are \tone indicators. Maybe they are in Unicode but I think not. So if that is neded then ...

Don't forget that under the hood fontspec is simply calling NFSS and the different encodings do work nicely side by side.

Finally T3 is a font encoding so it has nothing to do with using luainputenc --- that is a red hering in the otherwise nice answer from @Davislor, both worh perfectly side by side.

  • You would use luainputenc or some other package such as ucharclasses or newunicodechar to be able to read the Unicode characters, rather than type \textopeno, etc. – Davislor Jul 11 '19 at 22:53
  • As I wrote, tipa can work in LuaLaTeX. It’s just best practice not to use it. I’m sorry if I confused anyone into thinking otherwise. – Davislor Jul 11 '19 at 22:57
  • @Davislor sorry, no the "error" is that his installation has a broken tfm. That it can't find a certain combining of encoding/family/series/shape and somehting gets substituted happens in NFSS all the time and is just normal practice. you would get the same if you load any font other than CM in pdftex and use tipa. I agree that if you want to input IPA unicode chars then tipa would be the wrong choice but if you want its input method or the \tone feature thats different. So best practise kind of depends on your use case I would say. Downside of tipa is certainly the cut-n-paste restriction. – Frank Mittelbach Jul 12 '19 at 06:58
  • Okay, I see what you mean now. TIPA should include a t3cmr.fd, which appears to be missing. – Davislor Jul 12 '19 at 07:11
  • @Davislor more precisely it switched to T3/cmr then loaded t3cmr.fd but then couldn't open the tfm for tipa9 for some reason (which is the local installation issue). By the way, just as an example: \setmainfont{Linguistics Pro}[NFSSFamily=LinguisticsPro-LF] would use Linguistics Pro for text and switch for tipa to T3 in the same font without any substitutions happening. I think what remains is that using tipa means cut and paste from the resulting document will not work, guess I should mention that more exlicitly as a downside in my answer. – Frank Mittelbach Jul 12 '19 at 08:33
  • I think the workaround would be useful information. I’ll update my answer. – Davislor Jul 12 '19 at 13:58
  • I do want to clarify that I never said you can’t use tipa together with fontspec, and in fact I thought I’d clearly said you can work around the bug. (And I do consider falling back to cmr because the package told it to load a font that doesn’t exist a bug.) I just recommend the other approach. – Davislor Jul 12 '19 at 14:03
  • When I try LinguisticsPro-LF on TeX Live 2019, it does not work for me. The only available T3 fonts on CTAN are cmr, cmss, cmtt, phv and ptm. – Davislor Jul 12 '19 at 14:22
  • @Davislor it arrived only fairly recently so you need to run update in TL to get it. As I said I expect more fonts to show up for pdftex users with T3 encoding support as autoinst now supports that encoding in addition to those for Greek and Cyrilic – Frank Mittelbach Jul 12 '19 at 17:14
  • Ah! Thank you. That’s good to know. DejaVu Sans and Gentium are two other obvious ones. – Davislor Jul 12 '19 at 17:54