pdflatex vs. lualatex: Libertinus and overline vs. bar

I understand that I am supposed to use \bar instead of \overline in math mode, if I want the respective character to mean "something different", because \bar is actually an accent (similar to \dot, a prime, \hat, etc.) Opposed to that \overline is meant to be used as an operator, like a conjugation or similar.

However, with Libertinus and PdfLaTeX, I usually use \overline, because it gives me better visual results.

MWE:

\documentclass{article}
\usepackage{libertinus}

\begin{document}
\begin{tabular}{cc}\hline
\texttt{\textbackslash overline}  &  \texttt{\textbackslash bar} \\\hline
$\overline{c}$     &  $\bar{c}$ \\
$\overline{d}$     &  $\bar{d}$ \\
$\overline{f}$     &  $\bar{f}$ \\
$\overline{\i}$    &  $\bar{\i}$ \\\hline
\end{tabular}
\end{document}


Result with PdfLaTeX:

In my personal opinion, \overline is better, because the "accent" is wider, covers the whole width of the letter and therefore is easier to spot.

Recently, I switched to LuaLaTex. The same MWE compiled with LuaLaTeX:

• Pro \overline: Generally, the "accent" is still wider and easier to spot, especially for the d and the f
• Pro \bar: The thickness of the accent's "ink" matches the thickness of the letters
• Con \overline: The overline is horizontally misplaced for the f and the d. In both cases the "accent" is too much on the left. \overline does not take into account that the characters are slanted and their ascending stems stick out to the right.
• Con \bar: In case of the d, the bar seems to be too short or strangely misplaced. If it remains as short as it is, the accent should be more to the right above the ascending stem of the d.

Questions:

1) Is it possible to fix \bar for the d-letter such that is either becomes wider and covers the width of the whole body of the d or alternatively is placed over the stem of the d as it is the case with the f?

2) Is it possible to fix \bar for the f-letter such that is becomes a little bit wider and looks more similar to the overline as it is the case with PdfLaTeX?

• \bar{d} looks like a bug in the font. Report it. And use \imath for the dotless i. Feb 16 '20 at 18:32
• the overline f looks terrible I much prefer the bar in that case, even though it's a bit short Feb 16 '20 at 19:58
• it works fine with xelatex, the reason why it may be a problem with package fontspec Feb 17 '20 at 8:44
• \bar is a maths accent. If it is misplaced it is (probably) a bug in the font. Feb 17 '20 at 11:46

This is either a bug in LuaTeX (or maybe luaotfload) or the font itself, nothing to do with fontspec or unicode-math. Here is a plain TeX example:

%!TEX TS-program = XeTeX

\ifx\XeTeXversion\undefined
\def\otf#1{[#1.otf]}
\else
\def\otf#1{[#1.otf]}
\fi

\parindent=0pt\relax
\hsize=8.5cm\relax
\hrule
\bigskip

{\bf Default \TeX}

Regular symbols:
$$a + b + c \quad \alpha + \beta + \gamma$$

Testing overline:
$$\overline{a} + \overline{b} + \overline{c} + \overline{d} + \overline{e} + \overline{f} + \overline{\alpha} + \overline{\beta} + \overline{\gamma}$$

\hrule
\bigskip

\font\mymm = "\otf{LibertinusMath-Regular}:color=FF0000" at 10pt\relax

\textfont1\mymm

\def\alpha{α}
\def\beta{β}
\def\gamma{γ}

\def\codemathhigh{%
\Umathcode\a = 7 1 "1D44E\relax
\Umathcode\b = 7 1 "1D44F\relax
\Umathcode\c = 7 1 "1D450\relax
\Umathcode\d = 7 1 "1D451\relax
\Umathcode\e = 7 1 "1D452\relax
\Umathcode\f = 7 1 "1D453\relax
\Umathcode"03B1 = 7 1 "1D6FC\relax
\Umathcode"03B2 = 7 1 "1D6FD\relax
\Umathcode"03B3 = 7 1 "1D6FE\relax
}
\codemathhigh

Regular symbols:
$$a + b + c \quad \alpha + \beta + \gamma$$

Testing overline:
$$\overline{a} + \overline{b} + \overline{c} + \overline{d} + \overline{e} + \overline{f} + \overline{\alpha} + \overline{\beta} + \overline{\gamma}$$

\bye

• Who reports the bug to the maintainers of LuaTeX, luaotfload or the Libertinus font project? I must admit that I feel very inexperienced to decide which of the projects is the right one. Feb 17 '20 at 16:31
• it works fine with xetex, the reason why it must be a problem with latex and/or luaotfload Feb 20 '20 at 20:40