The standard (and many non-standard) piecepack suit and rank symbols are available in Unicode. See the Unicode symbols article for tables of piecepack Unicode suit and rank symbols.
Although Unicode in general doesn't support character rotations for some rank/suit symbols Unicode also has glyphs that are (or look like they are) rotated versions of those glyhps (i.e. both ☾ and ☽ (crescent) moons and both † and ⸸ daggers) or are symbols that are symmetric across certain (or all) axes of rotation such as the (alchemical) sun symbol ☉. For some piecepack game diagrams you'll want to have rotated versions of your rank/suit symbols in order to indicate rotated coins, tiles, dice, and perhaps directional pawns. Often Unicode will only have (if any) one or two rotations but will sometimes have more rotations - in particular Unicode 12.0 includes all 45 degree rotations of chess piece glyphs.
In general Unicode itself doesn't encode color. But many text platforms do support coloring individiual characters such as terminals:
And web pages:
If on such a platform you could color the suit/rank symbols in the appropriate suit color or perhaps (as suggested by Michael Van Biesbrouck) use color to indicate levels of height.
To represent a piecepack coin simply take the relevant (potentially rotated) suit/rank symbol and combine with the "Combining Enclosing Circle" U+20DD. Theoretically Unicode also supports adding a directional mark to the suit/rank symbol with one of the several Combining Diacritical Marks (should be done before adding the enclosing circle) but I couldn't get such a glyph combination to look nice in any of the (monoscale) fonts I tried.
To represent a piecepack die simply take the relevant (potentially rotated) suit/rank symbol and combine with the "Combining Enclosing Square" U+20DE. If you need to support 45/135/225/315 degree rotations there is also "Combining Enclosing Diamond" U+20DF (although depending on your aesthetics you may want to use that for your pawn). Piecepack dice that follow the Anatomy of a piecepack standard don't have directional/suit marks but if you really want some one possibility found in Unicode's Combining Diacritical Marks are the s, m, c, and a superscripts.
Depending on your aesthetics (and whether you need directional pawns and/or need to be able to distinguish pawns without aid of color) there are different options for pawns:
- Combine the relevant (potentially rotated) suit symbol with the "Combining Enclosing Diamond" U+20DF. This supports rotation in 90 degree rotations and lets you use your suit symbol.
- Combine the relevant suit symbol with the "Combining Enclosing Upward Pointing Triangle" U+20E4. Still lets you use your suit symbol but doesn't support any rotations (but standard piecepack pawns are not inherently directional anyways).
- Use the (chess) pawn symbol ♟ U+265F. Hard to distinguish suits unless you can apply color (and the people reading your diagrams aren't color-blind). With Unicode 12.0 can rotate the pawn symbol in all 45 degree rotations.
- Use the two chess pawn symbols and two chess bishop symbols for the four piecepack pawns. Even if can't apply color should be visually distinct (although maybe hard to remember which goes with each suit) and with Unicode 12.0 can rotate in all 45 degree rotations.
Tiles are drawn using box-drawing characters. An individual tile is drawn with 5x5 (for a total of 25) characters but when other tiles are placed "adjacently" they will "share" border characters (so for example 2x2 tiles will be 9x9 characters). When placing pieces in the "cells" of the tile place them on the even rows/columns of the tile. When placing pieces on the "points" of the tile place them on the odd rows/columns of the tile.
The ppgames R packages has a prototype function cat_piece which generates piecepack Unicode text diagrams given data frame input (the same data frame input supported by pmap_piece). The diagrams generated by it look okay (but not perfect) with my terminal set to use GNU FreeMono (with a couple other fonts implicitly providing glyph backup support):
The prototype parser currently makes the following choices:
- Coins lack directional marks (symbol plus directional mark plus enclosing symbol didn't look good in any font I tried).
- I use a "dagger" for the Arms suit instead of the fleur-de-lis since Unicode has rotated versions of the "dagger".
- Piecepack pawns are represented by the suit symbol enclosed by a diamond.
- Pawns, dice, coin backs, and the tile faces' suit/rank symbols uses the suit color as their "foreground color".
ppn <- read_ppn(system.file("extdata/ex1.ppn", package="ppgames")) game <- ppn[] cat_move(game)
No font I tried did everything I would want a font to do for making nice looking piecepack Unicode text diagrams. For any font designers out looking for a new project here is a wishlist of features for a piecapack diagram friendly font:
- Needs to be Monoscale, ideally the width and height of the characters would be the same.
- Needs to have the important piecepack rank/suit Unicode symbols including support for all rotated versions of the glyphs. These symbols must still look nice when combining with Combining Diacritical Marks used as directional marks plus an enclosing circle, square, diamond, and/or triangle. Would also be nice to include the relevant "rotated" Unicode 12.0 chess piece glyphs (useful as piecapack Crowns and pawns).
- Needs support for all the thin/thick box-drawing characters. These should combine well with the piecepack coins, dice, and pawns (i.e. enclosing circles, squares, etc.) so it looks like those pieces are truly on top of the tiles (so no lines going through the "edge" of the coins, dice, pawns or awkward gaps between lines and piece "edges").