tipauni-help


Search for: Advanced

Re: [tipauni-help] How to set font just for tipauni?


Hello 孙忠豪,

Thanks for asking a question supported with a minimal
working example.

For characters printed with \textipa command; the hack would
be pretty straight-forward:

--------8<------------------------------------8<--------
\documentclass{article}
\usepackage{fontspec}
\setmainfont{TeX Gyre Termes}
\newfontfamily{\ipafont}{CMU Serif}
\usepackage[preservefont]{tipauni}
\let\oldtextipa\textipa
\renewcommand*{\textipa}[1]{{\ipafont\oldtextipa{#1}}}

\begin{document}
Quack (in TeX Gyre Termes)

\fbox{\textipa{4}} (in CMU Serif)
\end{document}
--------8<------------------------------------8<--------

but for other characters, I am afraid, that there is no
clear solution. I tried something with the following answer,
but didn't succeed:
https://tex.stackexchange.com/a/224585

--------8<------------------------------------8<--------
\documentclass{article}
\usepackage{fontspec}
\usepackage{newunicodechar}
\setmainfont{TeX Gyre Termes}
\newfontfamily{\ipafont}{CMU Serif}
\usepackage[preservefont]{tipauni}
\newunicodechar{ɥ}{{\ipafont ɥ}}
\newunicodechar{ɖ}{{\ipafont\symbol{"0256}}}

\begin{document}
\fbox{ɖ}, \fbox{\textrtaild}
\end{document}
--------8<------------------------------------8<--------

I have added Jonathan Spratte in this email who has
contributed a lot in the development of this package.

@Jonathan can you please help us here? Is it possible to
achieve something like the OP wants with expansion tricks?

Also as far as I have heard, it is generally considered a
bad practice to mix fonts (which is why tipauni doesn't
support it too), so I am not sure what you are trying to
achieve is really advisable or not.

Cheers,
निरंजन

------- Original Message -------
On Saturday, May 28th, 2022 at 1:22 AM, 孙忠豪
<syvshc@xxxxxxxxxxx> wrote:


> Dear sir/madam:
> Thanks for the tipauni package. It makes me typing tipa
> symbols in my unicode document. However I have a template
> which I have to type tipa on it. I can't change the
> template font "TeX Gyre Termes".But this font doesn't
> contain the glyph that tipauni needs, like:

> \documentclass{article}
> \usepackage{fontspec}
> \setmainfont{TeX Gyre Termes}
> % \setmainfont{CMU Serif}
> \usepackage[preservefont]{tipauni}
> \begin{document}
> \fbox{\textrtaild}, \fbox{\textipa{4}}
> \end{document}
>
> it will produce
> [blob:https://mail.protonmail.com/9a4b3058-0ba6-4713-af36-8ac27ab2a712]
>
> so how can I display tipa glyphs without changing the main
> font? Thanks.

JPEG image