Grid Sage Forums

Grid Sage Forums

  • April 29, 2024, 12:22:18 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: ANSI format does not like ubuntu terminal  (Read 996 times)

phil123456

  • Unaware
  • *
  • Posts: 6
    • View Profile
ANSI format does not like ubuntu terminal
« on: July 30, 2020, 04:57:30 AM »

Hello,

I tried to print the content of my image.ans in the terminal (with "cat" command as well as dumping it in C through a UART)

and it's all scrambled in the shell

https://i.imgur.com/fmU2gzt.png

I checked the format and I see a lot of weird escape sequences (ex : ESC[7h does not appear to be standard http://ascii-table.com/ansi-escape-sequences.php)

is there a way to just export the characters and their colors ?

https://i.imgur.com/Kzj61My.png
« Last Edit: July 30, 2020, 05:33:40 AM by phil123456 »
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4316
    • View Profile
    • Cogmind
Re: ANSI format does not like ubuntu terminal
« Reply #1 on: July 30, 2020, 05:06:36 AM »

There are many export options, you'll have to check the manual to see all the details.

As for Ubuntu, can't say if it's user error here or maybe they have a different implementation. Note that technically there is more than one .ans format out there, though the one used by REXPaint is the most common format found in the ANSI art community, for whom this export type was added.

I can't guarantee that it will work in every terminal out there. In fact, I'm sure it doesn't :P
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

phil123456

  • Unaware
  • *
  • Posts: 6
    • View Profile
Re: ANSI format does not like ubuntu terminal
« Reply #2 on: July 30, 2020, 05:37:36 AM »

In fact, I'm sure it doesn't :P

so then what's the point ?

I'll check the options, but technicaly speaking I only need ESC[FF;BBm color escapes
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4316
    • View Profile
    • Cogmind
Re: ANSI format does not like ubuntu terminal
« Reply #3 on: July 30, 2020, 05:55:27 AM »

so then what's the point ?
Already stated the point in the previous post: The format chosen was the one commonly used by ANSI artists (who happen to be the ones who requested the feature in the first place :P). There were never pans to add support for the numerous kinds of different terminals out there.

It's literally impossible for a single format to work everywhere, hence me knowing that it doesn't work with "every terminal out there"! As designed it works perfectly fine for certain use cases, though.

I'd consider expanding support in the future, although I'd need a detailed spec, at this point preferably including multiple formats or configurations to get many in one go, and add a new kind of tweakable setting for it. Maybe something more likely for 2.0, but in either case it would take users providing the necessary reference material.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

phil123456

  • Unaware
  • *
  • Posts: 6
    • View Profile
Re: ANSI format does not like ubuntu terminal
« Reply #4 on: July 30, 2020, 06:05:53 AM »

ok but how do artists display thes .ans file ?

as for me, I managed to make it work

1 some escape sequences are either irrelevant nor non standard, so I filtered them
2 UART's and terminals use UTF8 ..who would have thought, so I have to conver characters tu utf8 characters

thanks for your help
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4316
    • View Profile
    • Cogmind
Re: ANSI format does not like ubuntu terminal
« Reply #5 on: July 30, 2020, 06:13:52 AM »

ok but how do artists display thes .ans file ?
The .ans files output by REXPaint work can also be displayed in other popular ANSI art programs, and software/browsers based on them or the same format. The main issue is that there isn't an .ans standard--there are multiple formats out there, so any given format won't work everywhere.

But yeah I was just gonna suggest that I imagine you could either filter this particular .ans output for what you need, or another alternative approach would be to convert something like the .csv export to your needs, since that includes character and color info in an easily parseable manner.

Glad you got it working for what you need. REXPaint uses UTF8 export for some of its text mode outputs (where necessary), though not .ans I guess :)
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

phil123456

  • Unaware
  • *
  • Posts: 6
    • View Profile
Re: ANSI format does not like ubuntu terminal
« Reply #6 on: July 30, 2020, 06:19:47 AM »

I found something cool

https://onlineutf8tools.com/convert-utf8-to-hexadecimal

now I do (under windows) ALT + [some ascii code]..like ALT+220 for ▄

then I paste that ▄ into the page, it gives me the 3 hex UTF8 bytes, that I can just output to have the same character :-)
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4316
    • View Profile
    • Cogmind
Re: ANSI format does not like ubuntu terminal
« Reply #7 on: July 30, 2020, 06:23:57 AM »

Nice :)
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon