AsciiPanel simulates a code page 437 ASCII terminal display. It supports all 256 characters of codepage 437, arbitrary foreground colors, arbitrary background colors, and arbitrary terminal sizes.
The default terminal size is 80x24 characters and default colors matching the Windows Command Prompt are provided. The default font is 9x16 pixel CP437 (
This should be useful to roguelike developers.
AsciiPanel supports the customization of fonts. The following system fonts are provided:
In addition, the following fontsets from the Dwarf Fortress Tileset are also included:
The AsciiPanel class provides a special three-parameter constructor to support font customization. Simply pass the desired AsciiFont as the third parameter as follows.
AsciiPanel myPanel = new AsciiPanel(80, 24, AsciiFont.DRAKE_10x10);
AsciiPanel is a Maven project, compatible with Maven 2 and Maven 3. It can be built using the following command:
This will build the project, run the unit tests, and copy the resulting jar into your local Maven repository. Once the jar is deployed to your repository, you can include it in your projects by including the following dependency in your pom:
<dependency> <groupId>net.trystan</groupId> <artifactId>ascii-panel</artifactId> <version>1.1</version> </dependency>
This project is built with Java 8. However the code itself does not require Java 8. If you are supporting a project running an earlier version of Java, you can change the pom file and rebuild the jar using your chosen version of Java without having to modify the code.