We have ported the minibidi.c to FreePascal minibidi.pp with some modifications to be workable with Pascal, in minilib project.
This file process the Unicode Arabic characters to make Joining/Shaping and make it Right To Left readable, in another hand it is prepare the string variable (widestring) to be printed in Right To Left, it is like FriBidi but more simple and in Pascal.
The original file written by Ahmad Khalifa from arabeyes.org, i published it with same license.
Also we port cp864 CodePage and added to unicodes directory, it is useful to convert a Unicode string (widestring) to that old code page cp864.
cp864 used by most POS printers (thermal) and Customer Display, now with minibidi.pp you can proceess the string to be printed in Right To Left order and then convert it to cp864 codepage then print it to ESCPOS printers.
This an example how to print to ESCPOS printer
The code still need more work, but until now it is usable for me