piece
piece copied to clipboard
A fast, feature rich artscene parser
piece-c
Fast, feature-rich Artscene render engine
Example
$ piece -o docs/font/cp437_8x16.png docs/font/test.ans
And the resulting image:
We can also request piece to use an Amiga font:
$ piece -f amiga -o docs/font/topaz_a1200.png docs/font/test.ans
Resulting in:
Features
Supported file formats
- ANSi (.ans), mostly ECMA-048 compliant
- ASCII (.asc, .diz)
- Artworx (.adf)
- BIN (.bin)
- iCE Draw (.idf)
- PCBoard (.pcb)
- RIPScript (.rip, TODO)
- TundraDraw (.tnd)
- XBIN (.xb), fully Acid XBIN compliant
Supported pixel fonts
MS-DOS ("OEM") fonts
| Font | Description | Sizes |
|---|---|---|
| cp437 | MS-DOS Latin US | 8x8 thin_8x8 8x14 8x16 thin_8x16 |
| cp737 | MS-DOS Greek | 8x16 |
| cp775 | MS-DOS Baltic Rim | 8x16 |
| cp850 | MS-DOS Latin 1 | 8x8 8x14 8x16 thin_8x8 thin_8x16 |
| cp852 | MS-DOS Latin 2 | 8x16 |
| cp855 | MS-DOS Cyrillic | 8x16 |
| cp857 | MS-DOS Turkish | 8x16 |
| cp860 | MS-DOS Portuguese | 8x16 |
| cp861 | MS-DOS Icelandic | 8x16 |
| cp862 | MS-DOS Hebrew | 8x16 |
| cp863 | MS-DOS French Canada | 8x16 |
| cp865 | MS-DOS Nordic | 8x8 8x14 8x16 thin_8x8 thin_8x16 |
| cp866 | MS-DOS Cyrillic CIS 1 | 8x8 8x14 8x16 |
| cp866b | MS-DOS Bulgarian | 8x16 |
| cp866c | MS-DOS Russian | 8x16 |
| cp866u | MS-DOS Ukrainian | 8x8 8x14 8x16 |
| cp869 | MS-DOS Greek 2 | 8x16 |
| cp1251 | MS-DOS Slavic | 8x8 8x14 8x16 |
Amiga fonts
| Font | Description | Sizes |
|---|---|---|
| b_strict | Amiga B-Strict | 8x8 |
| b_struct | Amiga B-Strict | 8x8 |
| microknight | Amiga MicroKnight | 8x16 |
| microknight_plus | Amiga MicroKnight enhanced version | 8x16 |
| mo_soul | Amiga mO'sOul | 8x16 |
| p0t_noodle | Amiga P0T-NOoDLE | 8x16 |
| topaz_a500 | Amiga Topaz 1 (A500, A1000, A2000) | 8x16 |
| topazplus_a500 | Amiga Topaz 1 enhanced version | 8x16 |
| topaz_a1200 | Amiga Topaz 2 (A600, A1200, A4000) | 8x16 |
| topazplus_a1200 | Amiga Topaz 2 enhanced version | 8x16 |
Atari fonts
| Font | Description | Sizes |
|---|---|---|
| atascii_arabic | Atari ATASCII Arabic | 8x16 |
| atascii_graphics | Atari ATASCII Graphics | 8x16 |
| atascii_international | Atari ATASCII International | 8x16 |
Commodore 64 fonts
| Font | Description | Sizes |
|---|---|---|
| petscii | Commodore 64 PETSCII (unshifted) | 8x16 |
| petscii_shifted | Commodore 64 PETSCII (shifted) | 8x16 |
Miscellanious fonts
| Font | Description | Sizes |
|---|---|---|
| armscii8 | Armenian ASCII (ARMSCII) | 8x8 8x14 8x16 |
| haik8 | haik8 code page (ARMSCII) | 8x8 8x14 8x16 |
| iso | West European | 8x8 8x14 8x16 thin_8x16 |
| iso02 | Central European | 8x8 8x14 8x16 |
| iso04 | Baltic | 8x8 8x14 8x16 |
| iso05 | Cyrillic | 8x8 8x14 8x16 |
| iso07 | Greek | 8x8 8x14 8x16 |
| iso08 | Hebrew | 8x8 8x14 8x16 |
| iso09 | Turkish | 8x16 |
| iso15 | West European | 8x8 8x14 8x16 thin_8x16 |
| koi8_r | Russian | 8x14 8x16 8x8 |
| koi8_rb | Russian | 8x16 |
| koi8_rc | Russian | 8x16 |
| koi8_u | Ukrainian | 8x8 8x14 8x16 |
| swiss | ? | 8x8 8x14 8x16 |
| swiss_1131 | Belarusian | 8x16 |
| swiss_1251 | Cyrillic | 8x16 |
Supported output formats
- Text (plain text)
- Image (bmp, gif, jpeg, png)
Supported dynamic languages
These extensions are highly experimental and subject to change
- Perl version 5.6 and up, see the piece-perl project
- Python version 2.6 and 2.7, see the piece-python project
Requirements
You need the following to compile piece:
Building
First inspect the build options, by running:
$ scons --help
To compile everything from source:
$ scons
To clean the build root:
$ scons -c
Building the Python extension
To build the Python extension, make sure you have the Python development headers installed.
On a Debian/Ubuntu based system:
$ sudo apt-get install python-dev
On a Red Hat/RPM based system:
$ sudo yum install python-devel
To build the extension:
$ scons --with-python
Installing
To install everything into /usr/local:
$ sudo scons install
Uninstalling
To remove the piece installation:
$ sudo scons uninstall
Acknowledgements
Inspired by the Ansilove ANSi to PNG
converter, the first version of piece was written in Python. Because we
required more speed, the Python version was ported to pure C and lots of
features and font sets were added.
The fonts found in the fnt folder, are part of the FreeBSD newcons project and BSD licensed.