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!
Ligatures and gyphs for Arabic |
Post Reply |
Author | |
sumesh.mathews
Beginner Joined: 28 Jan 21 Location: India Status: Offline Points: 3 |
Post Options
Thanks(0)
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.
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
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.
|
|
sumesh.mathews
Beginner Joined: 28 Jan 21 Location: India Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Hi,
Thanks for the response DrawUniscribeText() worked fine 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.
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
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.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store