Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Ligatures and gyphs for Arabic
  FAQ FAQ  Forum Search   Register Register  Login Login

Ligatures and gyphs for Arabic

 Post Reply Post Reply
Author
Message
sumesh.mathews View Drop Down
Beginner
Beginner
Avatar

Joined: 28 Jan 21
Location: India
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote sumesh.mathews Quote  Post ReplyReply Direct Link To This Post Topic: Ligatures and gyphs for Arabic
    Posted: 28 Jan 21 at 6:25AM
Hi,

I'm currently evaluating QuickPDF for using Arabic in PDFs. 

I'm able to print in the PDF char by char or unicode by unicode. 

But the problem is that languages like Arabic have ligatures and glyphs that don't have exact unicode mapping. My understanding is that they use an approach of like combining 2 or more existing unicodes to another glyph which is mostly present in the font file (.ttf).

For an illustration something like the below:
unicode1 + unicode2 = glyph1
unicode2 + unicode3 = glyph2 .. etc

My code looks like the below:
...
int fontId = DPL.AddUnicodeFont(L"Arial Unicode MS {1256}", 0, 1);
int rc = DPL.SelectFont(fontId);
DPL.DrawText(100, 600, L"تم إستلامه في");
...

the output I get via QuickPdf is basically broken into its chars:

https://www.dropbox.com/s/9v7ustqeqnvmkzq/QuickPDFOut.PNG?dl=0

the output I get via Microsoft Print to PDF is same as the input string:

https://www.dropbox.com/s/0kpunaa124mzm50/MicPrintPdfOut.PNG?dl=0

Can QuickPDF give the same output like what I'm getting via Microsoft Print to PDF?

Thanks. 
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 21 at 10:58AM
I copied your Arabic above and I get the same results as in your PNG when using DrawText.

There is an 'experimental' QPDF function named DrawUniscribeText which is definitely worth a try.  Check it in the QPDF Reference Guide.  Microsoft say (Google Uniscribe API) that this is intended to improve the handling of Middle-East and Asian character sets.

I cannot test this here without changing our application, but do please report back here if it works for you, as it may help other users.  If not, this is an issue to raise with Foxit/Debenu support: here we are just users, like you.
Back to Top
sumesh.mathews View Drop Down
Beginner
Beginner
Avatar

Joined: 28 Jan 21
Location: India
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote sumesh.mathews Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jan 21 at 6:02AM
Hi,

Thanks for the response Smile

DrawUniscribeText() worked fine Big smile
I'll need to still try out other Arabic strings to confirm its working fine in most of the cases. 
Even though the return from DrawUniscribeText() is 0 (The font group name was invalid or the text string contained no valid characters), its working fine in the PDF. 
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jan 21 at 10:15AM
Thanks for confirming!  I may decide to add support for this in our software, where it optionally adds annotations to a PDF.  We do have customers in the middle and far east, but this issue has not been reported; most customers do not need to do this.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store