Summary: | Basketgroup printing doesn't support non-latin characters | ||
---|---|---|---|
Product: | Koha | Reporter: | Zeno Tajoli <ztajoli> |
Component: | Acquisitions | Assignee: | Karam Qubsi <karamqubsi> |
Status: | Failed QA --- | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | caitlingoodger.student, dpavlin, jonathan.druart, karamqubsi, mathsabypro |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | 11944, 13596 | ||
Bug Blocks: | |||
Attachments: | This patch will use DejaVuSans.ttf font instead of Times to support non-Latin characters |
Description
Zeno Tajoli
2014-08-27 14:22:07 UTC
This bug exists in master but it should be fixed on top of bug 11944. I will try to provide a patch when bug 11944 will be pushed. I struggled with that 2 years ago with no result. My idea was that the perl module used to generate the Table in PDF (PDF::Table) is responsible for that (If the non latin chars are in the libray name for example, they can be printed), but maybe I was wrong... Mathieu Saby I don't think that it's enough to just add utf-8 encoding to $pdf->corefont. Just as with labels, we need to use true type fonts here to support all available utf-8 characters (otherwise western utf-8 characters work, but Croatian for example don't). Replacing $pdf->corefont("Times", -encoding => "utf8") with something like $pdf->ttfont('/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf') will nicely fix this problem (but also somewhat break tables which are created using PDF::Table, I will have to investigate this a bit more). But, now I'm wondering if we should use same <ttf> mapping from koha-conf.xml which we use for labels (if available)? Created attachment 58503 [details] [review] This patch will use DejaVuSans.ttf font instead of Times to support non-Latin characters This patch will use DejaVuSans.ttf font instead of Times and this will support the non-Latin characters I tested it with Greek text and Arabic text and it worked for Arabic texts I added Text::Bidi to support direction of text until now the arabic text characters appears but not connected as it should be . Test plan : Create a basket group with metadata that include non-latin characters close and export the group the titles will not appear . apply the patch re export the pdf file , you should find the text appear for the items I used google translate to get Greek text you might use it as will Title : αυτό είναι ένα τίτλο ενός βιβλίου Author : συγγραφέας Arabic : Title : عنوان بالعربي author : مؤلف --- I was able to apply the patch after fixing a merge conflict. CONFLICT (content): Merge conflict in acqui/pdfformat/layout3pages.pm With the patch exporting basketgroups with no latin characters in the title of an order doesn't work but exporting other basketgroups does. |