1

Back in 2018 xepersian started throwing random errors if you used fonts with a specific string in their name ("HM") and this caused a lot of headache for the users of these fonts. This issue was discussed here.

It turned out that the xepersian developer had decided to do this as a result of a quarrel between him and the authors of those fonts, and he had to fix it in the next version.

In texlive 2022, if these fonts are used there are no errors, but the output will be distorted (this seems to be the case for XB fonts too). Just renaming the font fixes this issue.

Here I'm using two fonts: HM FMitra and RENAMED Mitra which is the exact same font that I have renamed.

\documentclass{report}
\usepackage[Kashida]{xepersian}
\settextfont{HM FMitra} 
\def\SampleText{متن آزمایشی}
\begin{document}
\SampleText 
\settextfont{RENAMED Mitra}
\SampleText 
\end{document}

output

Am I missing something or the xepersian developer is doing this deliberately again?

4
  • 1
    well a font can not be "exactly the same" if you renamed it so that it can be found under another name. I see nothing suspicious in the code, and your difference looks to me as kashida is the problem, if I use \usepackage[Kashida=true]{xepersian-hm} as David already suggested to you it seems to work. Beside this, you could try babel + lualatex instead: latex3.github.io/babel/guides/locale-arabic.html Feb 27, 2023 at 11:42
  • You're absolutely right. I didn't suspect a "kashida" problem, because renaming fixed it. Probably just saving the font changes something. And thanks for the babel + lualatex suggestion.
    – nima
    Feb 27, 2023 at 12:45
  • did you really access it as RENAMED Mitra if you don't use a .ttf extension as in my answer it will use the internal font name, which is not changed by copying the fil? Also your output shows two lines but your input only has one paragraph. Feb 27, 2023 at 12:51
  • I didn't copy the font file, I opened it in a font editor, changed it's properties and saved it as a new file. New lines were deleted by mistake when I copied the code here. Anyway, as you suggested using xepersian-hm fixed the problem in this code.
    – nima
    Feb 27, 2023 at 14:55

1 Answer 1

2

I see no special cases for HM as there were in some early versions, and the same output for a renamed font

this

The xepersian-hmpackage loads xepersian then adds some extensions including better support for these fonts

enter image description here

\documentclass{report}
\usepackage[Kashida=True]{xepersian-hm}
\settextfont{HM_FMitra.ttf} 
\def\SampleText{متن آزمایشی}
\begin{document}

\SampleText 

\settextfont{aaa.ttf}% renamed font
\SampleText 
\end{document}

This site is temporarily in read-only mode and not accepting new answers.

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