by H.G.Muller » 06 Feb 2011, 19:57
The algorithm for cutting squares from the board is slightly different when the provided bitmap image is larger or smaller than the board. If the size is exactly right (e.g. for a square size 49x49, when the bitmap is 441x490), the bitmap is just cut up in non-overlapping, touching 49x49 areas. In that case the board you see will be exactly the provided bitmap. The bitmap of the Xiangqi board contains a grid such that the grid points are exactly centered in the squares in this case.
If the board is smaller, WinBoard will cut smaller squares from the bitmap, centered on the same gird points, so they no longer touch. That will still lead to a perfectly centered grid.
But if the board is larger than the bitmap, WinBoard will have to cut squares out of it in such a way that they overlap. It cannot do that centered on the grid points anymore, as the grid points ly tooclose to the edge of the bitmap. WinBoard will cut all squares with equal overlap, and this effectively makes the grid expand a little, as the outer-most lines will stay 49/2 = 24 pixels from the board edge. Upto squares of 73x73 (49+24) all squares cut out of the bitmap will not contain grid lines that do not belong there. Except for the diagonal palace lines, which is usually not too disturbing.
Like Darklord says: the only way to prevent this is provide a larger bitmap of a Xiangqi board.
As to the piece rendering:
Unfortunately the font-based rendering is not dependent on the variant. So if two variants really need different fonts, or one must render through a font, and the other use built-in bit maps, the only way is to redefine the option /renderPiecesWithFont="...". This cannot be done from the menus,so it will require a restart of WinBoard. Just resarting will not work: becuase of the persistence of the options, WB will remember the font. When you restart through the startup menu, you must tick "Additional options", and define /renderPieceWithFont="*" to switch to the built-ins. If "Save Settings on Exit" is on, this will then persist.
The best way to organize things if you want to switch between variants that need different look is to put the required options to define the look in an ini file for each variant (like xiangqi.ini, chess.ini etc.), and include @xiangqi with the combobox line for every Xiangqi engine, and @chess on the line of every Chess engine. Then you will automatically get the required looks when you select the engine. There are no engines I know that play both Chess and Xiangqi, so yo could not switch between Xiangqi and Chess anyway through the menu without the engine complaining. If you predominantly play one variant, you can rely on the look needed for that being the default, and put /saveSettingsOnExit=false in the ini files for all variants that need a different look, to prevent the 'non-standard' look to contaminate your usual settings.
Note that the real winboard.ini file now resides in your AppData folder. This could be a hidden folder! To get rid of any persistent settings, you would have to either locate it and edit it, or start WB with explicit command-line option(s) (in the "Additional options" field) to overrule what was in the ini file. Note that you can write @default as "Additional options" to reset all options to the configuration WinBoard installed with, as there is a file "default.ini" provided as a copy of the winboard.ini file that would be first saved in your AppData folder before you change any settings.