Skip to content

Commit

Permalink
[uptex] read ofm, trial (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-tk committed Jun 23, 2024
1 parent 0a1691c commit 5a74e9a
Show file tree
Hide file tree
Showing 20 changed files with 2,806 additions and 63 deletions.
69 changes: 39 additions & 30 deletions source/texk/web2c/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3128,14 +3128,15 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
tests/auxinclude.bbl tests/auxinclude.bib tests/auxinclude.tex \
tests/auxinclude2.aux tests/auxinclude2.tex \
tests/fn-generate.perl tests/fn-utf8.txt tests/fn-euc.txt \
tests/fn-sjis.txt tests/allbib.aux tests/allbib.tex \
tests/apalike.bst tests/badpl.pl tests/badtfm.tfm \
tests/badvf.tfm tests/badvf.vf tests/badvpl.vpl \
tests/batch.tex tests/check.log tests/cmr10.600gf \
tests/cmr10.pk tests/cmr10.pl tests/cmr10.tfm tests/cmr7.tfm \
tests/cmr8.tfm tests/cmti10.tfm tests/cmtt10.tfm \
tests/cmtt8.tfm tests/dict tests/eight.tex tests/end.tex \
tests/exampl.aux tests/exampl.tex tests/gray.tfm \
tests/fn-sjis.txt tests/uctt10x.opl tests/uctt10x.ofm \
tests/uctt10x.ovp tests/uctt10x.ovf tests/allbib.aux \
tests/allbib.tex tests/apalike.bst tests/badpl.pl \
tests/badtfm.tfm tests/badvf.tfm tests/badvf.vf \
tests/badvpl.vpl tests/batch.tex tests/check.log \
tests/cmr10.600gf tests/cmr10.pk tests/cmr10.pl \
tests/cmr10.tfm tests/cmr7.tfm tests/cmr8.tfm tests/cmti10.tfm \
tests/cmtt10.tfm tests/cmtt8.tfm tests/dict tests/eight.tex \
tests/end.tex tests/exampl.aux tests/exampl.tex tests/gray.tfm \
tests/hello.tex tests/io.mf tests/just.texi tests/label.mp \
tests/label.mpx tests/logo8.tfm tests/longline.aux \
tests/longline.bib tests/longline.tex tests/longtfm.tex \
Expand Down Expand Up @@ -3236,7 +3237,8 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
uptexdir/tests/gkhugeok.tfm uptexdir/tests/gkhugeng.tfm \
uptexdir/tests/gkhugeng.err uptexdir/tests/gk256g.tfm \
uptexdir/tests/gk256k.tfm uptexdir/uptrip/uptrip.diffs \
uptexdir/uptrip/texmf.cnf $(euptex_web_srcs) $(euptex_ch_srcs) \
uptexdir/uptrip/texmf.cnf uptexdir/tests/up-ofm.tex \
uptexdir/tests/up-ofm.log $(euptex_web_srcs) $(euptex_ch_srcs) \
euptexdir/euptex.defines euptexdir/COPYRIGHT \
euptexdir/COPYRIGHT.jis euptexdir/ChangeLog \
euptexdir/EUPTEX.txt $(euptex_tests) \
Expand All @@ -3246,6 +3248,7 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
euptexdir/tests/pdfprimitive-test.tex \
euptexdir/tests/pdfprimitive-euptex.log \
euptexdir/tests/ctrlsym.log euptexdir/tests/ctrlsym.tex \
euptexdir/tests/eup-ofm.tex euptexdir/tests/eup-ofm.log \
hitexdir/ChangeLog $(hitex_web) $(hitex_tests) \
hitexdir/tests/hello.tex hitexdir/tests/rule.tex \
pdftexdir/regex/COPYING.LIB pdftexdir/regex/README \
Expand Down Expand Up @@ -3568,24 +3571,24 @@ DISTCLEANFILES = CXXLD.sh tangle.c tangle.h tangle.p tangle-web2c \
uptests/xcmr10.tfm uptests/xcmr10.pl uptests/xsample*.typ \
uptests/x*min10.* uptests/xchcode*.* uptests/xtestnewu*.* \
uptests/xuparse.* uptests/yuparse.* uptests/ygkhuge*.* \
uptests/ygk256*.* uptests/xskipjfmp.* uptrip.diffs \
uptests/ygk256*.* uptests/xskipjfmp.* up-ofm.* uptrip.diffs \
$(nodist_euptex_SOURCES) euptex.web euptex.ch euptex-web2c \
euptex.p euptex.pool euptex-tangle euptrip.diffs \
pdfprimitive-euptex.* eup-ctrlsym.fmt eup-ctrlsym.log \
eup-ctrlsym.out eup-ctrlsym.tex $(nodist_hitex_SOURCES) \
$(nodist_hishrink_SOURCES) $(nodist_histretch_SOURCES) \
hiformat-tangle hitex-tangle hello.log rule.log \
$(nodist_pdftex_SOURCES) pdftex-final.ch pdftex-web2c pdftex.p \
pdftex.pool pdftex-tangle pwprob.log pwprob.tex pdfimage.fmt \
pdfimage.log pdfimage.pdf expanded.log cnfline.log \
partoken-ok.log partoken-xfail.log pdftests/fn*.* postV3.afm \
postV7.afm test-13.pdf test-13.xref test-15.pdf test-15.xref \
$(nodist_libluatex_sources) luaimage.* luajitimage.* \
$(nodist_xetex_SOURCES) xetex.web xetex-final.ch xetex-web2c \
xetex.p xetex.pool xetex-tangle bug73.fmt bug73.log bug73.out \
bug73.tex filedump.log filedump.out filedump.tex \
xe-ctrlsym.fmt xe-ctrlsym.log xe-ctrlsym.out xe-ctrlsym.tex \
xetests/fn*.* $(omegaware_programs:=.c) \
euptex.p euptex.pool euptex-tangle pdfprimitive-euptex.* \
eup-ctrlsym.fmt eup-ctrlsym.log eup-ctrlsym.out \
eup-ctrlsym.tex eup-ofm.* euptrip.diffs \
$(nodist_hitex_SOURCES) $(nodist_hishrink_SOURCES) \
$(nodist_histretch_SOURCES) hiformat-tangle hitex-tangle \
hello.log rule.log $(nodist_pdftex_SOURCES) pdftex-final.ch \
pdftex-web2c pdftex.p pdftex.pool pdftex-tangle pwprob.log \
pwprob.tex pdfimage.fmt pdfimage.log pdfimage.pdf expanded.log \
cnfline.log partoken-ok.log partoken-xfail.log pdftests/fn*.* \
postV3.afm postV7.afm test-13.pdf test-13.xref test-15.pdf \
test-15.xref $(nodist_libluatex_sources) luaimage.* \
luajitimage.* $(nodist_xetex_SOURCES) xetex.web xetex-final.ch \
xetex-web2c xetex.p xetex.pool xetex-tangle bug73.fmt \
bug73.log bug73.out bug73.tex filedump.log filedump.out \
filedump.tex xe-ctrlsym.fmt xe-ctrlsym.log xe-ctrlsym.out \
xe-ctrlsym.tex xetests/fn*.* $(omegaware_programs:=.c) \
$(omegaware_programs:=.h) $(omegaware_programs:=.p) \
$(omegaware_programs:=-web2c) ofm2opl.web opl2ofm.web \
ovf2ovp.web ovp2ovf.web omegaware/bad*.* \
Expand Down Expand Up @@ -4456,7 +4459,8 @@ uptex_tests = \
uptexdir/uptriptest.test uptexdir/ptriptest.test \
uptexdir/upver.test \
uptexdir/upkcat.test \
uptexdir/wcfname.test uptexdir/wcfname0.test
uptexdir/wcfname.test uptexdir/wcfname0.test \
uptexdir/uptex-ofm.test

# uppPLtoTF/upTFtoPL
upweb_tests = uptexdir/upbibtex.test uptexdir/updvitype.test \
Expand Down Expand Up @@ -4520,7 +4524,8 @@ euptex_tests = \
euptexdir/euptex-ctrlsym.test \
euptexdir/eupver.test \
euptexdir/upkcat.test \
euptexdir/wcfname.test euptexdir/wcfname0.test
euptexdir/wcfname.test euptexdir/wcfname0.test \
euptexdir/euptex-ofm.test


# At the moment, these are the only man pages handled in the
Expand Down Expand Up @@ -21943,7 +21948,8 @@ uptftopl.web: tie$(EXEEXT) tftopl.web tftopl.ch
uptexdir/uptriptest.log uptexdir/ptriptest.log: \
uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
uptexdir/upver.log uptexdir/upkcat.log \
uptexdir/wcfname.log uptexdir/wcfname0.log: uptex$(EXEEXT)
uptexdir/wcfname.log uptexdir/wcfname0.log \
uptexdir/uptex-ofm.log: uptex$(EXEEXT)
uptexdir/upbibtex.log: upbibtex$(EXEEXT)
uptexdir/updvitype.log: updvitype$(EXEEXT)
uptexdir/uppltotf.log: uppltotf$(EXEEXT)
Expand All @@ -21955,6 +21961,7 @@ uptexdir/sample.log: updvitype$(EXEEXT)
uptexdir/yokotate.log uptexdir/skipjfmp.log \
uptexdir/newjfm.log uptexdir/uparse.log \
uptexdir/gkhuge.log uptexdir/gk256.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)

