Skip to content

Commit

Permalink
dvipdfm-x: Support upTeX new encoding for combining characters via vi…
Browse files Browse the repository at this point in the history
…rtual fonts

git-svn-id: svn://tug.org/texlive/trunk/Build/source@71094 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
t-tk committed Apr 27, 2024
1 parent f2c9992 commit a430f4d
Show file tree
Hide file tree
Showing 27 changed files with 6,426 additions and 100 deletions.
14 changes: 14 additions & 0 deletions texk/dvipdfm-x/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2024-04-27 TANAKA Takuji <[email protected]>

* tfm.{c,h}, vf.c: Support upTeX new encoding
for combining characters via virtual fonts.
* cidtype2.c: Enable to treat Combining Katakana-Hiragana
(Semi-)Voiced Sound Mark in cid_to_code().
* dvipdfmx-upjf2.test, tests/upjf2.{tex,dvi}, tests/upj{f,v}.pl,
tests/upj{f,v}-c.{pl,tfm}, tests/upjf1-r.{pl,tfm},
tests/upj{f,v}2_full.{vf,zvp0}, tests/upjf{,-hara}.map,
tests/Makefile_upjf, Makefile.am: Add a test for
upTeX new encoding. It requires HaranoAji fonts.
https://github.com/texjporg/tex-jp-build/issues/46
* configure.ac: version 20240427.

2024-04-09 TANAKA Takuji <[email protected]>

* dvipdfmx-incl.test, tests/multi_incl.{tex,dvi},
Expand Down
13 changes: 10 additions & 3 deletions texk/dvipdfm-x/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ DISTCLEANFILES = config.force
TESTS = xdvipdfmx.test xdvipdfm-ann.test xdvipdfm-bad.test xdvipdfm-bb.test
TESTS += xdvipdfm-bkm.test xdvipdfm-psz.test xdvipdfm-ptx.test xdvipdfm-res.test
TESTS += xdvipdfm-rev.test xdvipdfm-ttc.test
TESTS += dvipdfmx-upjf.test dvipdfmx-incl.test
TESTS += dvipdfmx-upjf.test dvipdfmx-upjf2.test dvipdfmx-incl.test
xdvipdfmx.log xdvipdfm-ann.log xdvipdfm-bad.log xdvipdfm-bb.log \
xdvipdfm-bkm.log xdvipdfm-psz.log xdvipdfm-ptx.log xdvipdfm-res.log \
xdvipdfm-rev.log xdvipdfm-ttc.log \
dvipdfmx-upjf.log dvipdfmx-incl.log: xdvipdfmx$(EXEEXT)
dvipdfmx-upjf.log dvipdfmx-upjf2.log dvipdfmx-incl.log: \
xdvipdfmx$(EXEEXT)
EXTRA_DIST = $(TESTS)
## xdvipdfmx.test
EXTRA_DIST += tests/dvipdfmx.cfg tests/psfonts.map
Expand Down Expand Up @@ -307,7 +308,13 @@ EXTRA_DIST += tests/upjv-r00.opl tests/upjv-r00.ofm
EXTRA_DIST += tests/upjf1-r.pl tests/upjf1-r.tfm
EXTRA_DIST += tests/upjf1_full.zvp0 tests/upjf1_full.vf
EXTRA_DIST += tests/upjf1_omit.zvp0 tests/upjf1_omit.vf
DISTCLEANFILES += upjf.vf upjv.vf upjf-*.ofm upjv-*.ofm upjf-*.tfm upjf*.pdf
DISTCLEANFILES += upjf.vf upjv.vf upjf-*.ofm upjv-*.ofm upjf-*.tfm upjf_*.pdf upjf1_*.pdf
## dvipdfmx-upjf2.test
EXTRA_DIST += tests/upjf2_full.zvp0 tests/upjf2_full.vf
EXTRA_DIST += tests/upjv2_full.zvp0 tests/upjv2_full.vf
EXTRA_DIST += tests/upjf-c.pl tests/upjf-c.tfm
EXTRA_DIST += tests/upjv-c.pl tests/upjv-c.tfm
DISTCLEANFILES += upjf2_*.pdf
## dvipdfmx-incl.test
EXTRA_DIST += tests/multi_incl.dvi tests/multi_incl.tex tests/sue-mp.pdf
DISTCLEANFILES += multi_incl.pdf
Expand Down
17 changes: 11 additions & 6 deletions texk/dvipdfm-x/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -822,11 +822,12 @@ dist_cmapdata_DATA = data/EUC-UCS2
DISTCLEANFILES = config.force image*.pdf xbmc*.pdf annot*.pdf pic*.* \
bookm*.pdf paper*.pdf ptex*.pdf resrc*.pdf reverse.pdf \
ttc*.pdf upjf.vf upjv.vf upjf-*.ofm upjv-*.ofm upjf-*.tfm \
upjf*.pdf multi_incl.pdf
upjf_*.pdf upjf1_*.pdf upjf2_*.pdf multi_incl.pdf
TESTS = xdvipdfmx.test xdvipdfm-ann.test xdvipdfm-bad.test \
xdvipdfm-bb.test xdvipdfm-bkm.test xdvipdfm-psz.test \
xdvipdfm-ptx.test xdvipdfm-res.test xdvipdfm-rev.test \
xdvipdfm-ttc.test dvipdfmx-upjf.test dvipdfmx-incl.test
xdvipdfm-ttc.test dvipdfmx-upjf.test dvipdfmx-upjf2.test \
dvipdfmx-incl.test
EXTRA_DIST = $(TESTS) tests/dvipdfmx.cfg tests/psfonts.map \
tests/cmr10.pfb tests/cmr10.tfm tests/image.dvi \
tests/image.tex tests/xbmc.dvi tests/xbmc.tex \
Expand All @@ -852,9 +853,12 @@ EXTRA_DIST = $(TESTS) tests/dvipdfmx.cfg tests/psfonts.map \
tests/upjv-g00.ofm tests/upjf-r00.opl tests/upjf-r00.ofm \
tests/upjv-r00.opl tests/upjv-r00.ofm tests/upjf1-r.pl \
tests/upjf1-r.tfm tests/upjf1_full.zvp0 tests/upjf1_full.vf \
tests/upjf1_omit.zvp0 tests/upjf1_omit.vf tests/multi_incl.dvi \
tests/multi_incl.tex tests/sue-mp.pdf tests/fullmap.dvi \
tests/fullmap.tex
tests/upjf1_omit.zvp0 tests/upjf1_omit.vf \
tests/upjf2_full.zvp0 tests/upjf2_full.vf \
tests/upjv2_full.zvp0 tests/upjv2_full.vf tests/upjf-c.pl \
tests/upjf-c.tfm tests/upjv-c.pl tests/upjv-c.tfm \
tests/multi_incl.dvi tests/multi_incl.tex tests/sue-mp.pdf \
tests/fullmap.dvi tests/fullmap.tex
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am

