aewan(5)
π 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:
- the character that is in it
- 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= black1= red2= green3= yellow4= blue5= magenta6= cyan7= white
the 8 bits of the attribute have the following meanings: SFFFLBBB
where:
Sis the standout bitFFFis the 3-bit color code for the foreground colorLis the blink bitBBBis 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 πβ¨ππ¦πΈ
π¦ where this page comes from
- debian bookworm: aewan 1.0.01-5+b1 Β· GPL-2.0-or-later
- debian trixie: aewan 1.0.01-6 Β· GPL-2.0-or-later
- ubuntu jammy: aewan 1.0.01-5 Β· GPL-2.0-or-later
- ubuntu noble: aewan 1.0.01-5 Β· GPL-2.0-or-later
- ubuntu questing: aewan 1.0.01-6
- ubuntu resolute: aewan 1.0.01-6build1 Β· GPL-2.0-or-later
- ubuntu stonking: aewan 1.0.01-6build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms