Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

PDF Khmer Unicode Font Not Rendering Correctly

Đang mở
#1,264 4 bình luận 3 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
backend, computer-graphics

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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: លេខ

Ngôn ngữ chính
Java
Star
4.4k
Fork
714
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của LibrePDF/OpenPDF

Tất cả issue của LibrePDF/OpenPDF

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.