Skip to content

Commit

Permalink
Handle Perforation Skip softswitch
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Leroy-Mira committed Oct 18, 2024
1 parent 5df22fc commit 8907d91
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/imagewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,18 @@ void Imagewriter::updateSwitch()
curMap[0x7c] = intCharSets[charmap][7];
curMap[0x7d] = intCharSets[charmap][8];
curMap[0x7e] = intCharSets[charmap][9];

if (switcha & SWITCHA_PERFORATIONSKIP)
{
topMargin = 0.25;
bottomMargin = pageHeight - 0.25;
}
else
{
topMargin = 0.0;
bottomMargin = pageHeight - 0.0;
}

//MSB control (Switch B-6)
if (!(switchb & 32))
{
Expand Down Expand Up @@ -842,8 +854,8 @@ bool Imagewriter::processCommandChar(Bit8u ch)
x++;
}
pageHeight = (Real64)PARAM4(0)/144;
bottomMargin = pageHeight;
topMargin = 0.0;
// trigger margins computation
updateSwitch();
break;
}
case 0x21: // Select bold font (ESC !) IW
Expand Down

0 comments on commit 8907d91

Please sign in to comment.