A PyQt5-based tool for rendering text using bitmap fonts in PNG format.
 
 
Go to file
Nathan Deren f1fd92e7dd WIP commit for merge 2018-06-06 10:39:09 -07:00
.gitignore Omit tarballs. 2018-05-14 21:05:49 -05:00
example.json Smeargle 0.5.0 2018-03-14 10:53:03 -05:00
license.txt Initial commit. 2017-12-07 08:38:28 -06:00
melissa8.json melissa8.json: Add palette data. 2018-02-23 08:47:10 -06:00
melissa8.png Initial commit. 2017-12-07 08:38:28 -06:00
package.sh package.sh: Add example.json to script 2018-05-14 21:05:21 -05:00
porygon.py porygon.py: Implement padded4_2 mode. 2018-02-23 09:01:37 -06:00
readme.txt Smeargle 0.5.0 2018-03-14 10:53:03 -05:00
smeargle.py WIP commit for merge 2018-06-06 10:39:09 -07:00
test.txt Initial commit. 2017-12-07 08:38:28 -06:00

readme.txt

Smeargle 0.4.0 readme
---------------------
Usage: smeargle.py game.json

game.json is a file which follows the Game JSON format outlined below.

Output
------
Smeargle outputs three files per script, at present:

* <script>_raw.png is the undeduplicated rendering of the script with the
  specified font.
* <script>_compressed.png deduplicates tiles to provide the most compact
  rendering of the font without delving into actual compression algorithms.
* <script>_index.txt provides a mapping of deduplicated tiles to the original
  text.

game.json format
----------------
The following format MUST be observed, or you will not get the output you want.
Remove '//' and everything following it in each line if you plan to cop/paste
this example for your own use. Do not leave a trailing comma on the final entry
in each object or array.

{
    "name": "Example",                // The name of the game, for reference.
    "fonts": {
        "Melissa 8": "melissa8.json"  // Font name and its filename.
    }, "scripts": {
        "test.txt": {                 // Script filename.
            "max_tiles_per_line": 8,  // Omit or set to 0 for unlimited tiles.
            "font": "Melissa 8"       // Reference to the font table, above.
        }
    }
}

font.json format
----------------
The following format MUST be observed, or you will not get the output you want.
Remove '//' and everything following it in each line if you plan to copy/paste
this example for your own use. Do not leave a trailing comma on the final entry
in each object or array.

{
    "font_name": "Example",               // Human-readable, not currently used
    "filename": "example.png",            // Filename of the font (PNG)
    "bits_per_pixel": 2,                  // Depth in bits; 2**n is color count
    "width":  8,                          // Width of a given tile
    "height": 8,                          // Height of a given tile
    "palette": [                          // A list of colors.
        '00bbbb',                         // A color in hex format.
        [0, 0, 0]                         // A color in R,G,B format.
    ],
    "map": {                              // character -> index & width
        " ":  {"index": 115, "width": 4}, // Must be a blank tile somewhere
    }
}

The first color in the palette is assumed to be the background color.

porygon.py
----------
Usage: porygon.py image format

This script converts the image into the target format. Run porygon.py without
arguments to see what formats are available.

Changelog
---------
0.5.0
* Introduce a master 'game.json' file in order to enable batch processing, for
  games which use multiple scripts that have different fonts or rendering
  requirements.
* Emit an error if no arguments are given.

0.4.0
* A complete rewrite of Smeargle to make it more modular.
* Implemented a palette feature in order to ensure strict palette ordering in
  the output images.

0.3.3
* Added support for palette maps. Format is, one per line, 'n=m', where n and
  m must be integers within the colour range for the format.

0.3.2
* Added Linear 4 bits-per-pixel format.

0.3.1
* Make supported formats actually work.

0.3.0
* Added porygon.py script. Linear 1 & 2 and planar 2 bits-per-pixel formats
  are supported.

0.2.2
* Removed binary output. It wasn't emitting anything actually useful to anyone.
* Emit index map as hex.