Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

PDF Khmer Unicode Font Not Rendering Correctly

Aperta
#1,264 4 commenti 3 reazioni 0 assegnatari Vedi su GitHub

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

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

bug
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:

Image

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LibrePDF/OpenPDF

Tutte le issue di LibrePDF/OpenPDF

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.