uptrip.diffs: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
$(triptrap_diffs) $@
.PHONY: uptrip-clean
Expand Down Expand Up @@ -21990,7 +21997,9 @@ euptexdir/euptriptest.log euptexdir/eptriptest.log: \
euptexdir/pdfprimitive.log: euptex$(EXEEXT)
euptexdir/euptex-ctrlsym.log \
euptexdir/eupver.log euptexdir/upkcat.log \
euptexdir/wcfname.log euptexdir/wcfname0.log: euptex$(EXEEXT)
euptexdir/wcfname.log euptexdir/wcfname0.log \
euptexdir/euptex-ofm.log: euptex$(EXEEXT)

euptrip.diffs: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
$(triptrap_diffs) $@
.PHONY: euptrip-clean
Expand Down
3 changes: 3 additions & 0 deletions source/texk/web2c/am/web.am
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ DISTCLEANFILES += pooltype.tex
## {pdftexdir,xetexdir,ptexdir,uptexdir}/wcfname.test
EXTRA_DIST += tests/fn-generate.perl
EXTRA_DIST += tests/fn-utf8.txt tests/fn-euc.txt tests/fn-sjis.txt
## uptexdir/uptex-ofm.test, euptexdir/euptex-ofm.test
EXTRA_DIST += tests/uctt10x.opl tests/uctt10x.ofm
EXTRA_DIST += tests/uctt10x.ovp tests/uctt10x.ovf

