Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

fontloader error when trying to mix LRT/RTL text in paragraphs #349

Closed
ralessi opened this issue Apr 30, 2016 · 13 comments
Closed

fontloader error when trying to mix LRT/RTL text in paragraphs #349

ralessi opened this issue Apr 30, 2016 · 13 comments

Comments

@ralessi
Copy link

ralessi commented Apr 30, 2016

With luaotfload v2.7 (from TeXLive 2016 pretest), I cannot anymore mix RTL and LTR text in one and the same paragraph, namely without inserting blank lines before \textdir TRT and the like.

Here is a mwe:

\documentclass{article}

\usepackage{fontspec}

\newfontfamily\arabicfont[Script=Arabic]{Amiri}

\begin{document}

\section*{This works:}
English text: hello, world.

\textdir TRT\arabicfont
دَخَكَ مُبتَسِمًا

\textdir TLT\normalfont
English text back again.

\section*{But this doesn't}
English text: hello, world.
\textdir TRT\arabicfont
دَخَكَ مُبتَسِمًا
\textdir TLT\normalfont
English text back again.

\end{document}

This mwe gives me the following error: [...]texmf/tex/luatex/luaotfload/fontloader-2016-04-27.lua:13071: attempt to index local 'i' (a nil value)

Furthermore, if I force the compilation, I get this:
screenshot
Which is wrong, for we should read the last line as follows:

English text: hello, world. دَخَلَ مُبتَسِمًا English text back again.

Many thanks in anticipation for your help. -- Robert

@ralessi
Copy link
Author

ralessi commented Apr 30, 2016

Furthermore, if I force the compilation, I get this [...]

I am wrong, sorry. The brave old TeXLive 2015 and luaotfload v2.6 give the same word order.

@ralessi
Copy link
Author

ralessi commented Apr 30, 2016

So here is the actual issue in my opinion:

With luaotfload v2.7 (from TeXLive 2016 pretest), I cannot anymore mix RTL and LTR text in one and the same paragraph, namely without inserting blank lines before \textdir TRT and the like.

Here is a mwe:

\documentclass{article}

\usepackage{fontspec}

\newfontfamily\arabicfont[Script=Arabic]{Amiri}

\begin{document}

\section*{This works:}
English text: hello, world.

\textdir TRT\arabicfont
دَخَكَ مُبتَسِمًا

\textdir TLT\normalfont
English text back again.

\section*{But this doesn't}
English text: hello, world.
\textdir TRT\arabicfont
دَخَكَ مُبتَسِمًا
\textdir TLT\normalfont
English text back again.

\end{document}

This mwe gives me the following error: [...]texmf/tex/luatex/luaotfload/fontloader-2016-04-27.lua:13071: attempt to index local 'i' (a nil value)

@ralessi
Copy link
Author

ralessi commented May 2, 2016

NB1: I think fontspec is not implicated for I get the same error with this preamble:

\documentclass{article}

\usepackage{luaotfload}
\font\normalfont = {name:Libertinus Serif:script=latn} at 12pt
\font\arabicfont = {name:Amiri:script=arab} at 12pt

\begin{document}

NB2: \textdir xyz must be combined with \normal|arabicfont for the error to come out.

@phi-gamma
Copy link
Member

phi-gamma commented May 2, 2016

Hi,

thanks for the report!

I think this was an instance of this bug: https://mailman.ntg.nl/pipermail/ntg-context/2016/085321.html
In any case, it doesn’t occur anymore with the latest fontloader code
so please wait for the next Luaotfload release.

BTW I took the liberty and added your example to the test repo. It’s
pretty useful in triggering some less common code paths:
https://bitbucket.org/phg/lua-la-tex-tests/src/60fbd26ce8cfcef9f3fa0955524b314c552a8c6b/plain/pln-arabic-2-amiri-issue-349.tex

Philipp

@ralessi
Copy link
Author

ralessi commented May 3, 2016

Hi Philipp,

Excellent. I will test it as soon as it is out. Good to hear that this will be part of the test repo: so we kill two birds with one stone.

Robert

@ralessi
Copy link
Author

ralessi commented May 6, 2016

Hi Philipp,

I still have an issue in this mwe:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Libertinus Serif}

\newfontfamily\arabicfont[Script=Arabic]{Amiri}

\begin{document}

Hello: this is not so efficient:
\textdir TRT\arabicfont دَخَلَ مُبتَسِمًا

Hello: this is good:
\textdir TRT\arabicfont دَخَلَ مُبتَسِمًا

\end{document}

It gives me this error:

error: ...xmf-dist/tex/luatex/luaotfload/fontloader-2016-05-04.lua:13129: attempt to index local 'i' (a nil value)
.
l.11

Oddly, the culprit is the word 'efficient' on line 9; if you take it out, or replace it with 'good', the mwe compiles smoothly. Is it because of the 'ffi' ligature?

Robert

@phi-gamma
Copy link
Member

Hi Robert,

thanks for testing.

It gives me this error:

error: ...xmf-dist/tex/luatex/luaotfload/fontloader-2016-05-04.lua:13129: attempt to index local 'i' (a nil value)

Confirmed. Looks like this is triggered by the transition from
Latin to Arabic script:

https://bitbucket.org/phg/lua-la-tex-tests/src/684543a96a38ca647ca63c3301036b18fa39d7a0/latex/ltx-arabic-4.tex

I’ll file a bug with Hans.

Best,
Philipp

@ralessi
Copy link
Author

ralessi commented Jun 14, 2016

Great! I can't wait to test this new release! Many thanks, -R

Le 15 juin 2016 00:02:44 HAEC, Philipp Gesang [email protected] a écrit :

Closed #349 via 195d57d.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#349 (comment)

@phi-gamma
Copy link
Member

···<date: 2016-06-14, Tuesday>···<from: Robert Alessi>···

Great! I can't wait to test this new release! Many thanks, -R

Don’t thank me just yet ;) I still have to run another batch of
tests before releasing.

@ralessi
Copy link
Author

ralessi commented Jun 15, 2016

Fingers crossed! If I understood well, this fontloader update does not address issue #361 yet. Is that so? Many thanks again for your efforts. -R

@phi-gamma
Copy link
Member

phi-gamma commented Jun 15, 2016

If I understood well, this fontloader update does not address issue #361 yet. Is that so?

I’m afraid so. I forwarded the issue to Hans but so far no new developments
in this regard. Give him some slack, though, most other issues are fixed within
hours.

@phi-gamma
Copy link
Member

···<date: 2016-06-15, Wednesday>···<from: Robert Alessi>···

             If I understood well, this fontloader update

does not address issue #361 yet.

Try the new release, you’re in for a treat :)

@ralessi
Copy link
Author

ralessi commented Jun 17, 2016 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants