aewan(5)

πŸ“¦
version 1.0.01 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– aewan(5) β€” File Format Documentation πŸ’–

okay bestie, so aewan(5) is the manual page that spills ALL the tea about how Aewan files are actually built. it's a file format doc, and honestly? it ate. let's get into it πŸ¦‹


✨ INTRODUCTION ✨

so starting with version 0.9.0, Aewan got a whole new glow-up of a file format β€” one that's way easier to parse. bestie, the old versions used a binary format that was basically largely undocumented (πŸ™ˆ not cute), and they relied on a program called ae2aes to convert it into something readable. with the new format, the ae2aes utility became unnecessary and was deprecated. rip bozo πŸ’€

here's the thing though: an aewan document is a gzipped file. so you literally must gunzip it first before you can parse what's inside. on the command line you could use zcat or something of the sort. in a program, you'll probably want to use the zlib library. no cap.

and like, in the future it might be better for Aewan to supply a shared library so you could parse aewan files with minimal effort πŸ‘‘ β€” such a library would have to be integrated with the editor in order not to have to duplicate code (i.e. the editor itself would be just a client of the library). but for the time being? you have to read and parse the format on your own. sorry babe, main character energy means doing it yourself πŸ’…


🌸 FILE FORMAT 🌸

in the description below, the items in between brackets are NOT literal β€” they're placeholders. [S] is a placeholder for a string, [N] is a placeholder for a decimal integer, and [B] is a placeholder for a boolean value ('true' or 'false'). and a line with "..." isn't literal either, it just means the lines above repeat a certain number of times. periodt.

<Aewan Document v1
   layer-count: int: [N]
   meta-info: str: [S]
   <Layer
        name: str: [S]
        width: int: [N]
        height: int: [N]
        visible: bool: [B]
        transparent: bool: [B]
        layer-line: str: [S]
        layer-line: str: [S]
        layer-line: str: [S]
        (...there are <height> such lines...)
   >Layer
   (...there are <layer-count> such blocks...)
>Aewan Document v1

now listen closely, this part matters πŸ”₯:

  • indentation is ignored
  • but all other whitespace is significant
  • in particular, you can't omit the space that immediately follows the ':' field delimiters, or supply more than one space there
  • and notice the file format does not use any quotation marks for the values β€” not even strings
like, zero quotes. none. the strings are just out there raw. it's giving bold. πŸ’œ

πŸŽ€ REPRESENTATION OF STRINGS πŸŽ€

strings are represented almost literally in the file (where the [S] placeholders are in the blueprint above), and they are not put in between quotes or anything. so chill.

however βœ‹ special characters (ASCII codes 1 to 31) are escaped: the escape code is a backslash, followed by the character '0' + ch, where ch is the special character.

thus, a newline character would be represented by "\:", since ":" is '0' + 10. iykyk πŸ’…


⭐ REPRESENTATION OF INTEGERS AND BOOLEANS ⭐

integers use just the plain old decimal representation. simple. iconic.

the booleans are represented as strings: either "true" or "false" (without quotes). yes bestie, booleans wearing a string costume. we love a disguise 🧚


πŸ¦‹ REPRESENTATION OF LAYER LINES πŸ¦‹

each layer-line is a string, but it's specially formatted in order to convey the characters and attributes in that line. okay so to understand the format of a layer-line string, we first gotta introduce the concept of cells.

a cell in an aewan layer is each of the spaces that can contain a character. a cell has two pieces of data:

  1. the character that is in it
  2. a color attribute

the character is just that: an 8-bit value representing the character drawn there. the color attribute is an 8-bit unsigned value that packs the foreground and background color of a given cell, as well as standout and blink attributes.

the following color codes are used:

  • 0 = black
  • 1 = red
  • 2 = green
  • 3 = yellow
  • 4 = blue
  • 5 = magenta
  • 6 = cyan
  • 7 = white

the 8 bits of the attribute have the following meanings: SFFFLBBB

where:

  • S is the standout bit
  • FFF is the 3-bit color code for the foreground color
  • L is the blink bit
  • BBB is the 3-bit color code for the background color

the layer-line string is composed of the hexadecimal representation of layer_width*2 bytes. each 2 bytes is the information for one cell of the line: the first byte is the character, and the second is the attribute. πŸ”₯

for example, the hex representation for 'A' is 0x41, so a line with five 'A's, each of them in a different foreground color (but all with black background), would be represented as:

41104120413041404150

ate. no crumbs. πŸ‘‘


πŸ’œ LICENSE INFORMATION πŸ’œ

Copyright (c) 2004-2005 Bruno Takahashi C. de Oliveira. All rights reserved.

This program is licensed under the GNU General Public License, version 2 or, at your option, any later version. For full license information, please refer to the COPYING file that accompanies the program.


🌈 SEE ALSO 🌈


and that's the whole vibe check, bestie 🫢 this was aewan(5) from the Aewan Ascii Art Editor, dated August 2005 β€” go forth and parse, you absolute icon πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