1 import("piece_theme.lua")
2 import("shogi_themelib.lua")
10 theme
.options
= OptList
{
11 BoolOpt("moves_overlay", "Moves overlay", true),
12 BoolOpt("single_kanji", "Single kanji on tiles", false),
13 SelectOpt("symbols", "Symbol set", BoolOptList
{
14 -- BoolOpt("use_predefined", "Predefined", true, OptList {
15 -- ComboOpt("font", "Symbol set", fontnames)
17 BoolOpt("use_custom", "Custom font", false, OptList
{
18 UrlOpt("file", "SVG glyph directory", "../../figurines/ShogiTTF/mikachan.ttf")
20 -- BoolOpt("use_system", "System font", false, OptList {
21 -- FontOpt("font", "System font", Font("Arial", true, true))
26 function addChar(complete
, single
, promoted
)
27 return function(i
, size
)
28 font
= theme
.options
.symbols
.options
.use_custom
.sub_options
.file
.value
29 if theme
.options
.single_kanji
.value
then
30 i
:draw_glyph(Rect(size
*0.2,size
*0.25,size
*0.6,size
*0.6), font
, single
,
31 promoted
and "#d00000" or "#004000",
34 --local charsize, margin1, margin2 = 0.45, 0.09, -0.02 -- epgyobld
35 local charsize
, margin1
, margin2
= 0.4, 0.12, 0
36 i
:draw_glyph(Rect(size
*(0.5-charsize
/2),size
*margin1
,size
*charsize
,size
*charsize
),
37 font
, complete
[1], promoted
and "#d00000" or "#004000",
39 i
:draw_glyph(Rect(size
*(0.5-charsize
/2),size
*(0.5+margin2
),size
*charsize
,size
*charsize
),
40 font
, complete
[2], promoted
and "#d00000" or "#004000",
47 function shogi_piece(first
, char
, white
, promoted
, ratio
, moves
)
48 return addShadow(overlay(tile(white
, ratio
),
50 addChar(first
, char
, promoted
)))
53 theme
.black_king
= shogi_piece({"0x738b", "0x5c06"}, "0x738b", false, false, 1,
55 theme
.black_rook
= shogi_piece({"0x98db", "0x8eca"}, "0x98db", false, false, 0.96,
57 theme
.black_p_rook
= shogi_piece({"0x9f8d", "0x738b"}, "0x9f8d", false, true, 0.96,
59 theme
.black_bishop
= shogi_piece({"0x89d2", "0x884c"}, "0x89d2", false, false, 0.93,
61 theme
.black_p_bishop
= shogi_piece({"0x9f8d", "0x99ac"}, "0x99ac", false, true, 0.93,
63 theme
.black_gold
= shogi_piece({"0x91d1", "0x5c06"}, "0x91d1", false, false, 0.9,
65 theme
.black_silver
= shogi_piece({"0x9280", "0x5c06"}, "0x9280", false, false, 0.9,
67 theme
.black_p_silver
= shogi_piece({"0x6210", "0x9280"}, "0x5168", false, true, 0.9,
69 theme
.black_knight
= shogi_piece({"0x6842", "0x99ac"}, "0x6842", false, false, 0.86,
71 theme
.black_p_knight
= shogi_piece({"0x6210", "0x6842"}, "0x572d", false, true, 0.86,
73 theme
.black_lance
= shogi_piece({"0x9999", "0x8eca"}, "0x9999", false, false, 0.83,
75 theme
.black_p_lance
= shogi_piece({"0x6210", "0x9999"}, "0x674f", false, true, 0.83,
77 theme
.black_pawn
= shogi_piece({"0x6b69", "0x5175"}, "0x6b69", false, false, 0.8,
79 theme
.black_p_pawn
= shogi_piece({"0x3068", "0x91d1"}, "0x3068", false, true, 0.8,
82 theme
.white_king
= shogi_piece({"0x7389", "0x5c06"}, "0x7389", true, false, 1,
84 theme
.white_rook
= shogi_piece({"0x98db", "0x8eca"}, "0x98db", true, false, 0.96,
86 theme
.white_p_rook
= shogi_piece({"0x9f8d", "0x738b"}, "0x9f8d", true, true, 0.96,
88 theme
.white_bishop
= shogi_piece({"0x89d2", "0x884c"}, "0x89d2", true, false, 0.93,
90 theme
.white_p_bishop
= shogi_piece({"0x9f8d", "0x99ac"}, "0x99ac", true, true, 0.93,
92 theme
.white_gold
= shogi_piece({"0x91d1", "0x5c06"}, "0x91d1", true, false, 0.9,
94 theme
.white_silver
= shogi_piece({"0x9280", "0x5c06"}, "0x9280", true, false, 0.9,
96 theme
.white_p_silver
= shogi_piece({"0x6210", "0x9280"}, "0x5168", true, true, 0.9,
98 theme
.white_knight
= shogi_piece({"0x6842", "0x99ac"}, "0x6842", true, false, 0.86,
100 theme
.white_p_knight
= shogi_piece({"0x6210", "0x6842"}, "0x572d", true, true, 0.86,
102 theme
.white_lance
= shogi_piece({"0x9999", "0x8eca"}, "0x9999", true, false, 0.83,
104 theme
.white_p_lance
= shogi_piece({"0x6210", "0x9999"}, "0x674f", true, true, 0.83,
106 theme
.white_pawn
= shogi_piece({"0x6b69", "0x5175"}, "0x6b69", true, false, 0.8,
108 theme
.white_p_pawn
= shogi_piece({"0x3068", "0x91d1"}, "0x3068", true, true, 0.8,
111 -- This is part of Dai Shohi
113 theme
.black_freeking
= shogi_piece({"0x5954", "0x738b"}, "0x5954", false, false, 1,
115 theme
.white_freeking
= shogi_piece({"0x5954", "0x738b"}, "0x5954", true, false, 1,
118 -- To be able to adapt this theme to chess too
119 theme
.black_queen
= theme
.black_freeking
120 theme
.white_queen
= theme
.white_freeking