## Test data
##
Expand Down
22 changes: 14 additions & 8 deletions source/texk/web2c/euptexdir/am/euptex.am
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ euptex_tests = \
euptexdir/euptex-ctrlsym.test \
euptexdir/eupver.test \
euptexdir/upkcat.test \
euptexdir/wcfname.test euptexdir/wcfname0.test
euptexdir/wcfname.test euptexdir/wcfname0.test \
euptexdir/euptex-ofm.test
euptexdir/euptriptest.log euptexdir/eptriptest.log: \
euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
euptexdir/pdfprimitive.log: euptex$(EXEEXT)
euptexdir/euptex-ctrlsym.log \
euptexdir/eupver.log euptexdir/upkcat.log \
euptexdir/wcfname.log euptexdir/wcfname0.log: euptex$(EXEEXT)
euptexdir/wcfname.log euptexdir/wcfname0.log \
euptexdir/euptex-ofm.log: euptex$(EXEEXT)

EXTRA_DIST += $(euptex_tests)

Expand All @@ -125,12 +127,6 @@ EXTRA_DIST += \
euptexdir/eptrip/eptrip.tex \
euptexdir/euptrip/euptrip.diffs \
euptexdir/euptrip/texmf.cnf
euptrip.diffs: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
$(triptrap_diffs) $@
.PHONY: euptrip-clean
euptrip-clean:
rm -rf euptripdir
DISTCLEANFILES += euptrip.diffs
## euptexdir/pdfprimitive.test
EXTRA_DIST += \
euptexdir/pdfprimitive.test \
Expand All @@ -141,5 +137,15 @@ DISTCLEANFILES += pdfprimitive-euptex.*
## euptex-ctrlsym.test
EXTRA_DIST += euptexdir/tests/ctrlsym.log euptexdir/tests/ctrlsym.tex
DISTCLEANFILES += eup-ctrlsym.fmt eup-ctrlsym.log eup-ctrlsym.out eup-ctrlsym.tex
## euptex-ofm.test
EXTRA_DIST += euptexdir/tests/eup-ofm.tex euptexdir/tests/eup-ofm.log
DISTCLEANFILES += eup-ofm.*

