Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster printing by printing from right to left, when at the end of a line #50

Open
sirexeclp opened this issue Jan 7, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@sirexeclp
Copy link

sirexeclp commented Jan 7, 2020

The Olivetti 900X in this video prints in both directions:
https://www.youtube.com/watch?v=SpOyk6n5WTw
Obviously this needs to be done in software, but if more than one line are to be printed and are buffered somewhere or passed to the print function, it could do just a new line , no carriage return and print the next line in reverse.

8DH Rückwärtsdruck OFF Rückwärtsdruck aus (*); Vorwärtsdruck (Zeichendruck, dann Vorschub)
8EH Rückwärtsdruck ON Rückwärtsdruck ein (*); Rückwärtsdruck (erst Vorschub rückwärts, dann Zeichendruck)
@sirexeclp sirexeclp added the enhancement New feature or request label Jan 7, 2020
@ArchibaldBienetre
Copy link

Out of scope? optimizing ASCII art rendering

@ArchibaldBienetre
Copy link

ArchibaldBienetre commented Jan 26, 2020

#53 is merged, but def _fast_print(self, text) is not a fully-fledged part of the API, yet.

I'll add some tests, rename the method (remove leading "_"), and propose a pull request here, soon.

Also, I'll try to fix the current bug that for odd-numbered line input, fast_print will ignore the last line, because of the way the lines are zipped into pairs:

>>> lines = ["line1", "line2", "line3", "line4", "line5"]
>>> line_pairs=zip(lines[::2], lines[1::2])
>>> for pair in line_pairs: 
...     print(f"pair: ({pair[0]}, {pair[1]})")
... 
pair: (line1, line2)
pair: (line3, line4)
>>> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants