fontspec
fontspec copied to clipboard
Weird annoying fontspec BUG
Description
If you use Graphite Renderer and arabic script, then fontspec complain that the selcted font does not contain arabic script and the text is not rendered correctly.
For the purpose of this bug report, you can test using AWAMI NASTALIQ font.
This issue does not happen in Plain TeX or when using \font control sequence directly in LaTeX. See my second minimal example.
The Script=Arabic is needed since XeTeX does some unicode bidi; without this, parentheses, etc will be wrong.
Check/indicate
- [x] Relevant for XeTeX
- [ ] Relevant for LuaTeX
- [ ] Issue tracker has been searched for similar issues?
- [ ] Links to <tex.stackexchange.com> discussion if appropriate
Minimal example demonstrating the issue
\documentclass{article}
\usepackage{fontspec}
\setmainfont{AwamiNastaliq-Regular}[Path,Renderer=Graphite,Script=Arabic]
\begin{document}
وفا
\end{document}
and here is the plain tex one.
\font\test="[AwamiNastaliq-Regular]/GR:script=arab" at 20pt
\test
وفا
\bye
Further details
Well the documentation of fontspec writes
Currently fontspec does not support a convenient interface to select Graphite font features and all selection must be done via ‘raw’ font feature selection.
so use
\setmainfont{AwamiNastaliq-Regular}[Path,Renderer=Graphite,RawFeature={script=arab;}]
@wspr Please have a look at this.
@niruvt — thanks for making the connection
@wspr Thanks a lot for the fix!