Skip to content

Commit 3f9152d

Browse files
committed
[printer-emulator] PDF printers should support form feed.
1 parent fc17f03 commit 3f9152d

File tree

9 files changed

+34
-0
lines changed

9 files changed

+34
-0
lines changed

lib/printer-emulator/atari_1025.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ void atari1025::pdf_handle_char(uint16_t c, uint8_t aux1, uint8_t aux2)
172172
}
173173
else if (c == 27)
174174
escMode = true;
175+
else if (c == 12) // form feed.
176+
{
177+
pdf_end_page();
178+
pdf_new_page();
179+
}
175180
else
176181
{ // maybe printable character
177182
print_char(c);

lib/printer-emulator/atari_1027.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ void atari1027::pdf_handle_char(uint16_t c, uint8_t aux1, uint8_t aux2)
3939
uscoreFlag = false;
4040
else if (c == 27)
4141
escMode = true;
42+
else if (c == 12)
43+
{
44+
pdf_end_page();
45+
pdf_new_page();
46+
}
4247
else
4348
{ // maybe printable character
4449
//printable characters for 1027 Standard Set + a few more >123 -- see mapping atari on ATASCII

lib/printer-emulator/atari_1029.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ void atari1029::pdf_handle_char(uint16_t c, uint8_t aux1, uint8_t aux2)
221221
pdf_X += charWidth; // update x position
222222
}
223223
}
224+
else if (c == 12)
225+
{
226+
pdf_end_page();
227+
pdf_new_page();
228+
}
224229
else if (c > 31 && c < 127)
225230
{
226231
if (c == '\\' || c == '(' || c == ')')

lib/printer-emulator/atari_820.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ void atari820::pdf_handle_char(uint16_t c, uint8_t aux1, uint8_t aux2)
4141
// could increase charWidth, but not necessary to make this work. I force EOL.
4242
}
4343

44+
if (c == 12)
45+
{
46+
pdf_end_page();
47+
pdf_new_page();
48+
}
49+
4450
// maybe printable character
4551
if (c > 31 && c < 127)
4652
{

lib/printer-emulator/atari_822.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ void atari822::pdf_handle_char(uint16_t c, uint8_t aux1, uint8_t aux2)
8282

8383
// TODO: looks like auto wrapped lines are 1 dot apart and EOL lines are 3 dots apart
8484

85+
if (textMode && c == 12)
86+
{
87+
pdf_end_page();
88+
pdf_new_page();
89+
}
90+
8591
// simple ASCII printer
8692
if (textMode && c > 31 && c < 127)
8793
{

lib/printer-emulator/atari_825.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ void atari825::pdf_handle_char(uint16_t c, uint8_t aux1, uint8_t aux2)
185185
pdf_dY -= lineHeight; // set pdf_dY and rise to N1/216.
186186
pdf_set_rise();
187187
break;
188+
case 12: // Form feed
189+
pdf_end_page();
190+
pdf_new_page();
191+
break;
188192
case 13: // Carriage Return.
189193
// Prints buffer contents and resets buffer character count to zero
190194
// Implemented outside in pdf_printer()

lib/printer-emulator/atari_xdm121.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ void xdm121::pdf_handle_char(uint16_t c, uint8_t aux1, uint8_t aux2)
220220
break;
221221
case 12: // XDM Advances paper to next logical TOF (top of form)
222222
pdf_end_page();
223+
pdf_new_page();
223224
// XMM
224225
break;
225226
case 13: // XDM Carriage Return.

lib/printer-emulator/atari_xmm801.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ void xmm801::pdf_handle_char(uint16_t c, uint8_t aux1, uint8_t aux2)
448448
if (intlFlag)
449449
break;
450450
pdf_end_page();
451+
pdf_new_page();
451452
// XMM
452453
break;
453454
case 13: // Carriage Return.

lib/printer-emulator/epson_80.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ void epson80::pdf_handle_char(uint16_t c, uint8_t aux1, uint8_t aux2)
439439
break;
440440
case 12: // Advances paper to next logical TOF (top of form)
441441
pdf_end_page();
442+
pdf_new_page();
442443
break;
443444
case 13: // Carriage Return.
444445
// Prints buffer contents and resets buffer character count to zero

0 commit comments

Comments
 (0)