Evert wrote:Can you specify what font it should use for that? The
Quivira font defines a lot of chess-variant picto-graphs in its private use area; I'm not a big fan of the overall style and the fact that they're basically just outlines detracts from their appeal, but they could still be highly useful for this.
I checked it out, and currently the font is hard-coded as "Sans Normal %dpx", where the %d is 5/8 times the square size (draw.c, line 775). Making the string user configurable is trivial, but the size parameter is a different matter. Specifying a hard size (not using %d in the string) works only for one square size. The fraction of square size could be specified (e.g. in units of 1/256), but there still is the problem of positioning within the square as well (line 780). I determined all this expermentally for getting good single-kanji pieces from a blank Shogi tile of average size. (So that you could add dedicated tiles for pieces that needed other size, such as Pawn and King.) So I suppose the vertical offset as fraction of the square size would also have to be given.
My guess is that for Tamerlane it would be easier to just make 11 clones of the Pawn.svg, and use InkScape to write 11 different letters on them, than to use this feature.
By the way - I never realised that there is such a difference between XBoard and WinBoard in this respect, I thought they were pretty much the same these days. Why is there this difference?
One reason is that it is one of the latest changes, and a front-end change, so that the code for it is not shared between WinBoard and XBoard, and it would have to be done separately. And for WinBoard the need was not so great, because there already exists the Alien Edition fork, which does do such rendering of kanji (but not in a user-configurable way, but from a built-in table for all large Shogi variants upto Tai). So I never bothered to add Chu Shogi as standard variant in the standard edition of WinBoard, as I could simply bundle HaChu with the Alien Edition. To do Chu Shogi in a similar way with WinBoard as with XBoard (which uses a pictogram representation) would require bitmaps for the 22 pieces of the Chu-promoted series, for every board size I want to support it, as in WinBoard piece images are not sizable. But at least in 4.9 WinBoard will be able to load external bitmaps for all 54 piece types.
This is a bit similar to what SjaakII does: for each piece-type it has a bitmask of what piece types it can promote to, and another to indicate what it demotes to (which it only does when a piece is captured, I think). It would be great to have similar freedom in XBoard, but I can imagine that overhauling the code is a lot of tedious work that requires a lot of tedious testing.
I had not planned to do it as elaborate as that; I am happy with a system where some pieces can promote to all, and others just to one. So each piece would have a single 'partner', and if the ID assignment is such that one of those has a + or -, the letter could promote to +, or the - could promote to the letter. In all other cases it could promote to all pieces with letter ID (if they are Pawns reaching the zone, or the engine forces their promotion).
I guess this could also solve the promotion of large numbers of types to Tokin, as occurs in Maka Dai Dai/Tai Shogi: the unpromoted pieces would all identify Tokin as their partner. Tokin would identify Pawn as its partner. As it would have ID '+', this link would only be used to represent it in SAN/FEN, so it would always be written as +P, even when it is a promoted Rook. But this seemed acceptable; writing +S and +L might make sense in regular Shogi, but when they are game-theoretically the same piece type it always struck me as highly artificial.
I know it's the sort of internal detail thing that engines shouldn't be exposed to, but it would be really useful if there were some way to check what can and cannot be done through the piece-to-char table. In Postduif I have a setting that changes the piece-to-char that is sent to XBoard, so that it can still work on XBoard 4.8 (replacing the Zebra with a Nightrider and the Lion with a ... Cobra, I think). The user needs to activate that by hand though, which isn't ideal. If there is a new/better way to indicate promotion/demotion options, it would be useful if the engine could know about this so that it can use it, or fall back on the old method if needed/possible (just generate an error and tell people to upgrade if it isn't).
That's a whole different can of worms though...
Well, I am not too keen on that. Using obsolete versions does not have to be institutionalized. If an engine does want to support it, a command-line argument would be good enough as a switch, I don't even see an advantage in making it possible to set this interactively.
A bigger problem is the disparity between XBoard and WinBoard that is developing in terms of available piece images. Making an SVG image for a new XBoard piece is already a pain. But for WinBoard it is 10 times worse, as you need to do every supported size separately (and I try to support 3 sizes for fairy pieces), and you also have to supply a third bitmap for specifying the 'alpha channel', as Windows bitmaps do not support transparency. And you cannot simply render the SVG image in the required size, as this produces a grey-scale image with variable transparency. So you basically have to redraw them by hand, pixel for pixel, to get an acceptable monochrome representation (as you cannot flood-fill very well after anti-aliasing).
So Win/XBoard should definitely support enough internal piece types to do what is needed (and they do use the same piece types), but I consider it acceptable that not every piece type will have a built-in image, even in XBoard. People that write engines requiring vast numbers of piece types can bundle the engine with a directory with the required piece images. The chessvariants.org website contains several very extended piece sets (e.g. Alfaerie) that can easily be adapted to bitmaps, because they are not anti-aliased. The current situation is a bit painful, because WinBoard can also not load the pieces without built-in image as external bitmaps (because no name is defined for them). But WinBoard 4.9 already corrects that.