From 9b1a7933abd546e9e473f267cf90293445d7e048 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Sun, 3 Aug 2014 12:19:20 +0000 Subject: omegafonts: Fixed a character dimension rounding bug omegafonts,omegaware: Added character dimension rounding tests git-svn-id: svn://tug.org/texlive/trunk@34806 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/omegafonts/ChangeLog | 9 ++ Build/source/texk/web2c/omegafonts/Makefile.am | 5 +- Build/source/texk/web2c/omegafonts/Makefile.in | 10 +- Build/source/texk/web2c/omegafonts/char_routines.c | 8 ++ .../source/texk/web2c/omegafonts/dimen_routines.c | 8 +- .../source/texk/web2c/omegafonts/header_routines.c | 94 ++---------------- .../source/texk/web2c/omegafonts/header_routines.h | 2 - Build/source/texk/web2c/omegafonts/shorten.test | 28 ++++++ .../source/texk/web2c/omegafonts/tests/realnum.out | 1 + .../source/texk/web2c/omegafonts/tests/shorten.opl | 108 +++++++++++++++++++++ 10 files changed, 176 insertions(+), 97 deletions(-) create mode 100755 Build/source/texk/web2c/omegafonts/shorten.test create mode 100644 Build/source/texk/web2c/omegafonts/tests/shorten.opl (limited to 'Build/source/texk/web2c/omegafonts') diff --git a/Build/source/texk/web2c/omegafonts/ChangeLog b/Build/source/texk/web2c/omegafonts/ChangeLog index e4efc82b404..ccf39392ded 100644 --- a/Build/source/texk/web2c/omegafonts/ChangeLog +++ b/Build/source/texk/web2c/omegafonts/ChangeLog @@ -1,3 +1,12 @@ +2014-08-03 Peter Breitenlohner + + * dimen_routines.c (set_indices): Fixed a dimen rounding bug. + * header_routines.[ch]: Drop unused code. + Always output SEVENBITSAFEFLAG for TFM files. + * shorten.test, tests/shorten.opl, (new): Shell script and data + for a new test. + * Makefile.am: Add the new test. + 2014-08-02 Peter Breitenlohner * dimen_routines.c: Fixed a bug in the computation of nw, nh, diff --git a/Build/source/texk/web2c/omegafonts/Makefile.am b/Build/source/texk/web2c/omegafonts/Makefile.am index 4c5bfd00405..d62abcf2e86 100644 --- a/Build/source/texk/web2c/omegafonts/Makefile.am +++ b/Build/source/texk/web2c/omegafonts/Makefile.am @@ -97,7 +97,7 @@ endif OTANGLE ## Tests ## OMFONTS_tests = charwd.test level1.test ofonts.test omfonts.test overbmp.test \ - realnum.test repeat.test selectfont.test specialhex.test + realnum.test repeat.test selectfont.test shorten.test specialhex.test if OTANGLE TESTS = $(OMFONTS_tests) endif OTANGLE @@ -136,6 +136,9 @@ DISTCLEANFILES += tests/xrepeated.* ## selectfont.test EXTRA_DIST += tests/sample.out tests/sample.ovp tests/sample0-h.opl DISTCLEANFILES += tests/sample*.ofm tests/sample*.ovf tests/sample1-h.opl tests/xsample*.out +## shorten.test +EXTRA_DIST += tests/shorten.opl +DISTCLEANFILES += tests/shortend.* ## specialhex.test EXTRA_DIST += tests/specialhex.ovp DISTCLEANFILES += tests/specialhex.ofm tests/specialhex.opl \ diff --git a/Build/source/texk/web2c/omegafonts/Makefile.in b/Build/source/texk/web2c/omegafonts/Makefile.in index 01f690fa300..978c96ea922 100644 --- a/Build/source/texk/web2c/omegafonts/Makefile.in +++ b/Build/source/texk/web2c/omegafonts/Makefile.in @@ -710,8 +710,9 @@ DISTCLEANFILES = pl-parser.output tests/charwdr.* tests/charwdv.* \ tests/OCherokee.ovf tests/xCherokee.* tests/xOCherokee.* \ tests/xinbmp* tests/xoverbmp* tests/realnum.* \ tests/xrepeated.* tests/sample*.ofm tests/sample*.ovf \ - tests/sample1-h.opl tests/xsample*.out tests/specialhex.ofm \ - tests/specialhex.opl tests/specialhex.ovf tests/xspecialhex.* + tests/sample1-h.opl tests/xsample*.out tests/shortend.* \ + tests/specialhex.ofm tests/specialhex.opl tests/specialhex.ovf \ + tests/xspecialhex.* linked_programs = ofm2opl opl2ofm ovf2ovp ovp2ovf bin_links = \ omfonts$(EXEEXT):ofm2opl \ @@ -720,7 +721,7 @@ bin_links = \ omfonts$(EXEEXT):ovp2ovf OMFONTS_tests = charwd.test level1.test ofonts.test omfonts.test overbmp.test \ - realnum.test repeat.test selectfont.test specialhex.test + realnum.test repeat.test selectfont.test shorten.test specialhex.test @OTANGLE_TRUE@TESTS = $(OMFONTS_tests) EXTRA_DIST = $(OMFONTS_tests) tests/charwd-r.pl tests/charwd-v.vpl \ @@ -732,7 +733,8 @@ EXTRA_DIST = $(OMFONTS_tests) tests/charwd-r.pl tests/charwd-v.vpl \ tests/OCherokee.ovp tests/inbmp.opl tests/overbmp.opl \ tests/overbmp.ovp tests/realnum.opl tests/realnum.out \ tests/repeat.opl tests/repeated.opl tests/sample.out \ - tests/sample.ovp tests/sample0-h.opl tests/specialhex.ovp + tests/sample.ovp tests/sample0-h.opl tests/shorten.opl \ + tests/specialhex.ovp all: all-am .SUFFIXES: diff --git a/Build/source/texk/web2c/omegafonts/char_routines.c b/Build/source/texk/web2c/omegafonts/char_routines.c index 5f7678a7313..52e32de0f87 100644 --- a/Build/source/texk/web2c/omegafonts/char_routines.c +++ b/Build/source/texk/web2c/omegafonts/char_routines.c @@ -965,6 +965,14 @@ compute_ofm_character_info(void) } } +void +calculate_check_sum(void) +{ +/* + not_yet_done("checksum calculation"); +*/ +} + void output_ofm_character_info(void) { diff --git a/Build/source/texk/web2c/omegafonts/dimen_routines.c b/Build/source/texk/web2c/omegafonts/dimen_routines.c index 74a34041adb..384f6f099d7 100644 --- a/Build/source/texk/web2c/omegafonts/dimen_routines.c +++ b/Build/source/texk/web2c/omegafonts/dimen_routines.c @@ -194,21 +194,21 @@ set_indices(int h, int d) L1 = measure_list[h]; m = 0; while (lval(L1) != WEB_INFINITY) { L2 = L1; - m++; l = lval(L1); - L1->index = m; + m++; l = lval(L1); while (lval(L1->ptr) <= (l+d)) { L1 = L1->ptr; excess--; if (excess==0) d = 0; } lprime = l + (lval(L1)-l) / 2; lval(L1) = lprime; + L1->index = m; while (L2 != L1) { lval(L2) = lprime; L2->actual = L1; L2->index = m; L2 = L2->ptr; } - L1 = L1->ptr; L2 = L1; + L1 = L1->ptr; } measure_max[h] = m; } @@ -290,7 +290,7 @@ print_dimen_tables(void) if (measure_max[i] != 0) { left(); out("COMMENT"); out_ln(); for (j=0; jptr; - } -} - static void retrieve_header_word(void) { @@ -220,34 +203,18 @@ init_check_sum(void) void set_check_sum(unsigned cs) { + if (check_sum_specified==TRUE) + warning_0("CHECKSUM previously defined; old value ignored"); check_sum = cs; check_sum_specified = TRUE; } -void -store_check_sum(void) -{ - - calculate_check_sum(); - store_header_int(LOC_CHECK_SUM, check_sum); -} - void retrieve_check_sum(void) { retrieve_header_int(LOC_CHECK_SUM, &check_sum); } -void -calculate_check_sum(void) -{ -/* - if (check_sum_specified == FALSE) { - not_yet_done("checksum calculation"); - } -*/ -} - /* DESIGNSIZE */ @@ -485,16 +452,6 @@ set_ofm_level(unsigned level) /* FONTDIR */ -#if 0 -/* Not yet used */ -static void -init_font_dir(void) -{ - font_dir = DIR_ORD+DIR_TL; - font_dir_specified = FALSE; -} -#endif - void set_font_dir(unsigned direction) { @@ -570,42 +527,6 @@ init_header(void) init_seven_bit_safe_flag(); } -void -store_header(void) -{ - - store_header_word(); - store_check_sum(); - store_design_size(); - store_coding_scheme(); - store_family(); - store_face(); - store_seven_bit_safe_flag(); - -/* - { int i; - for (i=0; i<(4*(header_max+1)); i++) { - if (!(i%4)) fprintf(stdout, "\n"); - fprintf(stdout, "%d: %c (%d, %2x) ", - i, header[i], header[i], header[i]); - } - fprintf(stdout, "\n"); -*/ - if (header_list!=NULL) { - av_list L1 = header_list, L2; - while (L1 != NULL) { - L2 = L1->ptr; - free(L1); - L1 = L2; - } - } - lh = header_max; - header_list = NULL; - header_max = HEADER_MIN-1; - - retrieve_header(); -} - void retrieve_header(void) { @@ -621,12 +542,14 @@ retrieve_header(void) void output_ofm_header(void) { - unsigned i=0, j, k1, k2; + unsigned i = 1 + LOC_SEVEN_FLAG / 4, j, k1, k2; av_list L = header_list; - out_ofm_4(check_sum); i++; - out_ofm_4(design_size); i++; + if (check_sum_specified==FALSE) + calculate_check_sum(); + out_ofm_4(check_sum); + out_ofm_4(design_size); k1 = strlen(coding_scheme); out_ofm(k1); for (j=0; j +# You may freely use, modify and/or distribute this file. + +tests=tests + +test -d $tests || mkdir -p $tests + +TEXMFCNF=$srcdir/../../kpathsea +export TEXMFCNF + +sed -e'/CHECKSUM/d' $srcdir/$tests/shorten.opl >$tests/shortend.in + +echo && echo "pltotf $tests/shortend.in $tests/shortend.tfm" && \ + ../pltotf $tests/shortend.in $tests/shortend.tfm || exit + +echo && echo "omfonts -ofm2opl $tests/shorten.tfm $tests/shortend.pl" && \ + ./omfonts -ofm2opl $tests/shortend.tfm $tests/shortend.pl || exit + +echo && echo "omfonts -opl2ofm $tests/shorten $tests/shortend" && \ + ./omfonts -opl2ofm $srcdir/$tests/shorten $tests/shortend || exit + +echo && echo "omfonts -ofm2opl $tests/shorten $tests/shortend" && \ + ./omfonts -ofm2opl $tests/shortend $tests/shortend || exit + +diff $tests/shortend.pl $tests/shortend.opl || exit + diff --git a/Build/source/texk/web2c/omegafonts/tests/realnum.out b/Build/source/texk/web2c/omegafonts/tests/realnum.out index 97091f7d828..2ce85862405 100644 --- a/Build/source/texk/web2c/omegafonts/tests/realnum.out +++ b/Build/source/texk/web2c/omegafonts/tests/realnum.out @@ -5,6 +5,7 @@ (COMMENT DESIGNSIZE IS IN POINTS) (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) (CHECKSUM H 0) +(SEVENBITSAFEFLAG TRUE) (COMMENT (CHARWD_ENTRY D 0 R 0.0) (CHARWD_ENTRY D 1 R 0.0) diff --git a/Build/source/texk/web2c/omegafonts/tests/shorten.opl b/Build/source/texk/web2c/omegafonts/tests/shorten.opl new file mode 100644 index 00000000000..d9f951d67ae --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/tests/shorten.opl @@ -0,0 +1,108 @@ +(COMMENT More that 15 non-zero depths and heights) +(CHECKSUM H 77A61937) +(CHARACTER H A + (CHARWD R 1.1) + (CHARHT R 0.1) + (CHARDP R 0.1) + ) +(CHARACTER H B + (CHARWD R 1.11) + (CHARHT R 0.11) + (CHARDP R 0.11) + ) +(CHARACTER H C + (CHARWD R 1.12) + (CHARHT R 0.12) + (CHARDP R 0.12) + ) +(CHARACTER H D + (CHARWD R 1.13) + (CHARHT R 0.13) + (CHARDP R 0.13) + ) +(CHARACTER H E + (CHARWD R 1.14) + (CHARHT R 0.14) + (CHARDP R 0.14) + ) +(CHARACTER H F + (CHARWD R 1.15) + (CHARHT R 0.15) + (CHARDP R 0.15) + ) +(CHARACTER H 10 + (CHARWD R 1.16) + (CHARHT R 0.16) + (CHARDP R 0.16) + ) +(CHARACTER H 11 + (CHARWD R 1.17) + (CHARHT R 0.17) + (CHARDP R 0.17) + ) +(CHARACTER H 12 + (CHARWD R 1.18) + (CHARHT R 0.18) + (CHARDP R 0.18) + ) +(CHARACTER H 13 + (CHARWD R 1.19) + (CHARHT R 0.19) + (CHARDP R 0.19) + ) +(CHARACTER H 14 + (CHARWD R 1.2) + (CHARHT R 0.2) + (CHARDP R 0.2) + ) +(CHARACTER H 15 + (CHARWD R 1.21) + (CHARHT R 0.21) + (CHARDP R 0.21) + ) +(CHARACTER H 16 + (CHARWD R 1.22) + (CHARHT R 0.22) + (CHARDP R 0.22) + ) +(CHARACTER H 17 + (CHARWD R 1.23) + (CHARHT R 0.23) + (CHARDP R 0.23) + ) +(CHARACTER H 18 + (CHARWD R 1.24) + (CHARHT R 0.24) + (CHARDP R 0.24) + ) +(CHARACTER H 19 + (COMMENT explict vanishing dimensions) + (CHARWD R 1.24) + (CHARHT R 0) + (CHARDP R 0) + (CHARIC R 0) + ) +(CHARACTER H 1A + (COMMENT height rounded to 0.12) + (CHARWD R 1.12) + (CHARHT R 0.1201) + (CHARDP R 0.12) + ) +(CHARACTER H 1B + (COMMENT height rounded to 0.12) + (CHARWD R 1.12) + (CHARHT R 0.1199) + (CHARDP R 0.12) + ) +(CHARACTER H 1C + (COMMENT depth rounded to 0.22) + (CHARWD R 1.22) + (CHARHT R 0.22) + (CHARDP R 0.2199) + ) +(CHARACTER H 1D + (COMMENT depth rounded to 0.22) + (CHARWD R 1.22) + (CHARHT R 0.22) + (CHARDP R 0.2201) + ) -- cgit v1.2.3