Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to use polyglossia and fontspec.

\usepackage{fontspec}
\setmainfont{Pothana2000}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{telugu}

\begin{document}
\begin{telugu} 
చేయి అనగా మానవులు, కోతులు మరియు లెమూర్లకు గల శరీరభాగమునకు వేళ్లు
కలబాహ్యంగము. కోలా చేతికి ఎదురెదురుగా వున్న రెండు బొటనవ్రేళ్లు వుంటాయి కాబట్టి దాని శరీరభాగాన్ని
కూడా చేయి లేక 'పా'లు అంటారు.
\end{telugu}

It works fine but I can't get English text in here. When put some English content it is not displayed at all. If have to get some English content, I need to use some new font family and the process is really convoluted. I would like the default script be English with whatever default font comes with the LaTeX class I use for a paper and have the Telugu script just for a small paragraph with the Pothana2000 or any other nice font that I can use with XeLaTeX in Windows. Any ideas are much appreciated.

share|improve this question
    
Welcome to TeX.sx! A tip: You can use backticks ` to mark your inline code as I did in my edit. –  Kurt Oct 18 '12 at 17:54
add comment

1 Answer

As far as I know, Pothana2000 has no character for the Latin Script. You should use it only for your Telugu parts. Here how you can do:

\documentclass{article}
\usepackage{kantlipsum}

\usepackage{fontspec}
\newfontfamily\telugufont{Pothana2000}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{telugu}

\begin{document}

\hyphenpenalty=-4000

\kant[2]

\begin{telugu} 
చేయి అనగా మానవులు, కోతులు మరియు లెమూర్లకు గల శరీరభాగమునకు వేళ్లు
కలబాహ్యంగము. కోలా చేతికి ఎదురెదురుగా వున్న రెండు బొటనవ్రేళ్లు వుంటాయి కాబట్టి దాని శరీరభాగాన్ని
కూడా చేయి లేక 'పా'లు అంటారు.
\end{telugu}

\end{document}

The package kantlipsum is used to produce mock English text, while \hyphenpenalty=-4000 serves to induce XeTeX to hyphenate more than usual: don't use them in your document.

Of course you can add

\setmainfont[Ligatures=TeX]{My Beatiful Font}

(where you'd use a real font name) for the English text.

enter image description here

share|improve this answer
    
Thanks a lot for your quick response. The output of the Telugu text in the final pdf is actually not looking that good (it looks like in your output above) compared to what I got when I was using Pothana2000 as the main font using setmainfont. I am not sure how I can show you the corrected pdf output. –  Rama Oct 19 '12 at 23:11
    
Okay this fixed it: \newfontfamily{\telugufont}[Script=Telugu]{Pothana2000}. I just added [Script=Telugu] to the new font family definition. Thanks, again. –  Rama Oct 20 '12 at 5:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.