7
\documentclass[a4paper]{article}
\usepackage{fontspec}
\setmainfont{Junicode}
\begin{document}
\noindent
ji\\
ii\\
j\mbox{}i\\
i\mbox{}i
\end{document}

is rendered by lualatex with dotless i on the first two lines. Does anyone know where this comes from and if it is possible to turn it off somehow? I've tried to turn ligatures off, but it didn't help, nor can I find ji or ii ligatures in the Junicode font. The only thing that worked for me is insert empty box in between the two letters and use a macro \ji and \ii macros, but it an ugly hack. If I try to cut the text from the lualatex created pdf, the first character is j (or i) and the second is dotless i.

  • 1
    Perhaps also worth noting things look fine with XeTeX – Joseph Wright Dec 30 '14 at 15:39
  • Also, works fine with LuaTeX and the default font. So it is the LuaTeX/Junicode combination specifically... – cfr Dec 30 '14 at 15:44
  • I can confirm the problem even though I’m using a more recent version of the fonts, downloaded from Sourceforge, rather than the version in the package on CTAN. – Thérèse Dec 30 '14 at 15:46
  • Yeah, works fine with XeTeX, or say LuaLaTeX + another font, e.g. Dejavu Serif. I'm stuck with luaLaTeX unfortunately, as gregorio uses lua heavily. – Jakub Jelinek Dec 30 '14 at 15:50
  • 1
    I don't know much about opentype fonts but this one has the glyphs in the slots for lowercase i and j set up as accented glyphs composed from dotless variants plus an accent. That strikes me as... odd, to say the least. There seems to be some confusion here somewhere... – cfr Dec 30 '14 at 23:01
5

This is not an answer, only a temporary fix that’s too long for a comment. You can work around the problem by writing a tiny feature file, like this:

\documentclass{article}
\usepackage{filecontents,fontspec}
\begin{filecontents*}{juni.fea}
languagesystem DFLT dflt;
languagesystem latn dflt;

# fix problem in https://tex.stackexchange.com/q/220038/7883
feature fixi {
  sub \dotlessi by \i;
} fixi;
\end{filecontents*}
\setmainfont{Junicode}[
  FeatureFile={juni.fea},
  Contextuals=Alternate,
  Numbers=OldStyle,
  RawFeature=+fixi]
\begin{document}
\noindent
ji\\
ii
\end{document}

(If your version of fontspec is not recent, it will want the options to come between \setmainfont and {Junicode}, not after.)

Update

In TeX Live 2016, the fix seems to work more reliably, even with “ij”:

\documentclass{article}
\usepackage{fontspec}
\directlua{
fonts.handlers.otf.addfeature {
    name = "fixi",
    {
        type = "substitution",
        data = {
            dotlessi = "i",
            dotlessj = "j",
        }
    },
    "fixing i and j"
  }
}
\setmainfont{Junicode}[
  Contextuals=Alternate,
  Numbers=OldStyle,
  RawFeature=+fixi]
\begin{document}
ji ii ij
\end{document}

If you have updated luaotfload since February 2017, invoke \directlua this way:

\directlua
{
  fonts.handlers.otf.addfeature
  {
    name = "fixi",
    type = "substitution",
    data =
        {
          dotlessi = "i",
          dotlessj = "j",
        },
  }
}

If you do need a dotless i somewhere, use \addfontfeature{RawFeature=-fixi}.

  • Thanks. Unfortunately ij apparently is the same problem with the LuaLaTeX and Junicode font combination, and this trick doesn't seem to work for me with sub \dotlessj by \j; nor sub \dotlessj by j; – Jakub Jelinek Dec 31 '14 at 9:12
  • Actually sub uniF6BE by j; helps even for the ij case, dunno why it decides to substitute ij for i with a private area j character as opposed to dotless j. – Jakub Jelinek Dec 31 '14 at 15:11
  • @JakubJelinek sub \dotlessi \dotlessj by \ij; doesn’t work either. That’s bizarre, and as Sverre said, it’s time to report the bug. The problem is not with luatex, since other fonts don’t behave this way, and it’s not with the CTAN package, which I’m not using. You can link to this question in your bug report. – Thérèse Dec 31 '14 at 16:15
  • I've so far posted it to Junicode forum, at sourceforge.net/p/junicode/discussion/534856/thread/985f24af as I'm not sure if it is not intentional (but it is strange in any case). – Jakub Jelinek Dec 31 '14 at 22:19
3

Old post, but still ...

Junicode contains a ccmp lookup that decomposes i to dotlessi when it is followed by a combining diacritical mark (or preceded or followed by a combining double diacritic). This is because the font contains a large number of combining diacritics for which there are no precomposed forms.

It looks to me as if LuaTeX is mistakenly applying this feature even though the context does not require it--though only when a j follows. Why this should be happening is more than I can even begin to imagine. It is an odd intersection of an unusual feature in Junicode and a bug in LuaTeX (I have not seen this bug in any other application).

I do not intend to remove this feature from Junicode. If you have FontForge or another font editor, though, you can do so yourself. It's the third ccmp lookup. Meanwhile, I'm looking for a way to implement Junicode's feature that does not trigger a LuaTeX bug.

  • 1
    Welcome (back!) to TeX.SE. I assume you are the same user as "P. Baker", who (according to the site information) was last "seen Nov 17 '12 at 18:20". If that's correct, you may want to contact the site administrators to merge the two accounts. – Mico Sep 30 '15 at 11:54
  • Might I also suggest you submit a bug report. luaotfload is quite buggy, but the more bugs they hear of, the more of them they can (hopefully) fix. – Sverre Sep 30 '15 at 15:18
  • 3
    Thanks, Mico. I'd forgotten that I had a StackExchange account. I'll get them merged. Sverre: I'm noticing quite a number of LuaTeX bugs, and I'll try to get them organized to submit. My fonts contain lots of OpenType features, and they are good for stress-testing OT engines. – Peter Baker Sep 30 '15 at 15:45
  • 1
    You can use the @ to ping users you want notified, e.g. @Mico – Sverre Sep 30 '15 at 17:19
  • Wow, getting your observations on bugs in Lua(La)TeX and especially luaotfload -- the utility that performs most of the font-related chores -- will be very useful! – Mico Sep 30 '15 at 17:38

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.