Skip to content

Commit

Permalink
dvipdfmx: VF fallback to OFM for (u)pTeX
Browse files Browse the repository at this point in the history
The rule for virtual fonts (VF) fallback is extended:
If a VF has no entry of a codepoint and the first
MAPFONT designates an OFM for (u)pTeX, then we designate the
glyph (usually with a fullwidth metric) of the same codepoint
with the same metrics of the codepoint in the OFM.

git-svn-id: svn://tug.org/texlive/trunk/Build/source@66965 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
t-tk committed Apr 29, 2023
1 parent a187445 commit eb706d4
Show file tree
Hide file tree
Showing 19 changed files with 5,939 additions and 27 deletions.
18 changes: 18 additions & 0 deletions texk/dvipdfm-x/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
2023-04-29 TANAKA Takuji <ttk@t-lab.opal.ne.jp>

* {vf,tfm}.c:
Fallback multibyte characters in virtual fonts to
OFM fonts for (u)pTeX.
https://github.com/texjporg/tex-jp-build/issues/99
* configure.ac: version 20230429.
* dvipdfmx-upjf.test, Makefile_upjf, tests/upjf-r00.{ofm,opl},
tests/upjv-r00.{ofm,opl}, tests/upjf1-r.{tfm,pl},
tests/upjf1_{full,omit}.{vf,zvp0}, Makefile.am:
Add new tests for fallback virtual font to OFM.

The rule for virtual fonts (VF) fallback is extended:
If a VF has no entry of a codepoint and the first
MAPFONT designates an OFM for (u)pTeX, then we designate the
glyph (usually with a fullwidth metric) of the same codepoint
with the same metrics of the codepoint in the OFM.

2023-03-09 Karl Berry <karl@tug.org>

* TL'23 release.
Expand Down
7 changes: 6 additions & 1 deletion texk/dvipdfm-x/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ EXTRA_DIST += tests/upjv_full.vf tests/upjv_omit.vf
EXTRA_DIST += tests/upjv-r.tfm tests/upjv-g.tfm tests/upjv.tfm tests/UPJF-UTF16-V
EXTRA_DIST += tests/upjf-g00.opl tests/upjf-g00.ofm
EXTRA_DIST += tests/upjv-g00.opl tests/upjv-g00.ofm
DISTCLEANFILES += upjf.vf upjv.vf upjf-g.ofm upjv-g.ofm upjf*.pdf
EXTRA_DIST += tests/upjf-r00.opl tests/upjf-r00.ofm
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
##
EXTRA_DIST += tests/fullmap.dvi tests/fullmap.tex
9 changes: 7 additions & 2 deletions texk/dvipdfm-x/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,8 @@ cmapdatadir = $(datarootdir)/texmf-dist/fonts/cmap/dvipdfmx
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-g.ofm upjv-g.ofm upjf*.pdf
ttc*.pdf upjf.vf upjv.vf upjf-*.ofm upjv-*.ofm upjf-*.tfm \
upjf*.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 \
Expand All @@ -848,7 +849,11 @@ EXTRA_DIST = $(TESTS) tests/dvipdfmx.cfg tests/psfonts.map \
tests/upjv_full.vf tests/upjv_omit.vf tests/upjv-r.tfm \
tests/upjv-g.tfm tests/upjv.tfm tests/UPJF-UTF16-V \
tests/upjf-g00.opl tests/upjf-g00.ofm tests/upjv-g00.opl \
tests/upjv-g00.ofm tests/fullmap.dvi tests/fullmap.tex
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/fullmap.dvi \
tests/fullmap.tex
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am

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.71 for dvipdfm-x (TeX Live) 20220710.
# Generated by GNU Autoconf 2.71 for dvipdfm-x (TeX Live) 20230429.
#
# Report bugs to <dvipdfmx@tug.org>.
#
Expand Down Expand Up @@ -629,8 +629,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dvipdfm-x (TeX Live)'
PACKAGE_TARNAME='dvipdfm-x--tex-live-'
PACKAGE_VERSION='20220710'
PACKAGE_STRING='dvipdfm-x (TeX Live) 20220710'
PACKAGE_VERSION='20230429'
PACKAGE_STRING='dvipdfm-x (TeX Live) 20230429'
PACKAGE_BUGREPORT='dvipdfmx@tug.org'
PACKAGE_URL=''

