4

I have used the following setup to typset Telugu text using polyglossia and xelatex. But the quotes seem to be broken. They appear as typed in the source and are not transformed to the curly ones (as done by latex). I tried using csquotes, but in vain. As the characters corresponding to Latin set were not rendered using the font in my language, I put a small block of code (taken from tex.stackexchange.com) to render them with an English font. Is this by any chance the cause of the problem? If it is, then what is the workaround?

\documentclass{article}

%The following makes Telugu the default language of the document, 
%while setting English as the other language. 

%"Lohit Telugu" and "Cantarell" fonts can be substituted with your favorite ones.

\usepackage{polyglossia}
\setmainlanguage{telugu}
\setmainfont{Lohit Telugu}
\setotherlanguage{english}
\newfontfamily{\TelSubstFont}{Cantarell}


%The following is a workaround to substitute the font or default latin characterset
%with an English one, since none of the current Telugu fonts contains that set.

\XeTeXinterchartokenstate=1
\newXeTeXintercharclass\TelSubst

\count255="0000
\loop\ifnum\count255<"007F
  \XeTeXcharclass\count255=\TelSubst
  \advance\count255 by 1
\repeat

\XeTeXinterchartoks 0 \TelSubst = {\begingroup\TelSubstFont}
\XeTeXinterchartoks 255 \TelSubst = {\begingroup\TelSubstFont}
\XeTeXinterchartoks \TelSubst 0 = {\endgroup}
\XeTeXinterchartoks \TelSubst 255 = {\endgroup}


\begin{document}

తెలుగు భారత దేశము లోని దక్షిణ ప్రాంతములోని `ఆంధ్రప్రదేశ్' రాష్ట్ర అధికార భాష. భారత దేశం లో తెలుగు మాట్లాడే 
7.4 కోట్ల (2000 సంవత్సరపు లెక్కలు) జనాభాతో ప్రాంతీయ భాషలలో మొదటి స్థానం లోవుంది. ప్రపంచంలోని ప్రజలు  
అత్యధికముగా మాట్లాడే భాషలలో పదమూడవ స్థానములోనూ, భారత దేశములో హిందీ తర్వాత రెండవ స్థానములోను 
నిలుస్తుంది. 1997 లెక్కల ప్రకారం ప్రపంచవ్యాప్తంగా 6.97 కోట్లు మందికి పైగా మొదటి భాషగా మాట్లాడతారు. అతి
ప్రాచీన దేశ భాషలలో సంస్కృతము, తమిళములతో బాటు తెలుగు భాషను అక్టోబరు 31, 2008న భారత ప్రభుత్వము 
చేర్చింది.

\end{document}
4
  • I'd try \newfontfamily{\TelSubstFont}[Ligatures=TeX]{Cantarell}
    – egreg
    Jun 19, 2012 at 10:25
  • Awesome! I tried that earlier but with Telugu font. Now it makes sense. Thanks a ton!! Jun 19, 2012 at 10:27
  • I'll edit the question to show the solution. Jun 19, 2012 at 10:27
  • @Alenanno Ah, ok! Jun 19, 2012 at 10:33

1 Answer 1

5

The quotes are in the "ASCII" block of Unicode, so with your setting they are taken from the \TelSubstFont:

\newfontfamily{\TelSubstFont}[Ligatures=TeX]{Cantarell}

will take care of the substitutions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .