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

Support for word wrap #7

Open
TidemannNorli opened this issue Mar 29, 2021 · 3 comments
Open

Support for word wrap #7

TidemannNorli opened this issue Mar 29, 2021 · 3 comments

Comments

@TidemannNorli
Copy link

Hi,

It would be super helpful if you would implement word wrap functionality, is that something you will implement?

Thanks

@receiptline
Copy link
Owner

Hello!

Thanks for using receiptline.

The current word wrapping is the same as in the console application, so the words are broken.
Equivalent to CSS word-break: break-all;

The quick br
own fox jump
s over the l
azy dog.
It's superca
lifragilisti
cexpialidoci
ous!

We will consider another word wrapping support.
Equivalent to CSS overflow-wrap: break-word;

The quick
brown fox
jumps over
the lazy
dog.
It's
supercalifra
gilisticexpi
alidocious!

@DS992
Copy link

DS992 commented Apr 6, 2021

Could not receiptline programmatically add a "\n" when a line has a certain amount of characters before the last word?

This way you can achieve word wrap with break-word

@receiptline
Copy link
Owner

Thank you very much.

When using \n, write as follows.
(equivalent to <br> in html)

{width:12}
|The quick\nbrown fox\njumps over\nthe lazy\ndog.\nIt's\nsupercalifragilisticexpialidocious! |

We had a meeting yesterday to discuss the ReceiptLine language specification.
I shared this issue with attendees, and there was a suggestion that we don't need overflow-wrap: break-word;.

I think this is because the number of characters in a column is often fixed for receipts, so \n can handle it.

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

No branches or pull requests

3 participants