Expand Down Expand Up @@ -1396,7 +1396,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) 20220710 to adapt to many kinds of systems.
\`configure' configures dvipdfm-x (TeX Live) 20230429 to adapt to many kinds of systems.

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

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

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

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

Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2354,7 +2354,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 20220710, which was
It was created by dvipdfm-x (TeX Live) $as_me 20230429, which was
generated by GNU Autoconf 2.71. Invocation command line was

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

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


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

lt_cl_version="\
dvipdfm-x (TeX Live) config.lt 20220710
dvipdfm-x (TeX Live) config.lt 20230429
configured by $0, generated by GNU Autoconf 2.71.

Copyright (C) 2011 Free Software Foundation, Inc.
Expand Down Expand Up @@ -17723,7 +17723,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 20220710, which was
This file was extended by dvipdfm-x (TeX Live) $as_me 20230429, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -17795,7 +17795,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 20220710
dvipdfm-x (TeX Live) config.status 20230429
configured by $0, generated by GNU Autoconf 2.71,
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)], [20220710], [dvipdfmx@tug.org])
AC_INIT([dvipdfm-x (TeX Live)], [20230429], [dvipdfmx@tug.org])
AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([agl.c])
AC_CONFIG_AUX_DIR([../../build-aux])
Expand Down
54 changes: 49 additions & 5 deletions texk/dvipdfm-x/dvipdfmx-upjf.test
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#! /bin/sh -vx
# $Id$
# Copyright 2020-2022 Japanese TeX Development Community <issue@texjp.org>
# Copyright 2020-2023 Japanese TeX Development Community <issue@texjp.org>
# You may freely use, modify and/or distribute this file.

TEXMFCNF=$srcdir/../kpathsea
TFMFONTS="$srcdir/tests;$srcdir/data"
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;."
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
rm -f upjf.vf upjv.vf upjf-g.ofm upjv-g.ofm upjf-r.ofm upjv-r.ofm upjf-r.tfm

echo "*** dvipdfmx: test for upjf_full.pdf" && echo \
&& cp $srcdir/tests/upjf_full.vf ./upjf.vf \
Expand All @@ -37,8 +37,52 @@ echo "*** dvipdfmx: test for upjf_omit.pdf" && echo \

cmp ./upjf_full.pdf ./upjf_omit.pdf || failed="$failed dvipdfmx-upjf-cmp"

echo "*** dvipdfmx: test for upjf_omit2.pdf" && echo \
&& cp $srcdir/tests/upjf-r00.ofm ./upjf-r.ofm \
&& cp $srcdir/tests/upjv-r00.ofm ./upjv-r.ofm \
&& ./xdvipdfmx --dvipdfmx -vv --pdfm-str-utf8 -f upjf.map -o upjf.pdf $srcdir/tests/upjf.dvi \
&& mv ./upjf.pdf ./upjf_omit2.pdf \
&& echo && echo "dvipdfmx-upjf-vf_omit2 tests OK" && echo \
|| failed="$failed dvipdfmx-upjf-vf_omit2"

cmp ./upjf_full.pdf ./upjf_omit2.pdf || failed="$failed dvipdfmx-upjf-cmp2"


rm -f upjf-r.ofm upjv-r.ofm

echo "*** dvipdfmx: test for upjf1_full.pdf" && echo \
&& cp $srcdir/tests/upjf1_full.vf ./upjf.vf \
&& cp $srcdir/tests/upjv_full.vf ./upjv.vf \
&& cp $srcdir/tests/upjf1-r.tfm ./upjf-r.tfm \
&& ./xdvipdfmx --dvipdfmx -vv --pdfm-str-utf8 -f upjf.map -o upjf1.pdf $srcdir/tests/upjf.dvi \
&& mv ./upjf1.pdf ./upjf1_full.pdf \
&& echo && echo "dvipdfmx-upjf1-vf_full tests OK" && echo \
|| failed="$failed dvipdfmx-upjf1-vf_full"

echo "*** dvipdfmx: test for upjf1_omit.pdf" && echo \
&& cp $srcdir/tests/upjf1_omit.vf ./upjf.vf \
&& cp $srcdir/tests/upjv_omit.vf ./upjv.vf \
&& ./xdvipdfmx --dvipdfmx -vv --pdfm-str-utf8 -f upjf.map -o upjf1.pdf $srcdir/tests/upjf.dvi \
&& mv ./upjf1.pdf ./upjf1_omit.pdf \
&& echo && echo "dvipdfmx-upjf1-vf_omit tests OK" && echo \
|| failed="$failed dvipdfmx-upjf1-vf_omit"

cmp ./upjf1_full.pdf ./upjf1_omit.pdf || failed="$failed dvipdfmx-upjf1-cmp"

rm -f upjf-r.tfm

echo "*** dvipdfmx: test for upjf1_omit2.pdf" && echo \
&& cp $srcdir/tests/upjf-r00.ofm ./upjf-r.ofm \
&& cp $srcdir/tests/upjv-r00.ofm ./upjv-r.ofm \
&& ./xdvipdfmx --dvipdfmx -vv --pdfm-str-utf8 -f upjf.map -o upjf1.pdf $srcdir/tests/upjf.dvi \
&& mv ./upjf1.pdf ./upjf1_omit2.pdf \
&& echo && echo "dvipdfmx-upjf1-vf_omit2 tests OK" && echo \
|| failed="$failed dvipdfmx-upjf1-vf_omit2"

cmp ./upjf1_full.pdf ./upjf1_omit2.pdf || failed="$failed dvipdfmx-upjf1-cmp"


test -z "$failed" && exit 0
echo
echo "failed tests:$failed"
exit 1

15 changes: 15 additions & 0 deletions texk/dvipdfm-x/tests/Makefile_upjf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ upjf-g00.ofm:
upjv-g00.ofm:
opl2ofm upjv-g00.opl

upjf-r00.ofm:
opl2ofm upjf-r00.opl

upjv-r00.ofm:
opl2ofm upjv-r00.opl

upjf1-r.tfm:
uppltotf upjf1-r.pl

upjf1_full.vf:
jfmutil zvp02vf upjf1_full.zvp0

upjf1_omit.vf:
jfmutil zvp02vf upjf1_omit.zvp0

upjf.dvi: upjf.tex
uplatex upjf.tex
dvispc -a upjf.dvi upjf.dvitxt
Expand Down
Binary file added texk/dvipdfm-x/tests/upjf-r00.ofm
Binary file not shown.
38 changes: 38 additions & 0 deletions texk/dvipdfm-x/tests/upjf-r00.opl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(OFMLEVEL H 1)
(FONTDIR TL)
(FAMILY UPJF)
(FACE F MRR)
(CODINGSCHEME UNSPECIFIED)
(DESIGNSIZE R 10.0)
(COMMENT DESIGNSIZE IS IN POINTS)
(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
(CHECKSUM H 0)
(SEVENBITSAFEFLAG FALSE)
(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)
)
(CHARACTER H 6674
(CHARWD R 1.0)
(CHARHT R 0.9)
(CHARDP R 0.1)
)
(CHARACTER H 96EA
(CHARWD R 1.0)
(CHARHT R 0.9)
(CHARDP R 0.1)
)
(CHARREPEAT H FF00 H FF
(CHARWD R 0.5)
(CHARHT R 0.9)
(CHARDP R 0.1)
)
(CHARACTER H 20B9F
(CHARWD R 1.0)
(CHARHT R 0.9)
(CHARDP R 0.1)
)
38 changes: 38 additions & 0 deletions texk/dvipdfm-x/tests/upjf1-r.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(COMMENT THIS IS A KANJI FORMAT FILE)
(FAMILY UNSPECIFIED)
(FACE F MRR)
(CODINGSCHEME UNSPECIFIED)
(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.0)
(SHRINK R 0.0)
(XHEIGHT R 1.0)
(QUAD R 1.0)
(EXTRASPACE R 0.0)
(EXTRASTRETCH R 0.0)
(EXTRASHRINK R 0.0)
)
(CHARSINTYPE O 1
。 「 」 、 ・ ヲ ァ ィ ゥ ェ
ォ ャ ュ ョ ッ ー ア イ ウ エ
オ カ キ ク ケ コ サ シ ス セ
ソ タ チ ツ テ ト ナ ニ ヌ ネ
ノ ハ ヒ フ ヘ ホ マ ミ ム メ
モ ヤ ユ ヨ ラ リ ル レ ロ ワ
ン ゙ ゚
)
(TYPE O 0
(CHARWD R 1.0)
(CHARHT R 0.9)
(CHARDP R 0.1)
)
(TYPE O 1
(CHARWD R 0.5)
(CHARHT R 0.9)
(CHARDP R 0.1)
)
Binary file added texk/dvipdfm-x/tests/upjf1-r.tfm
Binary file not shown.
Binary file added texk/dvipdfm-x/tests/upjf1_full.vf
Binary file not shown.
Loading

0 comments on commit eb706d4

Please sign in to comment.