Discussion:
[XeTeX] problem rendering unicode Devanagari dependent vowel signs in a different color
ShreeDevi Kumar
2018-03-26 10:23:47 UTC
Permalink
I was recently asked

To make study materials for my students I want to change different colors
for svaramatra. I used this one - à€•à¥ + à€‡ = à€•{\color{blue}à€¿} but the letter
not combines together How it is possible in latex.
I haven't been able to figure out a way to do it in xelatex.

Here is an MWE,

-------

\documentclass[11pt]{article}

\usepackage{polyglossia}

\usepackage{color}

\newfontfamily\hindifont [Script=Devanagari]{Jaipur Unicode NFLC}

\begin{document}

\hindifont{

à€•à¥ + à€‡ = à€•{\color{blue}à€¿} = à€•à€¿

}

\end{document}

-------

hope to get some suggestions on how to get the letter be one color and
Devanagari dependent vowel sign in another color and render correctly.
Zdenek Wagner
2018-03-26 11:19:05 UTC
Permalink
Hi,

I am afraid that this is impossible. \color inserts aa expandable command
of a main processor which must not be used inside a word.
This means that in the TeX's eyes the matra is a part of another word and
must not be connected. You have to do it manually.

Try this in your file and see the difference for I and U:

\hindifont{

à€•à¥ + à€‡ = à€•{\color{blue}à€¿} = à€•à€¿ = \textcolor{blue}{à€¿}à€•

à€•à¥ + à€‰ = à€•{\color{blue}\kern-.15em ु} = à€•à¥ = \textcolor{blue}{ु}à€•

}

Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz
Post by ShreeDevi Kumar
I was recently asked
To make study materials for my students I want to change different colors
for svaramatra. I used this one - à€•à¥ + à€‡ = à€•{\color{blue}à€¿} but the letter
not combines together How it is possible in latex.
I haven't been able to figure out a way to do it in xelatex.
Here is an MWE,
-------
\documentclass[11pt]{article}
\usepackage{polyglossia}
\usepackage{color}
\newfontfamily\hindifont [Script=Devanagari]{Jaipur Unicode NFLC}
\begin{document}
\hindifont{
à€•à¥ + à€‡ = à€•{\color{blue}à€¿} = à€•à€¿
}
\end{document}
-------
hope to get some suggestions on how to get the letter be one color and
Devanagari dependent vowel sign in another color and render correctly.
--------------------------------------------------
http://tug.org/mailman/listinfo/xetex
ShreeDevi Kumar
2018-03-26 12:00:01 UTC
Permalink
Thank you so much for your prompt reply and solution to the problem.

I am attaching the MWE and pdf output using \textcolor.

Appreciate your help.
Post by Zdenek Wagner
Hi,
I am afraid that this is impossible. \color inserts aa expandable command
of a main processor which must not be used inside a word.
This means that in the TeX's eyes the matra is a part of another word and
must not be connected. You have to do it manually.
\hindifont{
à€•à¥ + à€‡ = à€•{\color{blue}à€¿} = à€•à€¿ = \textcolor{blue}{à€¿}à€•
à€•à¥ + à€‰ = à€•{\color{blue}\kern-.15em ु} = à€•à¥ = \textcolor{blue}{ु}à€•
}
Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz
Loading...