blocktronics / moebius

Modern ANSI & ASCII Art Editor
https://blocktronics.github.io/moebius/
Apache License 2.0
756 stars 41 forks source link

Some control characters should be disallowed in .ans format #156

Closed andyherbert closed 3 years ago

andyherbert commented 4 years ago

Tab, CR, LF?

bart-d commented 4 years ago

there's actually a difference between Pablodraw and Ansilove here. Pablodraw would render the printable version of the control characters and ansilove wouldn't. a TAB is a TAB and not in circle in this case. it would be best for all to behave in the same way indeed.

andyherbert commented 4 years ago

Looking at the libansilove source unprintables are lf, cr, eof (sub), tab (which tabs eight spaces). I guess the reasoning for this is that anslove is meant to render not just ansiart but plaintext documents.

fcambus commented 4 years ago

The reasoning behind those choices in libansilove is to be faithful to how ANSI.SYS and MS-DOS editors/viewer rendered things, as the vast majority of artworks contained in packs were created using those tools.

andyherbert commented 4 years ago

I think the DOS sources are open now? I've not had a look but I imagine the behaviour would be hard to interpret from assembly. Also I noticed in libansilove that CR is ignored and LF returns to the first column and inserts and newline when the correct behaviour should be CR returns to the first column and LF inserts a newline (which I think was the justification of having two control characters instead of just one).

bart-d commented 4 years ago

it could also be just a parameter for ansilove to print control characters. I'm not really aware how tabs are used currently, it's not visible because they currently 'render correctly'. changing the behavior might mess them up in stead.

andyherbert commented 4 years ago

As an artist I second that forcing save as a BIN with a "this uses non-standard characters" warning is a good idea also maybe mark those special characters in red in the font selection dropdown

bart-d commented 4 years ago

PR: i suggest warning the user prior to saving when these specific control characters are found in the document:

image