Tag Archives: monospace

SquidGrid

And what is a SquidGrid? It’s a collection of rectangular cells of all the same size!

SquidGrid is a set of Java classes for displaying arbitrary image data in a regular grid. It’s based on interfaces, so how it’s displayed and what the images are representing are both up to the implementation. SquidGrid comes with a default implementation for displaying text image, and the system is flexible enough to handle any type of image.

Being a third generation product gives SquidGrid a solid background of real world usage. The experiences learned from creating and using TextAsGraphics and libjcsi have been put into SquidGrid and the included implementation. This allows SquidGrid to more directly meet the needs of both roguelike developers and others who want an easy yet flexible grid layout of images in Java.

While my early games Excitable Digger and EarlSpork used libjcsi and the more recent EmoSquid used TextAsGraphics, Epigon is using SquidGrid. Because it allows for more flexibility in the display of text and graphics, including custom built graphical tiles only requires the additional code to load the tiles and link them to the objects they represent. The actual layout of the tiles can be handled through the same interface the text display used.

SquidGrid is available at it’s GitHub home here.

All the captials are random foreground and background, while lowercase is black and white.

Posted in SquidLib | Tagged , , , , , | Leave a comment

TextAsGraphics Library

Using my experience working on libjcsi, I created a small Java library which implements a monospaced graphical text area to be used as a swing component.

This library was requested by a fellow graduate student who was having issues ensuring monospace support with a decent looking font in a cross-system application. Having seen what libjcsi could do, but wanting a lighter weight component that could be included in a Swing GUI more easily, he asked me to work on the problem.

Using a graphics pane to render the fonts means that any font can be used and it will become monospaced. Naturally some fonts look better in this configuration than others, but through a combination of intelligently calculating likely character sizes to be used and centering of said characters in their space, the renderings look at least decent for most fonts.

Small sample application showing the library displaying an arbitrary font in a monospaced fashion.

Posted in SquidLib | Tagged , , , , | Leave a comment