groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 21/23: Support CJK fonts encoded in UTF-16 (6/6).


From: G. Branden Robinson
Subject: [groff] 21/23: Support CJK fonts encoded in UTF-16 (6/6).
Date: Thu, 21 Nov 2024 14:47:50 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 26dbf12ff0808169fedcc01a573280cdfba7c4ba
Author: TANAKA Takuji <ttk@t-lab.opal.ne.jp>
AuthorDate: Fri Dec 29 13:56:37 2023 +0000

    Support CJK fonts encoded in UTF-16 (6/6).
    
    * src/roff/groff/tests/dvi-device-smoke-test.sh:
    * src/roff/groff/tests/ps-device-smoke-test.sh: New tests exercise
      output drivers and their encodings of CJK characters.
    
    * src/roff/groff/groff.am (groff_TESTS): Run tests.
    
    Fixes <https://savannah.gnu.org/bugs/?62830>.
---
 ChangeLog                                     | 11 +++++++
 src/roff/groff/groff.am                       |  2 ++
 src/roff/groff/tests/dvi-device-smoke-test.sh | 46 +++++++++++++++++++++++++++
 src/roff/groff/tests/ps-device-smoke-test.sh  | 46 +++++++++++++++++++++++++++
 4 files changed, 105 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 41cef7b6d..6872fb29e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-11-20  TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+       Support CJK fonts encoded in UTF-16 (6/6).
+
+       * src/roff/groff/tests/dvi-device-smoke-test.sh:
+       * src/roff/groff/tests/ps-device-smoke-test.sh: New tests
+       exercise output drivers and their encodings of CJK characters.
+       * src/roff/groff/groff.am (groff_TESTS): Run tests.
+
+       Fixes <https://savannah.gnu.org/bugs/?62830>.
+
 2024-11-20  TANAKA Takuji <ttk@t-lab.opal.ne.jp>
 
        Support CJK fonts encoded in UTF-16 (5/6).  Ship font
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 65d9db50c..47fcd8116 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -67,6 +67,7 @@ groff_TESTS = \
   src/roff/groff/tests/draw-polygon.sh \
   src/roff/groff/tests/draw-spline.sh \
   src/roff/groff/tests/driver-C-and-G-options-work.sh \
+  src/roff/groff/tests/dvi-device-smoke-test.sh \
   src/roff/groff/tests/evc-request-produces-no-output-if-invalid.sh \
   src/roff/groff/tests/fp-request-does-not-traverse-directories.sh \
   src/roff/groff/tests/handle-special-input-code-points.sh \
@@ -81,6 +82,7 @@ groff_TESTS = \
   src/roff/groff/tests/msoquiet-request-works.sh \
   src/roff/groff/tests/output-request-works.sh \
   src/roff/groff/tests/pi-request-works.sh \
+  src/roff/groff/tests/ps-device-smoke-test.sh \
   src/roff/groff/tests/recognize-end-of-sentence.sh \
   src/roff/groff/tests/regression_savannah_56555.sh \
   src/roff/groff/tests/regression_savannah_58153.sh \
diff --git a/src/roff/groff/tests/dvi-device-smoke-test.sh 
b/src/roff/groff/tests/dvi-device-smoke-test.sh
new file mode 100755
index 000000000..d91bcfcaa
--- /dev/null
+++ b/src/roff/groff/tests/dvi-device-smoke-test.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# Copyright (C) 2022-2024 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail () {
+  echo ...FAILED >&2
+  fail=YES
+}
+
+# test for upTeX dvi with Japanese, grout output
+#   "さざ波" -> \343\201\225\343\201\226\346\263\242
+jstr='\343\201\225\343\201\226\346\263\242'
+echo "checking 'groff -Kutf8 -Tdvi -Z'" >&2
+printf ".ft JPM\n$jstr\n" | "$groff" -Kutf8 -Tdvi -Z | tr '\n' ';' \
+  | grep -q \
+    ';C *u3055;h *8000;C *u3055_3099;h *8000;C *u6CE2;h *8000;' \
+  || wail
+
+# test for upTeX dvi with Japanese, DVI output
+echo "checking 'groff -Kutf8 -Tdvi'" >&2
+printf ".ft JPM\n$jstr" | "$groff" -Kutf8 -Tdvi | od -tx1 \
+  | grep -q '81 30 55 81 30 56 81 6c e2' || wail
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
diff --git a/src/roff/groff/tests/ps-device-smoke-test.sh 
b/src/roff/groff/tests/ps-device-smoke-test.sh
new file mode 100755
index 000000000..2539ac3f0
--- /dev/null
+++ b/src/roff/groff/tests/ps-device-smoke-test.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# Copyright (C) 2022-2024 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+fail=
+
+wail () {
+  echo ...FAILED >&2
+  fail=YES
+}
+
+# test for PostScript with Japanese, grout output
+#   "さざ波" -> \343\201\225\343\201\226\346\263\242
+jstr='\343\201\225\343\201\226\346\263\242'
+echo "checking 'groff -Kutf8 -Tps -Z'" >&2
+printf ".ft JPM\n$jstr\n" | "$groff" -Kutf8 -Tps -Z | tr '\n' ';' \
+  | grep -q \
+    ';C *u3055;h *10000;C *u3055_3099;h *10000;C *u6CE2;h *10000;' \
+  || wail
+
+# test for PostScript with Japanese, PS output using UTF-16BE encoding
+echo "checking 'groff -Kutf8 -Tps'" >&2
+printf ".ft JPM\n$jstr\n" | "$groff" -Kutf8 -Tps \
+  | grep -q '/Ryumin-Light-UniJIS-UTF16-H SF<305530566CE2>' || wail
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]