From 60b5b72b9bff9fe39a3a5b784cc3aa6159276509 Mon Sep 17 00:00:00 2001 From: Takuji Tanaka Date: Sun, 12 Apr 2020 00:47:52 +0000 Subject: makejvf v20200412, option -O git-svn-id: svn://tug.org/texlive/trunk@54693 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/makejvf/ChangeLog | 10 ++++++++ Build/source/texk/makejvf/Makefile.am | 3 ++- Build/source/texk/makejvf/configure | 22 +++++++++--------- Build/source/texk/makejvf/configure.ac | 2 +- Build/source/texk/makejvf/main.c | 26 +++++++++++++-------- Build/source/texk/makejvf/makejvf.h | 2 +- Build/source/texk/makejvf/makejvf.test | 17 ++++++++++---- Build/source/texk/makejvf/tests/skipjfmp_omit.vf | Bin 0 -> 596 bytes Build/source/texk/makejvf/version.h | 2 +- Build/source/texk/makejvf/write.c | 28 +++++++++++++++++++---- 10 files changed, 79 insertions(+), 33 deletions(-) create mode 100644 Build/source/texk/makejvf/tests/skipjfmp_omit.vf (limited to 'Build') diff --git a/Build/source/texk/makejvf/ChangeLog b/Build/source/texk/makejvf/ChangeLog index 60453dd7293..d32e657e2f8 100644 --- a/Build/source/texk/makejvf/ChangeLog +++ b/Build/source/texk/makejvf/ChangeLog @@ -1,3 +1,13 @@ +2020-04-12 TANAKA Takuji + + * main.c, write.c, makejvf.h: + Add -O option: Omit entries in VF for characters with default metric. + * version.h, configure{,.ac}: Bump version. + * tests/skipjfmp_omit.vf: New test files. + * Makefile.am, makejvf.test: Add new tests. + Thanks to @aminophen for help. + https://github.com/texjporg/tex-jp-build/issues/99 + 2020-02-16 TANAKA Takuji * uniblock.c, main.c: Update references Unicode blocks Blocks-13.0.0.txt diff --git a/Build/source/texk/makejvf/Makefile.am b/Build/source/texk/makejvf/Makefile.am index cab51ca6c84..abacf534277 100644 --- a/Build/source/texk/makejvf/Makefile.am +++ b/Build/source/texk/makejvf/Makefile.am @@ -42,7 +42,8 @@ EXTRA_DIST += \ tests/gkhugeok.tfm \ tests/gkhugeok.vf \ tests/skipjfmp.tfm \ - tests/skipjfmp.vf + tests/skipjfmp.vf \ + tests/skipjfmp_omit.vf DISTCLEANFILES = min10.vf rml.tfm rmlv.tfm tmin10.vf testnewu.vf \ gkhugeok.vf skipjfmp.vf urml.tfm diff --git a/Build/source/texk/makejvf/configure b/Build/source/texk/makejvf/configure index d1a269deef8..17ef3f035ba 100755 --- a/Build/source/texk/makejvf/configure +++ b/Build/source/texk/makejvf/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for makejvf (TeX Live) 1.1a. +# Generated by GNU Autoconf 2.69 for makejvf (TeX Live) 20200412. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='makejvf (TeX Live)' PACKAGE_TARNAME='makejvf--tex-live-' -PACKAGE_VERSION='1.1a' -PACKAGE_STRING='makejvf (TeX Live) 1.1a' +PACKAGE_VERSION='20200412' +PACKAGE_STRING='makejvf (TeX Live) 20200412' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1329,7 +1329,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 makejvf (TeX Live) 1.1a to adapt to many kinds of systems. +\`configure' configures makejvf (TeX Live) 20200412 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1400,7 +1400,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of makejvf (TeX Live) 1.1a:";; + short | recursive ) echo "Configuration of makejvf (TeX Live) 20200412:";; esac cat <<\_ACEOF @@ -1521,7 +1521,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -makejvf (TeX Live) configure 1.1a +makejvf (TeX Live) configure 20200412 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2173,7 +2173,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 makejvf (TeX Live) $as_me 1.1a, which was +It was created by makejvf (TeX Live) $as_me 20200412, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -7860,7 +7860,7 @@ fi # Define the identity of the package. PACKAGE='makejvf--tex-live-' - VERSION='1.1a' + VERSION='20200412' # Some tools Automake needs. @@ -13885,7 +13885,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -makejvf (TeX Live) config.lt 1.1a +makejvf (TeX Live) config.lt 20200412 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -15494,7 +15494,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 makejvf (TeX Live) $as_me 1.1a, which was +This file was extended by makejvf (TeX Live) $as_me 20200412, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15560,7 +15560,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -makejvf (TeX Live) config.status 1.1a +makejvf (TeX Live) config.status 20200412 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/makejvf/configure.ac b/Build/source/texk/makejvf/configure.ac index 0a2a1f7b9b1..41d8a3adb12 100644 --- a/Build/source/texk/makejvf/configure.ac +++ b/Build/source/texk/makejvf/configure.ac @@ -6,7 +6,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([makejvf (TeX Live)], [1.1a]) +AC_INIT([makejvf (TeX Live)], [20200412]) AC_PREREQ([2.63]) AC_CONFIG_SRCDIR([main.c]) AC_CONFIG_AUX_DIR([../../build-aux]) diff --git a/Build/source/texk/makejvf/main.c b/Build/source/texk/makejvf/main.c index b245356ec01..247a66257a0 100644 --- a/Build/source/texk/makejvf/main.c +++ b/Build/source/texk/makejvf/main.c @@ -11,7 +11,7 @@ FILE *vfp,*afp=NULL; char *atfmname,*vtfmname,*afmname,*vfname,*kanatfm,*jistfm,*ucsqtfm,*usertable; -int kanatume=-1,chotai=0,baseshift=0,minute=0,useset3=0,hankana=0,fidzero=0,enhanced=0; +int kanatume=-1,chotai=0,baseshift=0,minute=0,useset3=0,hankana=0,fidzero=0,enhanced=0,omitzw=0; int pstfm_nt; long ucs=0; @@ -25,7 +25,7 @@ int main(int argc, char ** argv) kpse_set_program_name(argv[0], "makejvf"); set_enc_string("sjis", "euc"); - while ((c = getopt (argc, argv, "k:K:Ca:b:mu:3J:U:Hiet:")) != -1) + while ((c = getopt (argc, argv, "k:K:Ca:b:mu:3J:U:Hiet:O")) != -1) switch (c) { case 'k': @@ -93,6 +93,9 @@ int main(int argc, char ** argv) case 'e': enhanced=1; break; + case 'O': + omitzw=1; + break; case 't': usertable = xstrdup(optarg); break; @@ -103,7 +106,7 @@ int main(int argc, char ** argv) if (kanatume>=0 && !afp) { fprintf(stderr,"No AFM file for kanatume.\n"); - exit(100); + exit(101); } if (argc - optind != 2) { @@ -127,7 +130,7 @@ int main(int argc, char ** argv) } if (FILESTRCASEEQ(&vtfmname[0], &atfmname_base[0])) { fprintf(stderr,"Invalid usage: input TFM and output TFM must be different.\n"); - exit(100); + exit(102); } if (kanatfm) { @@ -136,7 +139,7 @@ int main(int argc, char ** argv) } if (FILESTRCASEEQ(&kanatfm[0], &atfmname_base[0])) { fprintf(stderr,"Invalid usage: input TFM and output TFM must be different.\n"); - exit(100); + exit(102); } } @@ -161,7 +164,7 @@ int main(int argc, char ** argv) if (jistfm && ucsqtfm) { fprintf(stderr,"Options -J and -U at the same time? I'm confused.\n"); - exit(100); + exit(110); } if (jistfm) { @@ -170,7 +173,7 @@ int main(int argc, char ** argv) } if (FILESTRCASEEQ(&jistfm[0], &atfmname_base[0])) { fprintf(stderr,"Invalid usage: input TFM and output TFM must be different.\n"); - exit(100); + exit(102); } } @@ -180,10 +183,14 @@ int main(int argc, char ** argv) } if (FILESTRCASEEQ(&ucsqtfm[0], &atfmname_base[0])) { fprintf(stderr,"Invalid usage: input TFM and output TFM must be different.\n"); - exit(100); + exit(102); } } + if (omitzw && usertable) { + fprintf(stderr,"Invalid usage: conflict options -O and -t.\n"); + exit(120); + } if (usertable) { get_usertable(usertable); } @@ -194,7 +201,7 @@ int main(int argc, char ** argv) } if (ucs==ENTRY_CUSTOM && usertable_charset_max<1) { fprintf(stderr,"No custom charset definition in usertable.\n"); - exit(101); + exit(130); } tfmget(atfmname); @@ -255,6 +262,7 @@ void usage(void) fputs2("-e Enhanced mode; the horizontal shift amount is determined\n", stderr); fputs2(" from the glue/kern table of input\n", stderr); fputs2("-t Use as a configuration file\n", stderr); + fputs2("-O Omit entries in VF for characters with default metric\n", stderr); fputs2("-u UCS mode\n", stderr); fputs2(" gb : GB, cns : CNS, ks : KS\n", stderr); fputs2(" jis : JIS, jisq : JIS quote only\n", stderr); diff --git a/Build/source/texk/makejvf/makejvf.h b/Build/source/texk/makejvf/makejvf.h index 040860b37d0..dc6e23aeb8f 100644 --- a/Build/source/texk/makejvf/makejvf.h +++ b/Build/source/texk/makejvf/makejvf.h @@ -1,6 +1,6 @@ extern char *vtfmname,*kanatfm,*jistfm,*ucsqtfm,*usertable; extern int unit,zh,zw,jfm_id,rightamount; -extern int kanatume,chotai,baseshift,minute,hankana,fidzero,enhanced; +extern int kanatume,chotai,baseshift,minute,hankana,fidzero,enhanced,omitzw; extern int pstfm_nt; extern FILE *afp; extern long ucs; diff --git a/Build/source/texk/makejvf/makejvf.test b/Build/source/texk/makejvf/makejvf.test index ce8aa180fd1..7a27e4e5031 100755 --- a/Build/source/texk/makejvf/makejvf.test +++ b/Build/source/texk/makejvf/makejvf.test @@ -10,23 +10,30 @@ ./makejvf -m $srcdir/tests/tmin10 rmlv && \ cmp $srcdir/tests/tmin10.vf tmin10.vf && \ - cmp $srcdir/tests/rmlv.tfm rmlv.tfm || exit 1 + cmp $srcdir/tests/rmlv.tfm rmlv.tfm || exit 2 # followings are supported in texjporg version ./makejvf -e -i -u custom -t $srcdir/tests/uni10.cnf $srcdir/tests/testnewu urml && \ cmp $srcdir/tests/testnewu.vf testnewu.vf && \ - cmp $srcdir/tests/rml.tfm urml.tfm || exit 1 + cmp $srcdir/tests/rml.tfm urml.tfm || exit 3 ./makejvf -e -i -u custom -t $srcdir/tests/uni10.cnf $srcdir/tests/gkhugeok urml && \ cmp $srcdir/tests/gkhugeok.vf gkhugeok.vf && \ - cmp $srcdir/tests/rml.tfm urml.tfm || exit 1 + cmp $srcdir/tests/rml.tfm urml.tfm || exit 4 ./makejvf -e $srcdir/tests/skipjfmp rml && \ cmp $srcdir/tests/skipjfmp.vf skipjfmp.vf && \ - cmp $srcdir/tests/rml.tfm rml.tfm || exit 1 + cmp $srcdir/tests/rml.tfm rml.tfm || exit 5 + +./makejvf -e -O $srcdir/tests/skipjfmp rml && \ + cmp $srcdir/tests/skipjfmp_omit.vf skipjfmp.vf && \ + cmp $srcdir/tests/rml.tfm rml.tfm || exit 6 TEXMFCNF=$srcdir/../kpathsea \ - ./makejvf -k0 -a abc && exit 1 + ./makejvf -k0 -a abc && exit 100 + +./makejvf -t $srcdir/tests/uni10.cnf -O $srcdir/tests/skipjfmp rml && \ + exit 101 exit 0 diff --git a/Build/source/texk/makejvf/tests/skipjfmp_omit.vf b/Build/source/texk/makejvf/tests/skipjfmp_omit.vf new file mode 100644 index 00000000000..aa3b839dace Binary files /dev/null and b/Build/source/texk/makejvf/tests/skipjfmp_omit.vf differ diff --git a/Build/source/texk/makejvf/version.h b/Build/source/texk/makejvf/version.h index f5a8bbd3302..e4ab005b035 100644 --- a/Build/source/texk/makejvf/version.h +++ b/Build/source/texk/makejvf/version.h @@ -1,2 +1,2 @@ -#define VERSION "20200216" +#define VERSION "20200412" #define BUG_ADDRESS "issue@texjp.org" diff --git a/Build/source/texk/makejvf/write.c b/Build/source/texk/makejvf/write.c index 34eeeaf0074..d2129137e5f 100644 --- a/Build/source/texk/makejvf/write.c +++ b/Build/source/texk/makejvf/write.c @@ -93,8 +93,6 @@ void writevf(int code, FILE *fp) w = jfmread(code); /* rightamount is also obtained */ - fputc(242,fp); /* long_char */ - skip2=baseshift; switch (code) { case 0x2146: /* ‘ */ @@ -127,6 +125,7 @@ void writevf(int code, FILE *fp) skip2+=-(int)(zh*3/5.0); /* skip2+=-(int)((0.6)*zh); */ } + fputc(242,fp); /* long_char */ if (kanatfm) cc=4; else @@ -195,6 +194,7 @@ void writevf(int code, FILE *fp) skip2+=(int)(zh*3/5.0); /* skip2+=(int)((0.6)*zh); */ } + fputc(242,fp); /* long_char */ if (kanatfm) cc=4; else @@ -305,9 +305,17 @@ void writevf(int code, FILE *fp) skip = -(zw-w)/2; } } + else { + if (omitzw) { /* Omit entries in VF for characters with default ZW metric */ + if (!kanatfm || code > 0x2576) + return; + } + } break; } + fputc(242,fp); /* long_char */ + for (l = 0; l < usertable_replace_max; l++) { if (code == usertable_replace[l].codepoint) { outcode = usertable_replace[l].newcodepoint; @@ -375,8 +383,6 @@ void writevfu(int code, FILE *fp) w = jfmread(code); /* rightamount is also obtained */ - fputc(242,fp); /* long_char */ - skip2=baseshift; switch (code) { case 0x2018: /* ‘ */ @@ -404,6 +410,7 @@ void writevfu(int code, FILE *fp) skip = -(zw-w); /* changed */ /* no correction needed for skip2 */ + fputc(242,fp); /* long_char */ if (kanatfm) cc=4; else @@ -432,6 +439,7 @@ void writevfu(int code, FILE *fp) return; } else if (ucsqtfm) { /* UniJIS-UCS2-H系へ変換 */ + fputc(242,fp); /* long_char */ cc=4; skip = -(zw-w); if (skip) @@ -456,6 +464,7 @@ void writevfu(int code, FILE *fp) } else if (jfm_id == 11 && jistfm) { /* 横書き時はJIS系へ変換 */ /* UCS U+2018 → JIS 0x2146, UCS U+201C → JIS 0x2148 */ + fputc(242,fp); /* long_char */ cc=4; skip = -(zw-w); if (skip) @@ -528,6 +537,7 @@ void writevfu(int code, FILE *fp) skip = zw; /* changed */ /* no correction needed for skip2 */ + fputc(242,fp); /* long_char */ if (kanatfm) cc=4; else @@ -562,6 +572,7 @@ void writevfu(int code, FILE *fp) return; } else if (ucsqtfm) { /* UniJIS-UCS2-H系へ変換 */ + fputc(242,fp); /* long_char */ cc=4; if (skip2) cc+=numcount(skip2)+1; @@ -579,6 +590,7 @@ void writevfu(int code, FILE *fp) } else if (jfm_id == 11 && jistfm) { /* 横書き時はJIS系へ変換 */ /* UCS U+2019 → JIS 0x2147, UCS U+201D → JIS 0x2149 */ + fputc(242,fp); /* long_char */ cc=4; if (skip2) cc+=numcount(skip2)+1; @@ -711,9 +723,17 @@ void writevfu(int code, FILE *fp) skip = -(zw-w)/2; } } + else { + if (omitzw) { /* Omit entries in VF for characters with default ZW metric */ + if (!kanatfm || uniblock_iskanji) + return; + } + } break; } + fputc(242,fp); /* long_char */ + for (l = 0; l < usertable_replace_max; l++) { if (code == usertable_replace[l].codepoint) { outcode = usertable_replace[l].newcodepoint; -- cgit v1.2.3