5

I noticed that if you use the Renderer = HarfBuzz fontspec option, the colr OpenType feature automatically gets disabled. If you use the default renderer, the feature does not get enabled but you can manually enable/disable it. My problem is that I cannot disable the colr feature if I use the HarfBuzz renderer. I cannot use XeLaTeX instead of LuaLaTeX or the default renderer instead of HarfBuzz as a workaround, because those are needed for the font I am using, which can be obtained here.

\documentclass{article}

\usepackage[bidi = basic]{babel}
\babelprovide[main, import]{arabic}
\babelfont[arabic]{rm}[Renderer = HarfBuzz, RawFeature = -colr]{digitalkhatt.otf}

\newcommand\ayah{^^^^06dd}

\begin{document}

بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ~\ayah١
ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ~\ayah٢
ٱلرَّحْمَٰنِ ٱلرَّحِيمِ~\ayah٣
مَٰلِكِ يَوْمِ ٱلدِّينِ~\ayah٤
إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ~\ayah٥
ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ~\ayah٦
صِرَٰطَ ٱلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ ٱلْمَغْضُوبِ عَلَيْهِمْ وَلَا ٱلضَّآلِّينَ~\ayah٧

\end{document}

I expected the end-of-ayah symbols in the above image to be black, but they are coloured.

5
  • 1
    For clarification: what do you want the output to look like, how should it be different from the output that you currently have?
    – Marijn
    Mar 16, 2023 at 14:33
  • 1
    The end-of-ayah symbols should be black, they shouldn't be coloured.
    – Amarakon
    Mar 16, 2023 at 16:59
  • 1
    I edited my question to make that clear.
    – Amarakon
    Mar 17, 2023 at 0:14
  • Maybe I am wrong, but a COLR table is not an OpenType feature. I think, this font does not have a feature that enables you to switch on and off the colored glyphs. Mar 17, 2023 at 0:51
  • 3
    Makes sense, but why can I freely enable/disable colr when using the default Node renderer? To me it seems like this is a problem with HarfBuzz.
    – Amarakon
    Mar 17, 2023 at 1:02

1 Answer 1

4
+100

You can use RawFeature ={colr=1} to activate colr font feature, and to deactivate the feature just replace 1 with any other integer.

\documentclass{article}

\usepackage[bidi = basic]{babel}
\babelprovide[main, import]{arabic}
\babelfont[arabic]{rm}[Renderer = HarfBuzz, RawFeature ={colr=2}]{digitalkhatt.otf} %  RawFeature ={colr=3}
\newcommand\ayah{^^^^06dd}

\begin{document}

بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ~\ayah١
ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ~\ayah٢
ٱلرَّحْمَٰنِ ٱلرَّحِيمِ~\ayah٣
مَٰلِكِ يَوْمِ ٱلدِّينِ~\ayah٤
إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ~\ayah٥
ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ~\ayah٦
صِرَٰطَ ٱلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ ٱلْمَغْضُوبِ عَلَيْهِمْ وَلَا ٱلضَّآلِّينَ~\ayah٧


\addfontfeatures{ RawFeature ={colr=1}} % to activate colr feature


بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ~\ayah١
ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِينَ~\ayah٢
ٱلرَّحْمَٰنِ ٱلرَّحِيمِ~\ayah٣
مَٰلِكِ يَوْمِ ٱلدِّينِ~\ayah٤
إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ~\ayah٥
ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ~\ayah٦
صِرَٰطَ ٱلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ ٱلْمَغْضُوبِ عَلَيْهِمْ وَلَا ٱلضَّآلِّينَ~\ayah٧


\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .