Colored emoji support
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 28/100
Hướng nghiên cứu
The issue includes a Flying Saucer example, font registrations, and simplified XHTML, but names no OpenPDF source files or tests. Start by tracing how OpenPDF handles embedded emoji font color data when rendering PDF text; then identify the relevant tests. Done means colored emoji render in color in the generated PDF, rather than black and white.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
We use openpdf through flying saucer and we would like to be able to render UTF-8 colored emoji. Until now we are juste able to render them in black and white (or the unique color chosen for the font).
We tried with :
- Roboto One Color -> nothing is rendered
- Roboto One B&W -> rendered in b&w (normal)
- Emoji One Color -> rendered in b&w
I assume that currently openpdf don't take into account the color info in the emoji font. Is it right or am I just doing something wrong ?
Here is the code used to create the pdf from the html
final var processedHtml = templateProcessor.process(templateName, parameters);
try (var os = new ByteArrayOutputStream()) {
final var renderer = new ITextRenderer();
renderer.setDocumentFromString(addTagWhenDetectingEmoji(processedHtml.replaceAll(xml10pattern, "")));
renderer.getFontResolver().addFont("templates/fonts/Roboto-Regular.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
renderer.getFontResolver().addFont("templates/fonts/EmojiOneColor.otf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
renderer.layout();
renderer.createPDF(os, true);
renderer.finishPDF();
return os.toByteArray();
} catch (IOException e) {
throw new PDFGenerationException("Cannot open FileOutputStream", e);
}
A simplified html given as input
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Bulletins</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<table class="w100">
<tr>
<td class="smallerBottomTableBorder"><h2>Avis du conseil de classe</h2></td>
</tr>
<tr>
<td class="text-justify line-return"><span >salut <span style="font-family: 'EmojiOne', sans-serif;">😃</span></span></td>
</tr>
</table>
</body>
</html>
Describe the solution you'd like
Adding the ability to render UTF-8 colored emoji in openpdf
Describe alternatives you've considered
Keeping the emoji in black and white
Additional context
/
- 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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của LibrePDF/OpenPDF
-
Bump brotli4j to 1.24.0Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
IndexOutOfBoundsException in PdfReaderCó thể đã có người làm @andreasrosdalw đã nhận 96 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
`PdfSmartCopy` can take effectively unbounded time on nested shared Form XObjectsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
Tất cả issue của LibrePDF/OpenPDF
Issue tương tự
-
Invalid If-Modified-Since or If-Unmodified-Since header results in 500 with Request.evaluatePreconditions()Có thể đã có người làm @pschaub đã nhận hôm nay. Đang mởkind/bug triage/needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
objectionary/eo#9764 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/doris#69919 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
checkstyle/checkstyle#22354 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
frankframework/frankframework#11966 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày