Package: xiangqi-setup
xiangqi-setup (and xiangqi-board)Overviewxiangqi-setupis a command line tool usingsvgutils0.3.4 to
renderXiangqi(Chinese chess) board setups from WXF/FEN/annoFEN/XAYfiles to SVG images.
With WXF files that contain move history,xiangqi-setupcan replay these moves on top of the initial setup —
all of them, none, or any custom number of moves (using the--moves COUNTargument).
WithXAY/annoFENfiles
it can also drawarrows, mark a field as "good", "bad" or involved in a move —
it can addannotations.The most simple way to render a given setup is:#xiangqi-setupinput.wxfoutput.svgFor filedoc/demo.wxf, the result is:(left: default board, default pieces — right: default board,euro_xiangqi_jspieces)There are a number of themes to pick from for board and pieces (independently).
The--helplisting below also includes the list of all themes
and their license information.Thedefault board themeclean_alphahas been generated with command line toolxiangqi-boardthat is included with thexiangqi-setuppackage.  It can be used to create
variations of the detault theme, e.g. to create a version with reduced spacing
in crosses you would run:#xiangqi-board--cross-gap-px2board.{svg,ini}InstallationYou can install the latest release using pip like so:#pipinstallxiangqi-setupIf you would rather run the latest pre-release code off Gitmasterin a virtualenv, you could do:#gitclone--depth1https://github.com/hartwork/xiangqi-setup#cdxiangqi-setup/#python3-mvenvvenv#sourcevenv/bin/activate#pipinstall-e.Writing a BookFor a demo of how to usexiangqi-setupin writing a book
please seehttps://github.com/hartwork/xiangqi-book-example.Usage in Detailxiangqi-setup— Renders WXF/FEN/annoFEN/XAY Files to SVG Images#xiangqi-setup--helpusage: xiangqi-setup [OPTIONS] INPUT_FILE OUTPUT_FILExiangqi-setup --helpxiangqi-setup --versionGenerate razor-sharp Xiangqi (Chinese chess) setup graphicspositional arguments:INPUT_FILE            location of WXF/FEN/annoFEN/XAY file to renderOUTPUT_FILE           location of SVG output file to writeoptional arguments:-h, --help            show this help message and exit--debug               enable debugging (e.g. mark corners of the board)--version             show program's version number and exittheme selection:--board THEME         name of board theme to use (default: "clean_alpha");please check the list of available themes below--pieces THEME        name of piece theme to use (default: "retro_simple");please check the list of available themes below--annotations THEME   name of annotation theme to use (default:"colors_alpha"); please check the list of availablethemes belowscaling:--width-px PIXEL      width of the output in pixels (default: ~248.03, i.e. 7.0cm at 90.0dpi)--width-cm CENTIMETERwidth of the output in centimeters (default: 7.0)--dpi FLOAT           resolution of the output in dots per inch (default: 90.0)--scale-pieces FACTORfactor to scale pieces by (0.0 to 1.2, default: 0.9)--scale-annotations FACTORfactor to scale annotations by (0.0 to 1.2, default: 0.9)WXF format arguments:--moves COUNT         how many moves to play (for a file with moves history),e.g. "3" would play the first move of red, the firstmove of black and the second move of red and then skipany remaining moves, "all" would play all moves, "-1"all moves but the last, "-2" all but the last two(default: "0")--annotate-last-move  Add annotations "blank_move" and "piece_move" to thesource and target locations of the last moveboard themes (16 available, in alphabetic order):a4_blank_2cm_margin                        (license: CC0-1.0)cambaluc_remake_nolegend                   (license: CC0-1.0)cambaluc_remake_nolegend_nogap             (license: CC0-1.0)ccbridge_3_0_beta4_default_preview_remake  (license: CC0-1.0)clean_alpha                                (license: CC0-1.0)clean_beta                                 (license: CC0-1.0)commons_xiangqi_board_2008                 (license: public-domain)commons_xiangqi_board_2008_bw_thin         (license: public-domain)dhtmlxq_2014_remake                        (license: CC0-1.0)latex_xq_remake                            (license: CC0-1.0)minimal                                    (license: CC0-1.0)minimal_chinese                            (license: CC0-1.0)minimal_chinese_arabic                     (license: CC0-1.0)playok_2014_remake                         (license: CC0-1.0)western_red_wine                           (license: CC0-1.0)xiexie_2_5_0_remake_minimal                (license: CC0-1.0)piece themes (10 available, in alphabetic order):ccbridge_3_0_beta4_default_preview_remake  (license: CC0-1.0)commons_xiangqi_pieces_print_2010          (license: FDL-1.2+ / CC-BY-SA-4.0)commons_xiangqi_pieces_print_2010_bw_heavy (license: FDL-1.2+ / CC-BY-SA-4.0)euro_xiangqi_js                            (license: CC-BY-4.0)euro_xiangqi_js_tricolor                   (license: CC-BY-4.0)latex_xqlarge_2006_chinese_autotrace       (license: non-commercial)latex_xqlarge_2006_chinese_potrace         (license: non-commercial)playok_2014_chinese                        (license: CC0-1.0)playok_2014_chinese_noshadow               (license: CC0-1.0)retro_simple                               (license: CC0-1.0)annotation themes (2 available, in alphabetic order):colors_alpha                               (license: CC0-1.0)gray_alpha                                 (license: CC0-1.0)xiangqi-board— Creates Custom Board Themes#xiangqi-board--helpusage: xiangqi-board [-h] [--line-thickness-px FLOAT] [--field-width-px FLOAT][--field-height-px FLOAT] [--border-thickness-px FLOAT][--border-gap-width-px FLOAT][--border-gap-height-px FLOAT] [--cross-width-px FLOAT][--cross-thickness-px FLOAT] [--cross-gap-px FLOAT]SVG_FILE INI_FILEpositional arguments:SVG_FILEINI_FILEoptional arguments:-h, --help            show this help message and exit--line-thickness-px FLOATLine thickness of square fields in pixel (default: 1)--field-width-px FLOATWidth of fields in pixel (default: 53)--field-height-px FLOATHeight of fields in pixel (default: 53)--border-thickness-px FLOATLine thickness of border in pixel (default: 2)--border-gap-width-px FLOATWidtn of gap to border in pixel (default: 40)--border-gap-height-px FLOATHeight of gap to border in pixel (default: 40)--cross-width-px FLOATWidth of starting position cross segments in pixel(default: 10)--cross-thickness-px FLOATLine thickness of starting position cross in pixel(default: 1)--cross-gap-px FLOAT  Gap to starting position cross in pixel (default: 4)