# ligature with special characters: fī

I am using a lot of special characters such as ā, ī, ū, š, ṣ, ḥ, ḫ and so on. I just spotted that sometimes this causes problems with ligatures for example the fi-ligature, if the dot on the i is a dash: fī.

In my MWE below I am using the Brill font: http://www.brill.com/author-gateway/brill-fonts .

I've come so far to have learned that there are three options to set fī:

If you want to get an MWE, please download it from here: http://www.arabic-philosophy.com/misc/minimal_fi.tex (Copy&Paste into this forum did not work because it made Option 1 and 3 be identical in sight.)

This is the result: http://www.arabic-philosophy.com/misc/minimal_fi.pdf

Option 1 is the one that emerges when I type a f and an ī.

Option 2 has been suggested by tohecz.

Option 3 is the one I'd prefer.

Is there a way to enable myself just to type as I used to but to tell LuaLatex to use option 3 instead of 1 as the output? What in fact is the difference between 1 and 3?

-
Are you sure there is an fī ligature to begin with? What about showing a MWE? – egreg Sep 10 '12 at 10:21
no, you're right. there is in fact none but I thought maybe it just makes a normal fi-ligature and then adds a dash. Anyway, as you see above, sometimes there is unnecessary space between f and ī and sometimes it is not. – ClintEastwood Sep 23 '12 at 12:19

U+0069 (LATIN SMALL LETTER I) U+0304 (COMBINING MACRON)

U+012B (LATIN SMALL LETTER I WITH MACRON)

You get the former when inputting the latter by using

\usepackage{newunicodechar}
\newunicodechar{ī}{ī} % use "i + combining macron" in the second argument


or, without too much hassle in inputting strange characters,

\newunicodechar{ī}{i\char\string"0304 }


This is the output from your test file (omitting option 2).

Minimal example:

\documentclass[12pt, a4paper]{scrbook}

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Brill}

\usepackage{newunicodechar}
\newunicodechar{ī}{i\char\string"0304 }

\begin{document}

\begin{verbatim}
1a. Kitāb an-Naǧāt fī l-ḥikma.

1b. \emph{Kitāb an-Naǧāt fī l-ḥikma}.

3a. Kitāb an-Naǧāt fī l-ḥikma.

3b. \emph{Kitāb an-Naǧāt fī l-ḥikma}.
\end{verbatim}

1a. Kitāb an-Naǧāt fī l-ḥikma.

1b. \emph{Kitāb an-Naǧāt fī l-ḥikma}.

3a. Kitāb an-Naǧāt fī l-ḥikma.

3b. \emph{Kitāb an-Naǧāt fī l-ḥikma}.

\end{document}

-
wow. this works very fine. There's one follow up problem to this, though: the headings in the headlines now misprint the dash on the i: the dash is no longer on top of the i but a little more than one character before the i. any ideas? – ClintEastwood Sep 24 '12 at 12:25
@ClintEastwood No example, no idea. :) – egreg Sep 24 '12 at 12:49
ok... =) I changed the MWE (tex and pdf) accordingly. – ClintEastwood Sep 24 '12 at 13:51
Strange: if I compile with XeLaTeX I get the expected result, but not with LuaLaTeX. – egreg Sep 24 '12 at 14:06
I have been having this error for weeks, but paid no attention to it as I ascribed it to the over-all and initial problem of how to write this fī-ligature (or no-ligature). now, however, it appears to be rather noteworthy. – ClintEastwood Sep 24 '12 at 15:28

In my humble opinion, fi shouldn't be ligatured when i has some other top-accent than a dot. You can do that by putting the empty braces {} between the letters: f{}ī. This image shows some variants, the last one is fi overlapped with \=\i, for comparison (I show the code as well, utf8 char ī doesn't work for me hence the \= command):

-
interesting. When I use f{}ī, then what I have called "error" occurs. (See the picture I just added to my question). Maybe this then is an error of the Brill font? – ClintEastwood Mar 18 '12 at 18:40
The empty braces {} supresses both ligatures and kerning of pairs, i.e. the characters will have their boxes just next to each other. That's why the ī letter might get moved right. But still, there should be correct placement of . after ī. – yo' Mar 18 '12 at 18:49
is there a way to "force" ligatures or to do the exact opposite than {} so that the boxes are not simply put next to each other? – ClintEastwood Apr 12 '12 at 6:42