0

Consider the following MWE:

% File: test-kashida.tex
\documentclass{report}
\usepackage[Kashida]{xepersian}
\settextfont[Scale=4.5]{XB Kayhan} 
\def\SampleText{راهی جایی تابی چاپی چاهی تلاشهایی شتابهایی تابی چاپی راهی تلاشهــایی که کتابهایی که کلاههایی که}
\begin{document}
\KashidaOff \SampleText \lr{\Huge(Kashida Off)}

\KashidaOn \SampleText \lr{\Huge(Kashida On)}
\end{document}

The output of the above example is: enter image description here Even after the command \KashidaXBFixOn is added to the document, the dots below ‏"بی", "یی", "پی"‏ and so on, still seems to be displaced.

How can one fix this problem?

3

Write option KashidaXBFix=on in xepersian package.

\usepackage[Kashida=on,KashidaXBFix=on]{xepersian}

see this link1, link2 , link3

Please see this questions

Edit:

\documentclass{report}
\usepackage[Kashida,KashidaXBFix=on]{xepersian}

\settextfont[Scale=4.5]{XB Niloofar} 
\def\SampleText{راهی جایی تابی چاپی چاهی تلاشهایی شتابهایی تابی چاپی راهی تلاشهــایی که کتابهایی که کلاههایی که}
\begin{document}
\KashidaOff \SampleText \lr{\Huge(Kashida Off)}

\KashidaOn \SampleText \lr{\Huge(Kashida On)}
\end{document}

output:

enter image description here

output: Font IRXLotus

enter image description here

Edit: 2020-03-21 see link

\documentclass{report}
\usepackage{xcolor}
\usepackage[Kashida=on,KashidaXBFix=on]{xepersian}
\settextfont[Scale=4.5]{XB Kayhan} 


\XeTeXinterchartokenstate = 1
\newXeTeXintercharclass\yclass
\newXeTeXintercharclass\bypclass
\XeTeXcharclass `\ی \yclass
\XeTeXcharclass `\ب \bypclass
\XeTeXcharclass `\پ \bypclass
\XeTeXinterchartoks \bypclass \yclass = {}
\XeTeXinterchartoks \yclass \yclass = {}


\def\SampleText{راهی جایی تابی چاپی چاهی تلاشهایی شتابهایی تابی چاپی راهی تلاشهــایی که کتابهایی که کلاههایی که}
\begin{document}
\KashidaOff \SampleText \lr{\Huge(Kashida Off)}

\KashidaOn \SampleText \lr{\Huge(Kashida On)}
\end{document}

output

enter image description here

| improve this answer | |
  • Probably the font problem. see questions – M.Ahmadi Mar 12 at 16:30
  • Thanks, but the result is the same, since the methods are the same. Would you please test your answer. – Tisha Shusho Mar 12 at 16:31
  • @Tisha Shusho , See edit and link2. – M.Ahmadi Mar 12 at 16:50
  • I saw the links you mentioned in your answer. The only thing that I understood was that the kashida feature in xepersian works fine with some fonts but not with the others. So, it would be gratefully appreciated if you kindly briefly explain why kashida does not work fine with some fonts such as XB Kayahan, so that I can seek a solution. BTW, you have changed the font XB Kayhan to something else, like "XB Niloofar" in your answer. My question was "How can one fix the problem with XB Kayhan?". However, please note that kashida feature does not work properly with "XB Niloofar Italic" either. – Tisha Shusho Mar 12 at 19:28
  • Related: tex.stackexchange.com/questions/38196/… – Cicada Mar 13 at 13:21
1

Closer inspection shows the need for a fix:

fix needed

Without fix:

without fix

With fix:

with fix

I don't know enough for certain, but it looks as if use of the stretching-rule fix might need a further, fine-tuning, fix in some contexts (since different arrangements produce different stretches).

red = the font

non-red = presumably, the rule used to emulate stretching

MWE

\documentclass{report}
\usepackage{xcolor}
\usepackage[Kashida=on,KashidaXBFix=on]{xepersian}
\settextfont[Scale=4.5,Colour=red]{XB Kayhan} 
\def\SampleText{راهی جایی تابی چاپی چاهی تلاشهایی شتابهایی تابی چاپی راهی تلاشهــایی که کتابهایی که کلاههایی که}
\begin{document}\color{blue}
\KashidaOff \SampleText \lr{\Huge(Kashida Off)}

\KashidaOn \SampleText \lr{\Huge(Kashida On)}
\end{document}
| improve this answer | |
0

The author of HM Series fonts has resolved the issue in his new package 'xepersian-hm' located at http://mirror.ctan.org/macros/xetex/latex/xepersian-hm. More information is at http://www.ctan.org/pkg/xepersian-hm.

The README.txt file of the package says:

Kashida feature in xepersian has problem with some fonts such as HM Series fonts available at 'https://dma8hm1334.bitbucket.io' and XB Series fonts available at 'http://wiki.irmug.com/index.php/X_Series_2'. The `xepersian-hm' package fixes this problem.

Consider the following example which uses xepersian-hm:

\documentclass{report}
\usepackage{xcolor}
% \usepackage[Kashida=off,RTLdocument=on]{xepersian}  % Load xepersian with a few options
\usepackage[Kashida,kashidastretch=0.14 em plus 0.5 em]{xepersian-hm}    % Succeeds
% \usepackage[Kashida,kashidastretch=noskip]{xepersian-hm}               % Succeeds
% \usepackage[Kashida,kashidastretch=default]{xepersian-hm}              % Succeeds
% \usepackage[Kashida,kashidastretch=kayhan]{xepersian-hm}               % Succeeds
% \usepackage[Kashida,kashidastretch=khorramshahr]{xepersian-hm}         % Succeeds
% \settextfont[Scale=4.5,Colour=darkgray]{XB XKayhan}
% \setlatintextfont[Scale=2.5,Colour=teal]{XB XKayhan}
\settextfont[Scale=4.5,Colour=darkgray]{HM XKayhan}
\setlatintextfont[Scale=2.5,Colour=teal]{HM XKayhan}
\def\SampleText{راهی جایی تابی چاپی چاههی تلاشهایی شتابهایی تابی چاپی راهی تلاشهــایی که کتابهایی که کلاههایی که}
\setlength\parindent{0pt}
\pagestyle{empty}
\begin{document}
\color{red}
\SampleText  \\ \lr{(compiled with: xepersian-hm)~}
\end{document}

The output is: enter image description here However, the output of the above example using xepersian is: enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.