Skip to content

About

Combine PNG and SVG files into a single SVG file.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

piece-packager

piece-packager is a collection of over 80 chess piece sets in SVG format. If color-variants are included, the total exceeds 280 sets. The SVG files will work with cm-chessboard

The chess piece sets can be viewed online.

Pre-packaged chess-piece sets can be found in the out directory.

piece-packager combines individual SVG and/or PNG files into a single SVG file. The drawing data for each file can be retrieved from the generated SVG using a two-letter SVG id. (e.g. bp for black pawn) See the Building section below for more details.

The chess piece sets have been copied from various places on the web. I am not the author of any of the sets. I believe all sets are allowed to be used for non-commercial purposes, but check their license if you have questions.

PNG sets

Each chess piece is a PNG image whose image data has been embedded in the generated SVG.

SVG sets

Each chess piece is SVG data that has been included in the generated SVG file. Some sets (e.g. qootee) contain embedded raster data.

  • adventurer font [by Armando H. Marroquin]
  • alfarishy [by Jordan Alfarishy]
  • alfonso-x font [by Armando H. Marroquin]
  • alpha [by Eric Bentzen]
  • anarchy [by caderek]
  • ansuz [by quotepilgrim]
  • bagnall [by Douglas Bagnall]
  • berlin font [by Eric Bentzen]
  • caliente [by Lena avi-0]
  • california [by Jerry S.]
  • cardinal [by sadsnake1]
  • cases font [by Matthieu Leschemelle]
  • cburnett [by Colin Burnett]
  • celtic [by Maurizio Monge]
  • checkers
  • chess7 [by Alexander Sizenko]
  • chessnut [by Alexis Luengas]
  • chicago [by Benjamin Friedrich]
  • companion font [by David L. Brown]
  • condal font [by Armando H. Marroquin]
  • cooke [by fefjar]
  • disguised
  • dmuysi k q b n r p [by Zach Bogart]
  • dubrovny [by sadsnake1]
  • echiquier [by Bryan]
  • fantasy [by Maurizio Monge]
  • fresca [by sadsnake1]
  • gioco [by sadsnake1]
  • governor [by sadsnake1]
  • green [by Green Chess]
  • harlequin font [by Armando H. Marroquin]
  • horsey svg [by cham]
  • icon54 [by icon 54]
  • icpieces [by sadsnake1]
  • kingdom font [by Armando H. Marroquin]
  • kiwen-suwi [by neverRare]
  • kosal [by Philatype]
  • leipzig font [by Armando H. Marroquin]
  • letter
  • letters
  • libra [by sadsnake1]
  • libra_v0 [by sadsnake1]
  • line font [by Armando H. Marroquin]
  • lucena font [by Armando H. Marroquin]
  • maestro [by sadsnake1]
  • maestro_v6 [by sadsnake1]
  • magnetic font [by Armando H. Marroquin]
  • mark font [by Armando H. Marroquin]
  • marroquin font [by Armando H. Marroquin]
  • maya font [by Armando H. Marroquin]
  • mediaeval font [by Armando H. Marroquin]
  • merida [by Armando H. Marroquin]
  • millennia font [by Armando H. Marroquin]
  • monarchy [by slither77]
  • mono [by Thibault Duplessis and Colin M.L. Burnett]
  • motif font [by Armando H. Marroquin]
  • mpchess [by Maxime Chupin]
  • oldstyle font [by Monika Berger]
  • oslo [by Benjamin Friedrich]
  • pirat font [by Klaus Wolf]
  • pirouetti [by pirouetti]
  • pixel [by Lucas312]
  • qootee [by TangentialElephant]
  • regular [Alastair Scott]
  • reillycraig [by Reilly Craig]
  • rhosgfx [by rhosgfx]
  • riohacha
  • saakyan k q b n r p [by Sergey Saakyan]
  • shapes [by Jimmie Elvenmark]
  • smart font [by Christoph Wirth]
  • spatial [by Maurizio Mongo]
  • staunty [by sadsnake1]
  • symmetric [by Arcticpenguins]
  • tagged
  • tatiana [by sadsnake1]
  • tfb font [by kaiserzharkhan]
  • traveller [by Alan Cowderoy]
  • trendy [by Benjamin Kinard]
  • utrect font [by Hans Bodlaender]
  • vecon k q b n r p [by vecon]
  • wisdom font [by Vladimir Nikolic]
  • xkcd [by detroyejr]

