Skip Menu |

This queue is for tickets about the PDF-API2 CPAN distribution.

Report information
The Basics
Id: 113700
Status: open
Priority: 0/
Queue: PDF-API2

People
Owner: Nobody in particular
Requestors: jeromekampot [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Khmer script incorrectly rendered
Date: Tue, 12 Apr 2016 16:28:39 +0700
To: bug-PDF-API2 [...] rt.cpan.org
From: Jerome B <jeromekampot [...] gmail.com>
It seems subscript (footer letters) are not rendered for Khmer script. PDF-API2 v2.0.27, perl 5.18.2 The code below should render 2 consonants, "under" each other but instead renders them next to each other with the "Coeng"placeholder. I tested with different fonts including KhmerOS.ttf ( http://sourceforge.net/projects/khmer/files/Fonts%20-%20KhmerOS/KhmerOS%20Fonts%205.0-%20LGPL%20Licence/) Copy/paste of the text seems to work correctly so I guess it has something to do with the way the font is generated. my $pdf = PDF::API2->new(-file=>"testkhmer.pdf", -encode => 'utf8'); my $page = $pdf->page; my $font = $pdf->ttfont('../font/khmerOS.ttf'); my $text = $page->text(); $text->font($font, 20); $text->translate(200, 700); $text->text("\x{1780}\x{17D2}\x{1780}"); $pdf->save();
This one is a major undertaking, because GSUB and GPOS processing needs to be added to TTF font processing. Indic family languages such as Khmer (also Arabic family languages) do a lot of ligatures, character substitution, and tweaking of glyph positions, and none of this is currently handled in PDF::API2 or PDF::Builder. You can't blindly implement ligatures, for example, because there are times (in English) when a ligature is inappropriate (such as across syllable boundaries).