luaotfload icon indicating copy to clipboard operation
luaotfload copied to clipboard

Faulty Rendering of accented Hebrew with combining characters in newer TeXLive (2022 and later)

Open jbezos opened this issue 1 year ago • 2 comments

From https://github.com/latex3/babel/issues/313, by @LupinoTech. A new MWE without babel is:

\documentclass{article}

\parindent0pt
\usepackage{fontspec}
\setmainfont[Script=Hebrew]{SBL_Hbrw.ttf}

\begin{document}

{\textdir TRT בְּשְׂ}

\end{document}

The following MEW yields different output with TeXlive (2021 or earlier) versus newer TeXlive (2022 and later, including a freshly updated one):

\documentclass[UKenglish]{article}

\usepackage[bidi=basic]{babel}
\babelfont[hebrew]{rm}{SBL_Hbrw.ttf}
\parindent0pt

\begin{document}
Letters without Sheva: \foreignlanguage{hebrew}{בּשׂ}\\
Letters with Sheva: \foreignlanguage{hebrew}{בְּשְׂ}\\
Moar Context: \foreignlanguage{hebrew}{בְּנוֹת יִשְׂרָאֵל}
\end{document}

The used font file SBL_Hbrw.ttf can be found here.

Older TeXLive renders the code as hebrew_2021 while newer TeXLive renders hebrew_newest Note the positions of the "dots" above ש and inside ב.

If it helps, here are the log files for both tex runs: tl2021.log newest.log

jbezos avatar Oct 08 '24 06:10 jbezos

The problem here is Unicode normalization which reorders marks in a way the font doesn't expect. The manual of the font (https://www.sbl-site.org/Fonts/SBLHebrewUserManual1.5x.pdf) recommends to disable normalization which can be done with the -normalize font feature:

\documentclass{article}

\parindent0pt
\usepackage{fontspec}
\setmainfont[Script=Hebrew,RawFeature=-normalize]{SBL_Hbrw.ttf}

\begin{document}

{\textdir TRT בְּשְׂ}

\end{document}

As Jonathan mentioned in the related discussion for HarfBuzz a decade ago this is something which should be resolved on the font level, but we can consider doing similar adjustments to the ones done by HarfBuzz.

zauguin avatar Nov 17 '24 13:11 zauguin

A more recent HarfBuzz discussion and change: https://github.com/harfbuzz/harfbuzz/issues/2947

khaledhosny avatar Nov 20 '24 18:11 khaledhosny