Message Boards Message Boards

The Forsyth-Edwards-Notation (FEN) with Chess Alpha font

Posted 2 years ago

POSTED BY: Oliver Seipel
4 Replies

Looks like the displayed form of this notebook has its input cells being clipped on the right so that therefore the code cannot be copied. Perhaps re-upload this after fixing that? Perhaps it was not uploaded as a notebook?

POSTED BY: David Reiss

It looks fine in my browser (although right after the page loads I see exactly what you describe, only after a while it displays properly).

Anyway, here is the code:

iconGraphics = Graphics @ Text @ Style[#, FontFamily -> "Chess Alpha", FontSize -> 34] & 
  /@ {"k", "q", "b", "r", "h", "p", "l", "w", "n", "t", "j", "o"};

icons = AssociationThread[{"K", "Q", "B", "R", "N", "P", "k", "q", 
    "b", "r", "n", "p"}, iconGraphics];

ImportString["5n2/3nrpk1/1qBp2p1/p2P3p/1rp1PP2/2N4P/1P2RQP1/4R2K w - - 4 69", "FEN", 
"Icons" -> icons]
POSTED BY: Rafal Chojna

Nice work! I noticed that your FENtoTextCell prints the board as a cell but does not return an expression that you could further work with. If instead you prefer to get the position as a Graphics expression with custom piece icons there is an easy way to achieve this:

POSTED BY: Rafal Chojna

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract