diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-08-16 11:22:48 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-08-16 11:22:48 +0000 |
commit | a981bfca982db54c356d2f1eb9426ca75efcdebf (patch) | |
tree | 620c3f6d178f845c0897edc8f5ed0aad658a134d /Build/source/texk/web2c/omegafonts | |
parent | 9fc908a02f223f2262b33b1cc87ab19b6fe15fef (diff) |
texk/web2c/omegafonts: Fixed some minor bugs
git-svn-id: svn://tug.org/texlive/trunk@34948 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/omegafonts')
-rw-r--r-- | Build/source/texk/web2c/omegafonts/char_routines.c | 19 | ||||
-rwxr-xr-x | Build/source/texk/web2c/omegafonts/ligkern.test | 32 | ||||
-rw-r--r-- | Build/source/texk/web2c/omegafonts/ligkern_routines.c | 40 |
3 files changed, 37 insertions, 54 deletions
diff --git a/Build/source/texk/web2c/omegafonts/char_routines.c b/Build/source/texk/web2c/omegafonts/char_routines.c index fc8a0ef7a7f..7f3989b33ee 100644 --- a/Build/source/texk/web2c/omegafonts/char_routines.c +++ b/Build/source/texk/web2c/omegafonts/char_routines.c @@ -658,7 +658,7 @@ adjust_labels(boolean play_with_starts) label_ptr = 0; label_table[0].rr = -1; /* sentinel */ - if (bchar_label != 0) { + if (!play_with_starts && (bchar_label < nl)) { label_ptr = 1; label_table[1].cc = -1; label_table[1].rr = bchar_label; @@ -667,14 +667,25 @@ adjust_labels(boolean play_with_starts) FOR_ALL_CHARACTERS( unsigned c = plane*PLANE + index; if ((c>=bc) && (c<=ec) && (entry->tag == TAG_LIG)) { + int r = entry->remainder; + if (r < nl) { + unsigned s = lig_kern_table[r].entries[0]; + if ((s < 256) && (s > STOP_FLAG)) { + r = 256 * lig_kern_table[r].entries[2] + lig_kern_table[r].entries[3]; + if (!play_with_starts && (r < nl) && (activity[entry->remainder] == A_UNREACHABLE)) + activity[entry->remainder] = A_PASS_THROUGH; + } + } sort_ptr = label_ptr; /* hole at position sort_ptr+1 */ - while (label_table[sort_ptr].rr > (int)(entry->remainder)) { + while (label_table[sort_ptr].rr > r) { label_table[sort_ptr+1] = label_table[sort_ptr]; sort_ptr--; /* move the hole */ } label_table[sort_ptr+1].cc = c; - label_table[sort_ptr+1].rr = entry->remainder; + label_table[sort_ptr+1].rr = r; label_ptr++; + if (!play_with_starts) + activity[r] = A_ACCESSIBLE; } ) if (play_with_starts) { @@ -706,7 +717,7 @@ adjust_labels(boolean play_with_starts) } } } - if (bchar_label != 0) { + if (bchar_label < nl) { lig_kern_table[nl-1].entries[2] = (bchar_label + lk_offset) / (max_start + 1); lig_kern_table[nl-1].entries[3] = (bchar_label + lk_offset) % (max_start + 1); } diff --git a/Build/source/texk/web2c/omegafonts/ligkern.test b/Build/source/texk/web2c/omegafonts/ligkern.test index e6ec4675eda..48868201831 100755 --- a/Build/source/texk/web2c/omegafonts/ligkern.test +++ b/Build/source/texk/web2c/omegafonts/ligkern.test @@ -9,9 +9,7 @@ TEXMFCNF=$srcdir/../../kpathsea OFMFONTS='.;./tests' export TEXMFCNF OFMFONTS -ligfiles='ligall ligbch ligblb' - -for f in $ligfiles; do +for f in ligall ligbch ligblb ligbdy; do echo && echo "*** opl2ofm $f x$f" ./omfonts -opl2ofm $srcdir/tests/$f tests/x$f || exit 1 @@ -24,34 +22,6 @@ diff $srcdir/tests/$f.opl tests/x$f.opl || exit 1 done -ligfiles='ligbdy' - -for f in $ligfiles; do - -echo && echo "*** opl2ofm $f x$f" -./omfonts -opl2ofm $srcdir/tests/$f tests/x$f || echo '*** failed ***' - -echo && echo "*** ofm2opl x$f x$f" -./omfonts -ofm2opl tests/x$f tests/x$f || echo '*** failed ***' - -echo && echo "*** diff $f.opl x$f.opl" -diff $srcdir/tests/$f.opl tests/x$f.opl || echo '*** failed ***' - -if false; then - -echo && echo "*** opl2ofm $f x$f" -../wopl2ofm $srcdir/tests/$f tests/x$f || exit 1 - -echo && echo "*** ofm2opl x$f x$f" -./omfonts -ofm2opl tests/x$f tests/x$f || echo '*** failed ***' - -echo && echo "*** diff $f.opl x$f.opl" -diff $srcdir/tests/$f.opl tests/x$f.opl || echo '*** failed ***' - -fi - -done - echo && echo "*** ovp2ovf ligblv xligblv xligblv" ./omfonts -ovp2ovf $srcdir/tests/ligblv tests/xligblv tests/xligblv || echo '*** failed ***' diff --git a/Build/source/texk/web2c/omegafonts/ligkern_routines.c b/Build/source/texk/web2c/omegafonts/ligkern_routines.c index 50d8dd0a481..e8993c85484 100644 --- a/Build/source/texk/web2c/omegafonts/ligkern_routines.c +++ b/Build/source/texk/web2c/omegafonts/ligkern_routines.c @@ -41,7 +41,8 @@ unsigned no_kerns = 0; unsigned min_nl=0; unsigned bchar = CHAR_BOUNDARY; -unsigned bchar_label = 0; +#define MAX_LABEL 0x7fffffff +unsigned bchar_label = MAX_LABEL; unsigned bchar_remainder; unsigned lk_step_ended=FALSE; @@ -87,8 +88,7 @@ set_label_command(unsigned c) } else { check_char_tag(c); set_char_tag(c, TAG_LIG); - if (nl==0) set_char_remainder(c, 0); - else set_char_remainder(c, nl); + set_char_remainder(c, nl); } if (min_nl <= nl) { min_nl = nl+1; } lk_step_ended = FALSE; @@ -397,7 +397,7 @@ void check_ligature_ends_properly(void) { if (nl>0) { - if (bchar_label != 0) { + if (bchar_label < nl) { /* make room for it; the actual label will be stored later */ lig_kern_table[nl].entries[0] = 255; lig_kern_incr(); @@ -484,7 +484,7 @@ check_ligature_infinite_loops(void) x_lig_cycle, y_lig_cycle); } clear_ligature_entries(); - nl = 0; bchar = CHAR_BOUNDARY; bchar_label = 0; + nl = 0; bchar = CHAR_BOUNDARY; bchar_label = MAX_LABEL; } } @@ -617,21 +617,23 @@ retrieve_ligkern_table(unsigned char *ofm_lig_table, activity = (unsigned char *) xcalloc(lig_kern_size, sizeof(unsigned char)); - if (lig_kern_table[0].entries[0] == 255) { - bchar = lig_kern_table[0].entries[1]; - print_boundary_char(bchar); - activity[0] = A_PASS_THROUGH; - } - if (lig_kern_table[nl-1].entries[0] == 255) { - unsigned r = 256 * lig_kern_table[nl-1].entries[2] + lig_kern_table[nl-1].entries[3]; - if (r >= nl) { - fprintf(stderr, "Ligature/kern starting index for boundarychar is too large;\n" - "so I removed it.\n"); - } else { - bchar_label = r; - activity[r] = A_ACCESSIBLE; + if (nl > 0) { + if (lig_kern_table[0].entries[0] == 255) { + bchar = lig_kern_table[0].entries[1]; + print_boundary_char(bchar); + activity[0] = A_PASS_THROUGH; + } + if (lig_kern_table[nl-1].entries[0] == 255) { + unsigned r = 256 * lig_kern_table[nl-1].entries[2] + lig_kern_table[nl-1].entries[3]; + if (r >= nl) { + fprintf(stderr, "Ligature/kern starting index for boundarychar is too large;\n" + "so I removed it.\n"); + } else { + bchar_label = r; + activity[r] = A_ACCESSIBLE; + } + activity[nl-1] = A_PASS_THROUGH; } - activity[nl-1] = A_PASS_THROUGH; } kern_table = (fix *) xmalloc((nk+1)*sizeof(int)); |