我从 XeTeX 切换到 LuaTex 进行乌尔都语出版(Texlive 2022),总体而言是一次不错的体验。作为优秀字体 Awami Nastaliq with Graphite 的用户,我曾有过疑虑。不过不用担心。一切都很好。
有一件事我还没有做到,那就是 Awami 网页上提到的特定 XeTeX 命令。有没有解决方法可以让它们像下面的例子一样工作:
\documentclass[fontsize=12pt]{scrbook}
\usepackage[a6paper,left=1cm, right=1cm, bottom=1.2cm, top=1.5cm]{geometry}
\usepackage[english,bidi=basic]{babel}
\babelprovide[import,main,linebreaking=left]{urdu}
\usepackage{fontspec}
\setmainfont[Renderer=Graphite,RawFeature={Short forms=All}]{AwamiNastaliq}
%%%---------------------------------------------------------------------
%%% Cross-space contextualization Awami as mentioned on the Awami webpage of SIL. Commenting any one of the commands causes an error.
%%%---------------------------------------------------------------------
%%% No cross-space contextualization.
%%% This is how XeTeX behaves by default. Most projects will use this setting.
%\XeTeXinterwordspaceshaping = 0
%%% Some cross-space contextualization.
%%% Spaces between words are adjusted, but the rendering of individual words is not affected by the spaces.
%\XeTeXinterwordspaceshaping = 1%
%%% Full cross-space contextualization.
%%% Spaces between words are adjusted,
%%% and the rendering of individual words is affected by the spaces.
%\XeTeXinterwordspaceshaping = 2 %
%%% end of Cross-space contextualization
%\XeTeXgenerateactualtext=1 %this way the text can be copied directly from the pdf file. However, the resulting file can be over double as large, so I don't use this.
\begin{document}
آؤ میرے ساتھ۔ جاتے ہیں اِس راستے پر۔ کیا کریں؟ آؤ میرے ساتھ۔ لوگ ہنس رہے ہیں، اُن پر دھیان مت دو۔
\end{document}
答案1
如果XeTeX
您正在寻找的功能是\XeTeXinterwordspaceshaping
,它也可以实现fontspec
(作为WordSpace
选项):
\setmainfont[WordSpace=2,Renderer=Graphite,RawFeature={Short forms=All}]{AwamiNastaliq-Regular.ttf}