euptrip.diffs: euptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
$(triptrap_diffs) $@
.PHONY: euptrip-clean
euptrip-clean:
rm -rf euptripdir
DISTCLEANFILES += euptrip.diffs

# (end of euptex.am)
4 changes: 2 additions & 2 deletions source/texk/web2c/euptexdir/eptex.ech
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ font_char_ic_code: begin scan_font_ident; q:=cur_val;
end
else cur_val:=0;
end
else begin scan_ascii_num;
else begin scan_latin_num;
if (font_bc[q]<=cur_val)and(font_ec[q]>=cur_val) then
begin i:=orig_char_info(q)(qi(cur_val));
case m of
Expand Down Expand Up @@ -767,7 +767,7 @@ if_font_char_code:begin scan_font_ident; n:=cur_val;
b:=(font_bc[n]<=cur_val)and(font_ec[n]>=cur_val)
end
end
else begin scan_ascii_num;
else begin scan_latin_num;
if (font_bc[n]<=cur_val)and(font_ec[n]>=cur_val) then @/
b:=char_exists(orig_char_info(n)(qi(cur_val)))
else b:=false;
Expand Down
29 changes: 29 additions & 0 deletions source/texk/web2c/euptexdir/euptex-ofm.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /bin/sh -vx
# Copyright 2024 Japanese TeX Development Community <[email protected]>
# You may freely use, modify and/or distribute this file.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_euptex=$BinDir/euptex$ExeExt

LC_ALL=C; export LC_ALL; LANGUAGE=C; export LANGUAGE

TEXMFCNF=$srcdir/../kpathsea;export TEXMFCNF
OFMFONTS=".;$srcdir/tests"; export OFMFONTS
TEXINPUTS=".;$srcdir/tests"; export TEXINPUTS
TEXFORMATS=.; export TEXFORMATS

# get same filename in log
rm -f eup-ofm.*
$LN_S $srcdir/euptexdir/tests/eup-ofm.tex ./eup-ofm.tex

#exit 77

$_euptex -ini -etex eup-ofm || exit 1

$_euptex -fmt=eup-ofm -interaction=batchmode eup-ofm || :

sed 1d eup-ofm.log >eup-ofm.out

diff $srcdir/euptexdir/tests/eup-ofm.log eup-ofm.out || exit 3

