I'm using Tex with Telugu and English languages. When a word is hyphenated, the hyphen symbol, as apparently is not found in Telugu font, appears as undefined symbol. I want to change it's font to English hoping it would then appear properly. This is what I do for many other symbols in default Latin set.

This is what preamble in my tex file looks like.

\documentclass[12pt, a4paper, onecolumn]{book}
\setmainfont{Lohit Telugu}

%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.
\newfontfamily{\TelSubstFont}[Ligatures=TeX]{Lucida Grande}



  \advance\count255 by 1

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

Here's the output:

  • I guess that the hyphen is inserted at a later stage than the work performed by the "interchartoken" procedure. Isn't there a hyphenation character in Telugu? – egreg Jun 21 '12 at 15:52
  • We use it. But unfortunately, in the font I want to use, it is not defined. Is there any workaround? – gopalkoduri Jun 21 '12 at 15:54
  • I'm afraid you have to change font or add the hyphen to it. – egreg Jun 21 '12 at 15:56
  • That is sad :( I'm not aware of how to do it, if I don't find it, I'll post a question. – gopalkoduri Jun 21 '12 at 16:03

I'm afraid that the hyphen is inserted at a later stage than the work performed by the "interchartoken" procedure. So if the font hasn't a hyphen, there's nothing you can do.

The hyphen doesn't necessarily be in the normal position:

\setmainfont[HyphenChar={xyzt}]{Lohit Telugu}

will make the character in position U+xyzt (four or more hexadecimal digits) the one used for hyphenation.

  • Thanks, to confirm: if the font doesn't have a proper hyphen glyph, there is no way to use a different font for hyphens? I ran into such a font just now in this answer. – ShreevatsaR Mar 6 '17 at 11:42
  • 1
    @ShreevatsaR Unfortunately, not. Maybe a workaround can be found in LuaTeX. – egreg Mar 6 '17 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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