Expand Down Expand Up @@ -2026,7 +2030,8 @@ config.force: $(ZLIB_DEPEND) $(LIBPNG_DEPEND) $(KPATHSEA_DEPEND) $(LIBPAPER_DEPE
xdvipdfmx.log xdvipdfm-ann.log xdvipdfm-bad.log xdvipdfm-bb.log \
xdvipdfm-bkm.log xdvipdfm-psz.log xdvipdfm-ptx.log xdvipdfm-res.log \
xdvipdfm-rev.log xdvipdfm-ttc.log \
dvipdfmx-upjf.log dvipdfmx-incl.log: xdvipdfmx$(EXEEXT)
dvipdfmx-upjf.log dvipdfmx-upjf2.log dvipdfmx-incl.log: \
xdvipdfmx$(EXEEXT)

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
Expand Down
89 changes: 27 additions & 62 deletions texk/dvipdfm-x/cidtype2.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,73 +463,38 @@ cid_to_code (CMap *cmap, CID cid, int unicode_cmap, int32_t *puvs)
return (int32_t) outbuf[0];
else if (outbytesleft == 30)
return (int32_t) (outbuf[0] << 8|outbuf[1]);
else if (outbytesleft == 28) {
if (unicode_cmap) {
/* We assume the output encoding is UTF-16. */
int32_t uc, uvs;
const unsigned char *endptr;

p = outbuf;
endptr = p + 4;
uc = UC_UTF16BE_decode_char(&p, endptr);
if (p == endptr)
return uc; /* single Unicode characters */
/* Check following Variation Selectors */
uvs = UC_UTF16BE_decode_char(&p, endptr);
if (p == endptr && uvs >= 0xfe00 && uvs <= 0xfe0f) {
else if (outbytesleft == 28 && !unicode_cmap)
return (int32_t) (outbuf[0] << 24)|(outbuf[1] << 16)|(outbuf[2] << 8)|outbuf[3];
else if ((outbytesleft == 28 || outbytesleft == 26 || outbytesleft == 24)
&& unicode_cmap) {
/* We assume the output encoding is UTF-16. */
int32_t uc, uvs;
const unsigned char *endptr;

p = outbuf;
endptr = p + 32 - outbytesleft;
uc = UC_UTF16BE_decode_char(&p, endptr);
if (p == endptr)
return uc; /* single Unicode characters */
/* Check following Variation Selectors */
uvs = UC_UTF16BE_decode_char(&p, endptr);
if (p == endptr) {
if (uvs >= 0xfe00 && uvs <= 0xfe0f) {
/* Standardized Variation Sequence */
*puvs = uvs;
return uc;
} else if (uvs >= 0xe0100 && uvs <= 0xe01ef) {
/* Ideographic Variation Sequence */
*puvs = uvs;
return uc;
} else if (uvs == 0x3099 || uvs == 0x309a) {
/* Combining Katakana-Hiragana (Semi-)Voiced Sound Mark */
*puvs = uvs;
return uc;
}
WARN("CID=%u mapped to non-single Unicode characters...", cid);
return -1;
} else {
return (outbuf[0] << 24)|(outbuf[1] << 16)|(outbuf[2] << 8)|outbuf[3];
}
} else if (outbytesleft == 26) { /* 6 bytes sequence */
if (unicode_cmap) {
/* We assume the output encoding is UTF-16. */
int32_t uc, uvs;
const unsigned char *endptr;

p = outbuf;
endptr = p + 6;
uc = UC_UTF16BE_decode_char(&p, endptr);
uvs = UC_UTF16BE_decode_char(&p, endptr);
if (p == endptr) {
if (uvs >= 0xfe00 && uvs <= 0xfe0f) {
/* Standardized Variation Sequence */
*puvs = uvs;
return uc;
} else if (uvs >= 0xe0100 && uvs <= 0xe01ef) {
/* Ideographic Variation Sequence */
*puvs = uvs;
return uc;
}
}
WARN("CID=%u mapped to non-single Unicode characters...", cid);
return -1;
}
} else if (outbytesleft == 24) { /* 8 bytes sequence */
if (unicode_cmap) {
/* We assume the output encoding is UTF-16. */
int32_t uc, uvs;
const unsigned char *endptr;

p = outbuf;
endptr = p + 8;
uc = UC_UTF16BE_decode_char(&p, endptr);
uvs = UC_UTF16BE_decode_char(&p, endptr);
if (p == endptr) {
if (uvs >= 0xe0100 && uvs <= 0xe01ef) {
/* Ideographic Variation Sequence */
*puvs = uvs;
return uc;
}
}
WARN("CID=%u mapped to non-single Unicode characters...", cid);
return -1;
}
WARN("CID=%u mapped to non-single Unicode characters...", cid);
return -1;
}

return -1;
Expand Down
22 changes: 11 additions & 11 deletions texk/dvipdfm-x/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.72 for dvipdfm-x (TeX Live) 20240305.
# Generated by GNU Autoconf 2.72 for dvipdfm-x (TeX Live) 20240427.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -614,8 +614,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dvipdfm-x (TeX Live)'
PACKAGE_TARNAME='dvipdfm-x--tex-live-'
PACKAGE_VERSION='20240305'
PACKAGE_STRING='dvipdfm-x (TeX Live) 20240305'
PACKAGE_VERSION='20240427'
PACKAGE_STRING='dvipdfm-x (TeX Live) 20240427'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -1383,7 +1383,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
'configure' configures dvipdfm-x (TeX Live) 20240305 to adapt to many kinds of systems.
'configure' configures dvipdfm-x (TeX Live) 20240427 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1455,7 +1455,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20240305:";;
short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20240427:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1586,7 +1586,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
dvipdfm-x (TeX Live) configure 20240305
dvipdfm-x (TeX Live) configure 20240427
generated by GNU Autoconf 2.72

Copyright (C) 2023 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2367,7 +2367,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by dvipdfm-x (TeX Live) $as_me 20240305, which was
It was created by dvipdfm-x (TeX Live) $as_me 20240427, which was
generated by GNU Autoconf 2.72. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -8928,7 +8928,7 @@ fi

# Define the identity of the package.
PACKAGE='dvipdfm-x--tex-live-'
VERSION='20240305'
VERSION='20240427'


printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
Expand Down Expand Up @@ -15995,7 +15995,7 @@ Usage: $0 [OPTIONS]
Report bugs to <[email protected]>."

lt_cl_version="\
dvipdfm-x (TeX Live) config.lt 20240305
dvipdfm-x (TeX Live) config.lt 20240427
configured by $0, generated by GNU Autoconf 2.72.

Copyright (C) 2011 Free Software Foundation, Inc.
Expand Down Expand Up @@ -17938,7 +17938,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by dvipdfm-x (TeX Live) $as_me 20240305, which was
This file was extended by dvipdfm-x (TeX Live) $as_me 20240427, which was
generated by GNU Autoconf 2.72. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -18010,7 +18010,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
dvipdfm-x (TeX Live) config.status 20240305
dvipdfm-x (TeX Live) config.status 20240427
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion texk/dvipdfm-x/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
AC_INIT([dvipdfm-x (TeX Live)], [20240407], [[email protected]])
AC_INIT([dvipdfm-x (TeX Live)], [20240427], [[email protected]])
AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([agl.c])
AC_CONFIG_AUX_DIR([../../build-aux])
Expand Down
46 changes: 46 additions & 0 deletions texk/dvipdfm-x/dvipdfmx-upjf2.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#! /bin/sh -vx
# $Id$
# Copyright 2020-2024 Japanese TeX Development Community <[email protected]>
# You may freely use, modify and/or distribute this file.

KpsDir=${KpsDir:-../kpathsea}
BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_kpsewhich=$KpsDir/kpsewhich$ExeExt
_xdvipdfmx=$BinDir/xdvipdfmx$ExeExt

TEXMFCNF=$srcdir/../kpathsea
TFMFONTS=".;$srcdir/tests;$srcdir/data"
T1FONTS="$srcdir/tests;$srcdir/data"
TEXFONTMAPS="$srcdir/tests;$srcdir/data"
DVIPDFMXINPUTS="$srcdir/tests;$srcdir/data"
TEXPICTS=$srcdir/tests
TEXFONTS=".;$srcdir/tests"
SOURCE_DATE_EPOCH=1588474800
export TEXMFCNF TFMFONTS T1FONTS TEXFONTMAPS DVIPDFMXINPUTS TEXPICTS TEXFONTS SOURCE_DATE_EPOCH

failed=

rm -f upjf.vf upjv.vf upjf-g.ofm upjv-g.ofm upjf-r.ofm upjv-r.ofm upjf-r.tfm

##### following tests require HaranoAji fonts #####

$_kpsewhich HaranoAjiMincho-Regular.otf
otfpath=`$_kpsewhich HaranoAjiMincho-Regular.otf` || exit 77
OPENTYPEFONTS=`echo $otfpath | sed -e 's,HaranoAjiMincho-Regular\.otf,,' -e 's,/fonts/opentype/.*$,/fonts/opentype//,'`
export OPENTYPEFONTS


echo "*** dvipdfmx: test for upjf2_full-hara.pdf" && echo \
&& cp $srcdir/tests/upjf2_full.vf ./upjf.vf \
&& cp $srcdir/tests/upjv2_full.vf ./upjv.vf \
&& $_xdvipdfmx --dvipdfmx -vv --pdfm-str-utf8 -f upjf-hara.map -o upjf2.pdf $srcdir/tests/upjf2.dvi \
&& mv ./upjf2.pdf ./upjf2_full-hara.pdf \
&& echo && echo "dvipdfmx-upjf2-vf_full-hara tests OK" && echo \
|| failed="$failed dvipdfmx-upjf2-vf_full-hara"


test -z "$failed" && exit 0
echo
echo "failed tests:$failed"
exit 1
20 changes: 20 additions & 0 deletions texk/dvipdfm-x/tests/Makefile_upjf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ upjf1_full.vf:
upjf1_omit.vf:
jfmutil zvp02vf upjf1_omit.zvp0

upjf2_full.vf:
jfmutil zvp02vf upjf2_full.zvp0

upjv2_full.vf:
jfmutil zvp02vf upjv2_full.zvp0

upjf-c.tfm:
uppltotf upjf-c.pl

upjv-c.tfm:
uppltotf upjv-c.pl

upjf.dvi: upjf.tex
uplatex upjf.tex
dvispc -a upjf.dvi upjf.dvitxt
Expand All @@ -55,3 +67,11 @@ upjf.dvi: upjf.tex
dvispc -x upjf.dvitxt upjf.dvi
rm upjf.dvitxt

upjf2.dvi: upjf2.tex
uplatex upjf2.tex
dvispc -a upjf2.dvi upjf2.dvitxt
sed -i '/xxx/d' upjf2.dvitxt
sed -i -e "4i xxx1 176 'pdf:docinfo<</Title(upTeXを試す)/Subject(시험)/Creator(LaTeX with hyperref)/Author(☃ ☀)/Producer(dvipdfm)/Keywords(超鏈接; ハイパーリンク; 하이퍼링크)>>'" upjf2.dvitxt
dvispc -x upjf2.dvitxt upjf2.dvi
rm upjf2.dvitxt

24 changes: 24 additions & 0 deletions texk/dvipdfm-x/tests/upjf-c.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(COMMENT THIS IS A KANJI FORMAT FILE)
(FAMILY UPJIS KANJI)
(FACE F MRR)
(CODINGSCHEME TEX KANJI TEXT)
(DESIGNSIZE R 10.0)
(COMMENT DESIGNSIZE IS IN POINTS)
(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
(CHECKSUM O 0)
(FONTDIMEN
(SLANT R 0.0)
(SPACE R 0.0)
(STRETCH R 0.1)
(SHRINK R 0.0)
(XHEIGHT R 1.0)
(QUAD R 1.0)
(EXTRASPACE R 0.25)
(EXTRASTRETCH R 0.2)
(EXTRASHRINK R 0.125)
)
(TYPE O 0
(CHARWD R 1.0)
(CHARHT R 0.88)
(CHARDP R 0.12)
)
Binary file added texk/dvipdfm-x/tests/upjf-c.tfm
Binary file not shown.
Loading

0 comments on commit a430f4d

Please sign in to comment.