11 changes: 9 additions & 2 deletions source/texk/web2c/euptexdir/fam256.ch
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,10 @@ def_code: begin
@<Let |n| be the largest legal code value, based on |cur_chr|@>;
p:=cur_chr;
if p=kcat_code_base then
begin scan_char_num; p:=p+kcatcodekey(cur_val) end
begin scan_char_num; p:=p+kcatcodekey(cur_val);
if cur_val>=max_latin_val then m:=not_cjk; end
else if p<math_code_base then
begin scan_latin_num; p:=p+cur_val; end
else begin scan_ascii_num; p:=p+cur_val; end;
scan_optional_equals; scan_int;
if ((cur_val<m)and(p<del_code_base))or(cur_val>n) then
Expand Down Expand Up @@ -1250,7 +1253,9 @@ def_code: begin
@<Let |m| be the minimal legal code value, based on |cur_chr|@>;
@<Let |n| be the largest legal code value, based on |cur_chr|@>;
p:=cur_chr; cur_val1:=p;
if p=kcat_code_base then begin scan_char_num; p:=p+kcatcodekey(cur_val) end
if p=kcat_code_base then begin scan_char_num; p:=p+kcatcodekey(cur_val);
if cur_val>=max_latin_val then m:=not_cjk; end
else if p<math_code_base then begin scan_latin_num; p:=p+cur_val; end
else begin scan_ascii_num; p:=p+cur_val; end;
scan_optional_equals; scan_int;
if ((cur_val<m)and(p<del_code_base))or(cur_val>n) then
Expand Down Expand Up @@ -1296,9 +1301,11 @@ def_code: begin
%-----------------------------------------------
@x
else if cur_chr=kcat_code_base then n:=max_char_code
else if cur_chr<math_code_base then n:=max_latin_val
else if cur_chr=math_code_base then n:=@'100000
@y
else if cur_chr=kcat_code_base then n:=max_char_code
else if cur_chr<math_code_base then n:=max_latin_val
else if cur_chr=math_code_base then n:=@"8000
else if cur_chr=(math_code_base+128) then n:=@"8000000
@z
Expand Down
16 changes: 16 additions & 0 deletions source/texk/web2c/euptexdir/tests/eup-ofm.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**eup-ofm
(./eup-ofm.tex cmtt10 uctt10x
> \box0=
\hbox(0.0+0.0)x5.24998, yoko direction
.\displace 0.0
.\uctt ^^c6

! OK.
l.43 \showbox0


We have "2010. We do not have "2014. [1] )
Output written on eup-ofm.dvi (1 page, 528 bytes).
82 changes: 82 additions & 0 deletions source/texk/web2c/euptexdir/tests/eup-ofm.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
% Copyright 2024 Japanese TeX Development Community <[email protected]>
% You may freely use, modify and/or distribute this file.
%
\ifx\fmtname\undefined
\input basic
\def\fmtname{basic}
\expandafter\dump
\fi
%==================
\begingroup % Just there to minimize tracing output
\tracingmacros=2
\tracingonline=1
%----
\message{cmtt10}
\font\cmtt=cmtt10
\cmtt
\char"21\char"22\char"23\char"24\char"25

\char"30\char"31\char"32\char"33 \char"41\char"42\char"43 \char"64\char"65\char"66

0123 ABC def


\message{uctt10x}
\font\uctt=uctt10x
\uctt
\char"21\char"22\char"23\char"24\char"25

\char"30\char"31\char"32\char"33 \char"41\char"42\char"43 \char"64\char"65\char"66

0123 ABC def


\kcatcode"C6=14 % latin_ucs: not cjk in ucs code
\catcode"C6=11 \catcode"D8=11 \catcode"DF=11
\catcode"E6=11 \catcode"F8=11

\char"C6\char"D8\char"DF\char"E6\char"F8

ÆØßæø

\setbox0\hbox{【Æ】}
\showbox0

\kcatcode"123=14
\catcode"123=11 \catcode"131=11 \catcode"152=11
\catcode"153=11

\char"123\char"131\char"152\char"153

ģıŒœ

\kcatcode"393=14
\catcode"393=11 \catcode"394=11 \catcode"398=11
\catcode"39B=11 \catcode"39E=11

\char"393\char"394\char"398\char"39B\char"39E

ΓΔΘΛΞ

\kcatcode"2010=14
\catcode"2010=11 \catcode"2018=11 \catcode"2019=11

\char"2010\char"2018\char"2019

‐‘’

\lccode"C6="E6
\uccode"E6="C6
\lccode`Œ=`œ
\uccode`œ=`Œ

\uppercase{[aeoe æœ]}
\lowercase{[AEOE ƌ]}

\message{We}\iffontchar\font"2010\else\message{do not}\fi\message{have "2010.}
\message{We}\iffontchar\font"2014\else\message{do not}\fi\message{have "2014.}

%----
\setbox0=\vbox{} % no dvi output
\endgroup
\end
3 changes: 3 additions & 0 deletions source/texk/web2c/lib/texmfmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,9 @@ maininit (int ac, string *av)
#else /* !Aleph */
kpse_set_program_enabled (kpse_tfm_format, MAKE_TEX_TFM_BY_DEFAULT,
kpse_src_compile);
#if (IS_upTeX)
kpse_set_program_enabled (kpse_ofm_format, false, kpse_src_compile);
#endif
#endif /* !Aleph */
kpse_set_program_enabled (kpse_tex_format, MAKE_TEX_TEX_BY_DEFAULT,
kpse_src_compile);
Expand Down
Binary file added source/texk/web2c/tests/uctt10x.ofm
Binary file not shown.
Loading

0 comments on commit 5a74e9a

Please sign in to comment.