3

I have the following TeX file which runs on XeLaTeX:

\documentclass{article}

\usepackage{fontspec}
\usepackage{polyglossia,xltxtra}

\setdefaultlanguage{malayalam}
\setmainfont[Script=Malayalam,Mapping=tex-text]{Rachana}% Downloaded from http://download.savannah.gnu.org/releases/smc/fonts/malayalam-fonts-5.0/Rachana/Rachana.ttf

\begin{document}
ആധുനികവ്യവസായം ലോകകമ്പോളം സ്ഥാപിച്ചിരിക്കുന്നു. അമേരിക്ക കണ്ടുപിടിക്കപ്പെട്ടതാണ് അതിനു് വഴിതെളിയിച്ചതു്. ഈ കമ്പോളം വ്യാപാരത്തിനും കടൽമാർഗ്ഗേണയും കരമാർഗ്ഗേണയുമുള്ള ഗതാഗതത്തിനും വമ്പിച്ച വികസനം നൽകി. ഈ വികാസമാകട്ടെ വ്യവസായത്തിന്റെ വിപുലീകരണത്തെ സഹായിച്ചു. മാത്രമല്ല, വ്യവസായവും വ്യാപാരവും കപ്പൽഗതാഗതവും റെയിൽവേകളും വളർന്ന തോതിൽത്തന്നെ ബൂർഷ്വാസിയും വളർന്നു: അതിന്റെ മൂലധനം പെരുകി; മദ്ധ്യയുഗത്തിന്റെ സന്തതികളായ എല്ലാ വർഗ്ഗങ്ങളേയും അതു് പിന്നോക്കം തള്ളിനീക്കി.
\end{document}

The output looks like:

Output with problem marked

I want to get rid of the hyphen characters appearing at the end of the line. I do not need the hyphen character where a word break into two lines. When I tried the following:

\setmainfont[Script=Malayalam,Mapping=tex-text,,HyphenChar="00]{Rachana} 

the hyphen character disappeared and the output looks fine. Is this a right way?

Jagath
  • 4,287
  • Perhaps "200B (zero width space) is a better choice, if it is in the font. – egreg Jul 17 '13 at 15:50
  • I got this error: 'Rachana' does not contain glyph "200B. I checked the font using fontforge, and "200B is empty for this font. – Jagath Jul 17 '13 at 16:07
  • Not having U+200B is rather bizarre, because it's the easiest glyph to draw! However also other commonly used fonts miss it. – egreg Jul 17 '13 at 17:51

1 Answers1

3

I'd probably prefer using "200B (zero width space); for instance

\documentclass{article}

\usepackage{fontspec}
\usepackage{polyglossia}

\setdefaultlanguage{malayalam}
\newfontfamily\malayalamfont[
  Script=Malayalam,
  Ligatures=TeX,
  HyphenChar="200B,
]{Malayalam MN}

\begin{document}

\emergencystretch=4em % just to avoid overfull boxes

ആധുനികവ്യവസായം ലോകകമ്പോളം സ്ഥാപിച്ചിരിക്കുന്നു. അമേരിക്ക കണ്ടുപിടിക്കപ്പെട്ടതാണ് അതിനു് 
വഴിതെളിയിച്ചതു്. ഈ കമ്പോളം വ്യാപാരത്തിനും കടൽമാർഗ്ഗേണയും കരമാർഗ്ഗേണയുമുള്ള ഗതാഗതത്തിനും 
വമ്പിച്ച വികസനം നൽകി. ഈ വികാസമാകട്ടെ വ്യവസായത്തിന്റെ വിപുലീകരണത്തെ സഹായിച്ചു. മാത്രമല്ല, 
വ്യവസായവും വ്യാപാരവും കപ്പൽഗതാഗതവും റെയിൽവേകളും വളർന്ന തോതിൽത്തന്നെ ബൂർഷ്വാസിയും വളർന്നു: 
അതിന്റെ മൂലധനം പെരുകി; മദ്ധ്യയുഗത്തിന്റെ സന്തതികളായ എല്ലാ വർഗ്ഗങ്ങളേയും അതു് പിന്നോക്കം 
തള്ളിനീക്കി.

\end{document}

produces

enter image description here

However Rachana hasn't this glyph, although it's the easiest one to draw. In this case, it seems that HyphenChar="00 is good as well.

\documentclass{article}

\usepackage{fontspec}
\usepackage{polyglossia}

\setdefaultlanguage{malayalam}
\setmainfont[
  Script=Malayalam,
  Ligatures=TeX,
  HyphenChar="0,
]{Rachana.ttf}

\begin{document}

ആധുനികവ്യവസായം ലോകകമ്പോളം സ്ഥാപിച്ചിരിക്കുന്നു. അമേരിക്ക കണ്ടുപിടിക്കപ്പെട്ടതാണ് അതിനു് 
വഴിതെളിയിച്ചതു്. ഈ കമ്പോളം വ്യാപാരത്തിനും കടൽമാർഗ്ഗേണയും കരമാർഗ്ഗേണയുമുള്ള ഗതാഗതത്തിനും 
വമ്പിച്ച വികസനം നൽകി. ഈ വികാസമാകട്ടെ വ്യവസായത്തിന്റെ വിപുലീകരണത്തെ സഹായിച്ചു. മാത്രമല്ല, 
വ്യവസായവും വ്യാപാരവും കപ്പൽഗതാഗതവും റെയിൽവേകളും വളർന്ന തോതിൽത്തന്നെ ബൂർഷ്വാസിയും വളർന്നു: 
അതിന്റെ മൂലധനം പെരുകി; മദ്ധ്യയുഗത്തിന്റെ സന്തതികളായ എല്ലാ വർഗ്ഗങ്ങളേയും അതു് പിന്നോക്കം 
തള്ളിനീക്കി.

\end{document}

enter image description here

Note, however, that this doesn't seem to work with LuaLaTeX.

egreg
  • 1,121,712