# [luatex] fontspec prevents hyphenation

Ulrike Fischer luatex at nililand.de
Tue Nov 23 16:08:21 CET 2010

Am Tue, 23 Nov 2010 10:22:48 +0100 schrieb Mojca Miklavec:

>> In the attached example, the word 'Deutschland' is hyphenated before the
>> last letter when wrapped-up in guillemots.  For German patterns
>> \righthyphenmin is 2, but that shouldn't include guillemots. Hyphenation is
>> correct when there are German quotes or no quotes at all.  The error happens
>> with or without fontspec.

> black box of macros (also known as babel).
> I have no idea how to
> switch to an OpenType font in plain LuaTeX (please add that command)
> and try to test the following in plain LuaTeX:
>
> \uselanguage{ngerman}
>
> \newdimen\savehsize
> \savehsize\hsize
> \def\test#1{\endgraf\hsize=3pt\noindent #1\endgraf\hsize=\savehsize}
>
> \test{x «Deutschland»}
> \test{x „Deutschland“}
>
> \bye

I can't test this as ngerman is unknown to plain luatex (and I have
no idea how to enable it).

>
> There also exists a "plain command" to switch to particular language
> in LaTeX without babel or polyglossia, but I need some time to find
> out how exactly to do it (help welcome). You need to test that before
> a bug in LuaTeX is confirmed.

I tested this example

\documentclass{article}
%\usepackage{fontspec}
\begin{document}
\makeatletter \bbl at patterns{ngerman}

\showhyphens{Deutschland^^^^00bb}

\righthyphenmin=2

\showhyphens{Deutschland^^^^00bb}

\end{document}

It uses internally the hyphen.cfg from luatex/hyph-utf8.

LuaTeX adaptation of babel <v3.8l-luatex-1.4> and hyphenation

It doesn't matter if I load fontspec or not. In also didn't matter
if luatex-unicode-letters.tex was loaded or not. In all cases the
second \showhyphen (with \righthyphenmin = 2) is wrong:

[][] \OT1/cmr/m/n/10 Deutsch-lan-dÂ»

I also looped through quite a lot "end chars". As far as I can say
only chars in the range up to position 255 are problematic.

> Polyglossia needs to be ported to LuaTeX at some point ... using Babel
> is only calling for troubles.

Well for the current question there is not much difference between
both packages. Both use the same hyphen.cfg and I get the same
hyphenation (if I ignore the error messages about unknown commands).

--
Ulrike Fischer