PDF Khmer Unicode Font Not Rendering Correctly
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- java
- Ambito
- backend, computer-graphics
Direzione di ricerca
Start with the supplied OpenPDF example using Hanuman.ttf and Identity-H, then trace how OpenPDF embeds and renders fonts for Khmer text. Compare the generated PDF with the expected rendering shown in the issue and identify whether the problem lies in font handling or text shaping. Done means Khmer characters render correctly in the generated PDF.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello everyone,
I'm using Eclipse BIRT Report Designer to generate reports in PDF format, but I’m facing issues with rendering Khmer Unicode Font. The Khmer characters either:
- Appear as blank or missing text, or
- Show incorrect khmer characters.
I've tested generating a simple PDF using OpenPDF with the Hanuman font. Here’s the code I used:
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfWriter;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws DocumentException, IOException {
// Output PDF file
Document document = new Document();
try {
PdfWriter.getInstance(document, new FileOutputStream("Khmer_Font_Test.pdf"));
} catch (DocumentException | FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
document.open();
// Load Hanuman TTF font
BaseFont hanumanFont = BaseFont.createFont("/Users/sinsarath/eclipse-workspace/SamplePdf/fonts/Hanuman.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font font = new Font(hanumanFont, 14); // Set font size to 14
// Add Khmer text
String khmerText = "លេខ";
document.add(new Paragraph(khmerText, font));
document.close();
System.out.println("PDF generated successfully!");
}
}
Result are render not correct:
It should be displayed like that: លេខ
- Lingua principale
- Java
- Stelle
- 4.4k
- Fork
- 714
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LibrePDF/OpenPDF
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
IndexOutOfBoundsException in PdfReaderForse già presa @andreasrosdalw l’ha presa 92 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
`PdfSmartCopy` can take effectively unbounded time on nested shared Form XObjectsForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
Tutte le issue di LibrePDF/OpenPDF
Issue simili
-
:Search Relevance/Vectors >test-failure needs:risk Team:Search Relevance
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
elastic/elasticsearch#163668 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
agent:working bug follow-up lane:auto
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Sanne/incus-spawn#1765 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Mend: dependency security vulnerability untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
opensearch-project/data-prepper#7219 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno