speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
296 stars 36 forks source link

Add RTL, Right to Left language support #161

Closed ghost closed 6 years ago

ghost commented 6 years ago

There are a number of existing LaTeX modules and implementations that support RTL languages. My languages of concern are Arabic, Hebrew, and Persian. I know we've discussed that this is a big addition. Just creating a ticket so that we can discuss the progress here at github.

pgundlach commented 6 years ago

It is quite a big addtion. The publisher handles the font substystem on its own and shares no code with LaTeX or other systems. The Arabic and Persian script (I don't know about hebrew) need special treatment of font-shaping (IIRC each glyph in Arabic script can have four different shape, depending on the position of each glyph in a word). This is a non-trivial task, but luckily there are libraries out there that handle font shaping. So there are a few steps to be done:

  1. find a library and link it to LuaTeX
  2. implement r-t-l support in the software
  3. access the library to get the correct position and glyph for each word.

There is harfbuzz that handles these shapings, so in theory it is possible to typeset Arabic text. But some obstacles remain:

  1. The current version of the Publisher uses LuaTeX version 0.79 which is unable to link to foreign libraries. The solution is to update to a new version of LuaTeX which I am currently preparing. Some of my automated tests fail and I still have to find out how big the impact of the changes are.
  2. Test the library under Windows and Linux (Linux should be not a problem but I have to setup a Windows test machine first - not a big deal but I have to do it)
  3. Implement r-t-l (LuaTeX gives me a foundation for that but there has to be an user interface)
  4. Use harfbuzz to get the positions of the glyphs. The documentation is sparse, so there will be a lot of try and error here.
ghost commented 6 years ago

I am grateful for whatever you can do and certainly seems like you have a handle on what is needed.

Addition of these features would certainly make your software on par with SILE and even better for me because your distribution of compiled executables is very handy for people like myself who are not experts in that.

Will the addition of harfbuzz be possible in the compiled executable distribution of Speedata? Harfbuzz was one of the reasons I could not get SILE to compile in my system and so turned to Speedata. Hopefully if you can figure out the compile and dependency issues you will be able to deliver a simple compiled exe that has all that already figured out.

pgundlach commented 6 years ago

Re: harfbuzz - The ready to run packages will include harfbuzz. If it is not possible to include such a library in the ready-to-run packages, I will not add that dependency. However I doubt that this will be showstopper. In other words: speedata will always be a simple to install package.

pgundlach commented 6 years ago

I will close this issue. I have this on my radar and I will implement this.