From 677f06d48f48967eb01fa0689b2be0ad5a0f502d Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Mon, 4 Aug 2025 16:15:31 +0200 Subject: [PATCH] RHEL-68430 texttopdf omits Chinese characters when creating PDF documents Resolves: RHEL-68430 --- ....ac-Make-CJK-fonts-name-configurable.patch | 80 +++++++++++++++++++ libcupsfilters.spec | 10 ++- 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 0001-configure.ac-Make-CJK-fonts-name-configurable.patch diff --git a/0001-configure.ac-Make-CJK-fonts-name-configurable.patch b/0001-configure.ac-Make-CJK-fonts-name-configurable.patch new file mode 100644 index 0000000..76769e0 --- /dev/null +++ b/0001-configure.ac-Make-CJK-fonts-name-configurable.patch @@ -0,0 +1,80 @@ +diff --git a/Makefile.am b/Makefile.am +index b338086..fb69410 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -21,7 +21,9 @@ EXTRA_DIST = \ + $(doc_DATA) \ + autogen.sh \ + config.rpath \ +- libcupsfilters.pc.in ++ libcupsfilters.pc.in \ ++ pdf.utf-8.heavy.in \ ++ pdf.utf-8.simple.in + + EXTRA_DIST += \ + data/makePDFfromPS.sh \ +diff --git a/charset/pdf.utf-8.heavy b/charset/pdf.utf-8.heavy.in +similarity index 98% +rename from charset/pdf.utf-8.heavy +rename to charset/pdf.utf-8.heavy.in +index a610af0..6815388 100644 +--- a/charset/pdf.utf-8.heavy ++++ b/charset/pdf.utf-8.heavy.in +@@ -36,5 +36,5 @@ charset utf8 + 1E00 1EFF ltor single CourierNew CourierNew:bold CourierNew:italic CourierNew:bold:italic + 2000 21FF ltor single DejaVuSansMono DejaVuSansMono:bold DejaVuSansMono:oblique DejaVuSansMono:bold:oblique + 2200 23FF ltor single Symbol +-3000 9FFF ltor double ARPLUMingCN ++3000 9FFF ltor double @CJKFONTS@ + #0400 04FF ltor single FreeMono FreeMono:bold FreeMono:oblique FreeMono:bold:oblique +diff --git a/charset/pdf.utf-8.simple b/charset/pdf.utf-8.simple.in +similarity index 97% +rename from charset/pdf.utf-8.simple +rename to charset/pdf.utf-8.simple.in +index f7d3adf..d66aa29 100644 +--- a/charset/pdf.utf-8.simple ++++ b/charset/pdf.utf-8.simple.in +@@ -30,4 +30,4 @@ charset utf8 + + 0000 04FF ltor single monospace monospace:bold monospace:oblique monospace:bold:oblique + 0500 05FF rtol single monospace +-3000 9FFF ltor double ARPLUmingCN ++3000 9FFF ltor double @CJKFONTS@ +diff --git a/configure.ac b/configure.ac +index bdba43d..fa53548 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -408,12 +408,26 @@ CXXFLAGS="$CXXFLAGS -D_GNU_SOURCE -DPOINTERHOLDER_TRANSITION=0" + # See /usr/include/qpdf/PointerHolder.hh + CXXFLAGS="$CXXFLAGS -std=c++17" + ++# ========= ++# CJK FONTS ++# ========= ++AC_ARG_WITH([cjk-fonts], ++ [AS_HELP_STRING([--with-cjk-fonts=value], [Set font name for CJK fonts (default: ARPLUmingCN).])], ++ [AS_IF([test "x$withval" != "x" -a "x$withval" != "xyes" -a "x$withval" != "xno"], ++ [CJKFONTS="$withval"], ++ [CJKFONTS="ARPLUmingCN"])], ++ [CJKFONTS="ARPLUmingCN"]) ++ ++AC_SUBST([CJKFONTS]) ++ + # ===================== + # Prepare all .in files + # ===================== + AC_CONFIG_FILES([ + libcupsfilters.pc + Makefile ++ charset/pdf.utf-8.heavy ++ charset/pdf.utf-8.simple + ]) + AC_OUTPUT + +@@ -442,5 +456,6 @@ Build configuration: + dbus: ${enable_dbus} + werror: ${enable_werror} + test-font: ${with_test_font_path} ++ cjk-fonts: ${CJKFONTS} + ============================================================================== + ]) diff --git a/libcupsfilters.spec b/libcupsfilters.spec index 3752096..30e47d1 100644 --- a/libcupsfilters.spec +++ b/libcupsfilters.spec @@ -4,7 +4,7 @@ Name: libcupsfilters Epoch: 1 Version: 2.0.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Library for developing printing filters # the CUPS exception text is the same as LLVM exception, so using that name with # agreement from legal team @@ -26,6 +26,8 @@ Patch003: 0001-cfgetprinterattributes5-validate-response-attributes.patch Patch004: 0001-Fix-issues-reported-by-OpenScanHub-79.patch # https://github.com/OpenPrinting/libcupsfilters/pull/80 Patch005: 0001-bannertopdf.c-Fix-segfault-when-printing-banners-tes.patch +# RHEL-68430 texttopdf omits Chinese characters when creating PDF documents +Patch0006: 0001-configure.ac-Make-CJK-fonts-name-configurable.patch # for generating configure and Makefile scripts in autogen.h @@ -127,7 +129,8 @@ Development files for OpenPrinting cupsfilters library. --disable-rpath\ --disable-silent-rules\ --disable-static\ - --enable-dbus + --enable-dbus \ + --with-cjk-fonts=droidsansfallback # fix rpmlint error about linking to libraries, but not actually using their functions # it happens when the required libraries uses pkgconfig - pkgconfig file doesn't know @@ -203,6 +206,9 @@ rm -f %{buildroot}%{_pkgdocdir}/{LICENSE,COPYING,NOTICE} %changelog +* Mon Aug 04 2025 Zdenek Dohnal - 1:2.0.0-11 +- RHEL-68430 texttopdf omits Chinese characters when creating PDF documents + * Wed Feb 12 2025 Zdenek Dohnal - 1:2.0.0-10 - RHEL-71935 Fix several important issues reported by OSH