Skip to content

Commit

Permalink
Revert "Slightly more robust coding"
Browse files Browse the repository at this point in the history
which really was changes to Fontmap that weren't yet ready for inclusion

This reverts commit 8144738.
  • Loading branch information
brucemiller committed Aug 11, 2024
1 parent f4e6559 commit 1669a34
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/LaTeXML/Common/Font/Metric.pm
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,15 @@ sub read_tfm {
my ($skip, $next, $op, $remainder);
($skip, $next) = unpack "CC", $lig_kern[0];
if (($skip == 255) && (defined $$fontmap[$next])) {
$$self{boundary} = (ref $$fontmap[$next] ? $$fontmap[$next][0] : $$fontmap[$next]); }
$$self{boundary} = $$fontmap[$next]; }
($skip, $next, $op, $remainder) = unpack "CCCC", $lig_kern[-1];
if ($skip == 255) {
$self->process_lig_kern("boundary", \@lig_kern, 256 * $op + $remainder, $fontmap, \@kern); }
}
# Interpret char_info (for w,h,d,ital) and lig_kern program
my $sizes = $$self{sizes};
for (my $code = $bc ; $code <= $ec ; $code++) {
my $mapentry = $$fontmap[$code];
my $char = (ref $mapentry ? $$mapentry[0] : $mapentry);
my $char = $$fontmap[$code];
if (defined $char) {
my ($wloc, $hdloc, $ixloc, $remainder) = unpack "C4", $char_info[$code];
my ($hloc, $dloc, $iloc, $tag) = ($hdloc >> 4, $hdloc & 0x0F, $ixloc >> 2, $ixloc & 0x03);
Expand Down Expand Up @@ -153,15 +152,12 @@ sub process_lig_kern {
$prognum = 256 * $op + $remainder; $firstinstr = 0;
next; }
$next = $$fontmap[$next];
$next = $$next[0] if ref $next;
my $pair = $char . $next;
if (($op >= 128) && !exists $$kerns{$pair}) {
$$kerns{$pair} = $$kernref[256 * ($op - 128) + $remainder]; }
if (($op < 128) && !exists $$ligs{$pair}) {
my ($pass, $keepc, $keepn) = ($op >> 2, ($op >> 1) & 0x01, $op & 0x01);
my $rchar = $$fontmap[$remainder];
$rchar = $$rchar[0] if ref $rchar;
my $lig = ($keepc ? $char : "") . $rchar . ($keepn ? $next : '');
my $lig = ($keepc ? $char : "") . $$fontmap[$remainder] . ($keepn ? $next : '');
$$ligs{$pair} = [$lig, $pass]; } # ligature & number of chars to "passover" (always 0???)
last if ($skip >= 128);
$prognum += $skip + 1;
Expand Down

0 comments on commit 1669a34

Please sign in to comment.