0

I want to use true type font (ttf) with pdftex. This has been discussed for latin fonts and it seems that's the problem is solved. My problem is with arabic font, for example Amiri. I learned that i need to have a set of Amiri.enc, Amiri.tfm and Amiri.ttf or Amiri.pfb. It seems that one can get all this using FontForge but i didn't success to do this. So, if you can help, i need a step by step guid for this.

Edit (motivation)

Arabi's author write:

in page 47

With Arabi, we can use, in addition to (normal TEX) fonts in METAFONT format, Arabic fonts in True Type and Postscript format too

and in page 48

Unfortunately, Microsoft fonts will not be included with the Arabi distribution, you are supposed to have them on your system or download them freely from Microsoft Homepage. But of course, TeX fonts metrics and Font descriptions files are available with the distribution ready to be used! If you want to use them in a Type 1 format with dvips, you should convert them yourself, as the author did, using one of the many available tools! And of course make the appropriate changes in the psfonts.map

also a showcase is there in page 50. MicroSoft fonts

CTAN: tfm files and enc file

  • 4
    It is much easier to use LuaLaTeX or XeLaTeX where you can use any font installed to your system as well as benefit from UTF-8 support. – Jasper Habicht Oct 29 '23 at 16:57
  • 2
    it is far easier to use luatex or xetex that can load the file directly than make multiple subset fonts suitable for pdftex4 – David Carlisle Oct 29 '23 at 16:59
  • Yes you're right @JasperHabicht, but for now it's not a choice – student maths Oct 29 '23 at 16:59
  • @DavidCarlisle please can you expand a bit – student maths Oct 29 '23 at 17:02
  • a truetype font can have thousands of characters, and luatex can use it directly see this answer to make something for pdf you need to make tfm files for at most 256 characters per font and macros that work out which character is in which subset and and ... there are tools to help but with luatex none of the complication is needed – David Carlisle Oct 29 '23 at 17:12
  • 2
    Why do you think using LuaLaTeX "is not a choice"? What aspects of your document(s) require things that only pdfLaTeX can do and LuaLaTeX cannot do? Especially since using a UTF-8 engine for Arabic is so much more sensible. – Alan Munn Oct 29 '23 at 17:14
  • sorry but you do not want to do that for arabic. For latin scripts it can rather easily be done with autoinst, but it has no support for LAE-encoding and so you would have to setup everything on your own. Use lualatex or stick to the existing fonts https://tex.stackexchange.com/a/529706/2388. – Ulrike Fischer Oct 29 '23 at 17:22
  • @AlanMunn, this is for embedded pdftex. – student maths Oct 29 '23 at 17:43
  • @DavidCarlisle i read somthing like this, so the question is can/how i get a file with only 256 characters needed for arabic? – student maths Oct 29 '23 at 17:47
  • @DavidCarlisle in another way, can one get a modified version of Amiri that have at most 256 characters needed for arabic? – student maths Oct 29 '23 at 17:49
  • I honestly have no idea, it's likely to be hard and require lots of knowledge of font tools, not really tex knowledge – David Carlisle Oct 29 '23 at 17:54
  • what do you mean by embedded pdftex? – David Carlisle Oct 29 '23 at 17:55
  • @DavidCarlisle it's a gui app. that produce maths documents with python and pdftex behind the scenes. – student maths Oct 29 '23 at 18:10
  • 1
    sure but python could call luatex instead of pdftex if you change three letters in the python code. that would be vastly simpler than what you are asking – David Carlisle Oct 29 '23 at 18:12
  • @DavidCarlisle of course you're right. i'll consider that. For now i don't want to ask users to install other stuff and i am trying to keep it small. Thank you very much. – student maths Oct 29 '23 at 18:43
  • 2
    @studentmaths it is highly unlikely anyone has pdflatex but not lualatex, you would have to work hard on special cut down tex installation. – David Carlisle Oct 29 '23 at 19:01
  • FontForge does not or, at least, did not used to, produce .tfm or .enc files you can use directly. As @UlrikeFischer says, you really do not want to do this. I know you think you do but, believe me, this is complex enough even for Latin scripts (if you don't like the autoinst results). I have no clue how pdfTeX typesets Arabic, but this is a major project to little purpose. – cfr Oct 29 '23 at 19:22
  • @cfr I believe you, but it's too late to stop me :-). So, please if you can help in any way, i am thankful for it. – student maths Oct 30 '23 at 15:33
  • @UlrikeFischer i edited my question – student maths Oct 30 '23 at 16:35
  • 1
    As to the comment "For now i don't want to ask users to install other stuff and i am trying to keep it small" it would be much easier to install an independent installation of LuaTeX than pdfTeX. See https://github.com/vlasakm/mmtex for an example. Theoretically I think you can also not use kpathsea if you will overload the default way LuaTeX search for files. – Udi Fogiel Oct 31 '23 at 02:06
  • @UdiFogiel sounds good, i'll see. Thank you. – student maths Oct 31 '23 at 05:53

0 Answers0