Building

To build all chess-sets in the svg and png directories:

    ./build.sh

To build an individual chess-set, supply its directory:

    ./build.sh ./svg/staunty

Generated files are created in the out directory.

The intended purpose of piece-packager is to combine individual files, each of which contains a single chess piece, into a single SVG file, but it need not be limited to chess pieces. A maximum of twelve images can be combined. If more than twelve images need to be combined, piece-packager will need to be modified.

When combining a PNG file, the PNG data is simply embedded in the SVG file. The embedded data, can be retrieved and manipulated as if it were an SVG image.

piece-packager is not smart enough to handle every SVG file, but handling 'simple' SVG files should not be a problem.

To build your own chess-set package, place all files in a directory and then supply the directory path to ./build.sh. e.g. ./build.sh ./path/to/set. The directory will be processed as follows:

  • Subdirectories are ignored.
  • Only SVG and PNG files are examined; all other file types are ignored.
  • SVG files are processed before PNG files.
  • The first file found for each piece is used; any subsequent matching piece files are ignored.
  • When generating a two-letter id, the case of the filename is ignored, however, the case of the filename affects its retrieval-order.
  • One-letter filenames (excluding the extension) are ignored.
  • The generated SVG file will be placed in the out directory.

piece-packager does not enforce any naming conventions. It searches the beginning and ending of each filename for anything that matches a 'color' or a 'piece-type'. The color can be white, black, w, b. The piece-type can be bishop, king, knight, pawn, queen, rook, b, k, n, p, q, r. (Note that b matches both bishop and black.) Any matches it finds are used to generate a two-letter piece-id (e.g. wk). If a two-letter piece-id cannot be created, the file is ignored. Each chess piece in the generated SVG file is assigned its corresponding two-letter piece-id.

Examples:

  • If Black_Knight.svg and bn.svg exist (both are presumed to contain the piece for the black knight), Black_Knight.svg will be used because Black_Knight sorts before bn.
  • If wp.png and wp.svg exist (both are presumed to contain the piece for the white pawn), the wp.svg will be chosen because SVG files have priority over PNG files.
  • If wk.svg and kw.svg exist (both are presumed to contain the piece for the white king), the kw.svg will be chosen because kw sorts before wk.
  • The filename black.svg will generate the two-leter id bk (black king) because of the black at the beginning and the k and the end.
  • The filename blackn.svg will generate the two-letter id bn (black knight) because of the black at the beginning and the n and the end.
  • The filename kapow.svg will generate the two-letter id wk (white king) because of the k at the beginning and the w and the end.

Assuming a file exists for each chess piece type, the generated SVG file will contain the following twelve SVG ids which may be used to retrieve their corresponding piece data:

  • bb Black bishop
  • bk Black king
  • bn Black knight
  • bp Black pawn
  • bq Black queen
  • br Black rook
  • wb White bishop
  • wk White king
  • wn White knight
  • wp White pawn
  • wq White queen
  • wr White rook

If a file does not exist for a chess piece type, its corresponding SVG id will not exist in the generated SVG file.

Misc

The chess piece sets were collected from various places such as lichess-org, supertorpe and sharechess.

supertorpe has a half-black/half-white king as well as a 'full' black and white king.

The alfarie site has over 170 chess piece variants.

http://mirrors.mit.edu/CTAN/macros/latex/contrib/chessfss/chessfonts_gallery.pdf

https://github.com/lichess-org/lila/blob/master/COPYING.md

https://www.chessvariants.com/d.font/

https://ajedreztipografia.wordpress.com/

https://www.enpassant.dk/chess/fonteng.htm

https://www.chessdiagrammer.com/download/zip/chessfonts_samples.pdf

About

Combine PNG and SVG files into a single SVG file.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages