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>.
This commit is contained in:
TANAKA Takuji 2023-12-29 13:56:37 +00:00 committed by G. Branden Robinson
parent f7ca7ae9dd
commit 26dbf12ff0
4 changed files with 105 additions and 0 deletions

View File

@ -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

View File

@ -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 \

View File

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

View File

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