Comments (5)
I committed a (possible) fix in the repo some time ago, but didn't build a new release that wrote implied line endings (line feed only) when exporting at utf-8, because I presume this is what most people expect.
from moebius.
a terminal width of 80 columns is assumed unless specified otherwise (SAUCE). if you want to display on wider terminals, you need to parse the escape codes and wrap the lines yourself. This is not a Moebius specific item, most if not all editors assumes a terminal width of 80.
from moebius.
Steps I used to convert for utf-8 format:
cat LU-Holiday.ans | iconv -f CP437 | sed 'H;$!d;x;s/\x1A.*$//'
from moebius.
Check my first hand-edited version is now available for modern terminal emulators (colors depend on terminal colors):
poetaman/arttime@153cd08#commitcomment-88263554
An ideal and concise spec for outputting ANSI for modern terminal emulators would be:
- break every line at art width,
- start and end every line with with clear escape code
\E[0
, - patch places where author assumes default black background and default white foreground within art so it picks terminal's black/white instead of terminal's background/foreground (can require a combination of: a) replacing
\E[49m
with\E[40m
, b)\E[39m
with\E[30m
, c) adding/adjusting spaces at edges).
Am not suggesting Moebius to not do what it does today, additionally implementing an export option that follows the spec above will make it easy to use ANSI art in modern terminal emulator based applications. Terminal emulators are the most natural home for ANSI.
from moebius.
@andyherbert Nice, I would totally give it a try after your upcoming build is released. Btw, request 2) start and end every line with with clear escape code \E[0
from above comment would be ideal to have. Here's my reasoning why 1) might not be sufficient for modern terminal emulators. Am copying my comment here from the same issue filed on pablodraw (cwensley/pablodraw#70 (comment)):
@tracker1 Sooner or later users will also hit the issue where they cat the file on a wide terminal (wider than art) and the area to the right of art has stripes of different colors than the terminals background. Given modern terminals can be arbitrary size, and user might want to place the content anywhere on the screen, it would be good if styling of art does not interfere with contents around it. One could argue that every application that wants to display ANSI art in modern terminals should parse escape sequences in prior line, save it, clear it at boundary, and recreate it at the beginning of next line. It would be difficult to say the least, and error prone. I would assume such state information already exists in some form in pablodraw as its renderer is able to render every glyph accurately with desired style. Here's the suggestion from my above post (copied here):
An ideal and concise spec for outputting ANSI for modern terminal emulators would be:
- break every line at art width,
- start and end every line with with clear escape code
\E[0
,- patch places where author assumes default black background and default white foreground within art so it picks terminal's black/white instead of terminal's background/foreground (can require a combination of: a) replacing
\E[49m
with\E[40m
, b)\E[39m
with\E[30m
, c) adding/adjusting spaces at edges).Think of it as placing an image in modern day UI, the stylizing of the image and its caption shouldn't affect the style of the contents around it (hence the trailing
\E[0
). Same goes the other way round, an application's line styling shouldn't affect the image being placed (hence the beginning\E[0
). Whoever is coding their application and placing such a text-element on a wide terminal, they are responsible to recreate the styling they want after the trailing\E[0
that marks end of art (i.e for the region of their application). IMHO it will make developing for modern terminal's UI easier if such pattern is followed in general.P.S. I may be slow to respond in coming days.
from moebius.
Related Issues (20)
- Chat should scroll on new messages
- Multiple Server Instances HOT 3
- Unable to run server on Debian 11
- debian package requires libappindicator3-1 HOT 3
- Handle file not found on command line
- Server file selection HOT 1
- Feature Request: Load image in background for tracing HOT 2
- Last selected block is cut when using CTRL+SHIFT+X to swap colors HOT 1
- Option to switch from using F-row / F-keys to regular number row HOT 4
- Request for way to browse with thumbnails (a la Pablo Draw) when looking for files to open
- allow shading for half block sizes
- Requesting user guide - maybe also stylized font. HOT 1
- Does not currently support .BBS files - ansi/ascii art files used in Wildcat! BBS systems
- TDF support
- Linux arm64 builds/packages HOT 1
- 'Open in Current Window' and 'Open Reference Image' both use 'Ctrl-Shift-O' in Win 10, but only the latter functions as expected.
- Running Moebius.exe results Windows Defender action
- new release?
- Export UTF8 and macOS terminal HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moebius.