Well, the XBoard set has b.svg for all pieces, and Magnetic and Motif has b.svg for the orthodox pieces.
When I made my original Magnetic and Motif pieces, I used only the white pieces from the fonts, and I colored them differently. These solid black pieces made from the solid black pieces in the font are not what I originally intended. So, the showpiece.php script should be able to avoid using them.
As it is, showpiece.php would never allow you to use the black XBoard pieces, which seems a pity.
To accommodate their use, I have added some new parameters and some new conditions on whether a b*.svg gets renamed to a w*.svg piece. The two new parameters are originalblack and originalwhite. These are variables that sometimes get assigned in a set file. They are like originalcolor, but for only one side each. When originalcolor has not been set, and one of these has, the value of the appropriate one will be assigned to originalcolor. The new conditions for changing the file name are that originalblack is an empty string, and black is not. If originalblack is not empty, then it's expected that there are black pieces available for recoloring, and if black is empty, then it's expected that there are black pieces that will appear in their original color. Also, this change only happens when image has been passed a value. If someone indicates a piece with values for set and piece, it simply uses the file named in the set file. So, this doesn't interfere with the use of sets.
I have demonstrated this by adding an Xboard set to the Interactive Diagram on the Chess page. However, there is one issue with your Xboard pieces. They have fixed height and width values, and to resize properly to the dimensions of the container, these should be set to 100% instead. I could do this with sed like I did with Bob Greenwade's pieces, or I could leave it to you.
To accommodate the use of Game Courier sets with Interactive Diagrams, I have added code to modify the value of piece if the provided value is not already a key of the $pieces array. If it begins with w or W, it loses the first letter and is set to uppercase. If it begins with b or B, it loses the first letter and is set to lowercase. In each case, it gets the extension chopped off.
Here's an example of a Chess Interactive Diagram using Game Courier sets to identify piece images.
When JavaScript is running, this static image will be replaced with an Interactive Diagram
When I made my original Magnetic and Motif pieces, I used only the white pieces from the fonts, and I colored them differently. These solid black pieces made from the solid black pieces in the font are not what I originally intended. So, the showpiece.php script should be able to avoid using them.
To accommodate their use, I have added some new parameters and some new conditions on whether a
b*.svg
gets renamed to aw*.svg
piece. The two new parameters areoriginalblack
andoriginalwhite
. These are variables that sometimes get assigned in a set file. They are likeoriginalcolor
, but for only one side each. Whenoriginalcolor
has not been set, and one of these has, the value of the appropriate one will be assigned tooriginalcolor
. The new conditions for changing the file name are thatoriginalblack
is an empty string, andblack
is not. Iforiginalblack
is not empty, then it's expected that there are black pieces available for recoloring, and ifblack
is empty, then it's expected that there are black pieces that will appear in their original color. Also, this change only happens whenimage
has been passed a value. If someone indicates a piece with values forset
andpiece
, it simply uses the file named in the set file. So, this doesn't interfere with the use of sets.I have demonstrated this by adding an Xboard set to the Interactive Diagram on the Chess page. However, there is one issue with your Xboard pieces. They have fixed height and width values, and to resize properly to the dimensions of the container, these should be set to 100% instead. I could do this with
sed
like I did with Bob Greenwade's pieces, or I could leave it to you.To accommodate the use of Game Courier sets with Interactive Diagrams, I have added code to modify the value of
piece
if the provided value is not already a key of the $pieces array. If it begins with w or W, it loses the first letter and is set to uppercase. If it begins with b or B, it loses the first letter and is set to lowercase. In each case, it gets the extension chopped off.Here's an example of a Chess Interactive Diagram using Game Courier sets to identify piece images.
When JavaScript is running, this static image will be replaced with an Interactive Diagram