summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chessfss/lsbc2enc.def
blob: 6d2eea7a1ba5beca1fbe1a5f7b8889fd0172e50d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
%%
%% This is file `lsbc2enc.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% chessfss-src.dtx  (with options: `lsbc2enc')
%% 
%% chessfss: chess font selection commands
%% Copyright 2005 Ulrike Fischer (skak@nililand.de)
%% -------------------------------------------
%% 
%% This file can be redistributed and/or modified under the terms of
%% the LaTeX Project Public License distributed from CTAN archives in
%% the directory macros/latex/base/lppl.txt; either version 1 of the
%% License, or (at your option) any later version.
%% 
%% For error reports see documentation.
%%
%% LSBC2: An encoding for chessboard chars.
%% that makes it possible to color field and the piece differently.
%% In this encoding the pieces/fields are build with a solid fieldmask,
%% a transparent fieldmask and pieceOnWhite chars.
%% If a color package is loaded, the piecemask will be white.
%% The piecemask layer is not used.
%% The encoding works with fonts that have solid fieldmask on position 49-54,
%% transparent fieldmask on position 149-154 and the pieceOnWhite chars.
%% A possible free font is skaknew. (To my knowledge it is the only one with all chars)

\ProvidesFile{lsbc2enc.def}
 [2006/05/22 v1.0
         Standard LaTeX file]
\DeclareFontEncoding{LSBC2}{}{}
\DeclareFontSubstitution{LSBC2}{skaknew}{m}{n}

\AtBeginDocument{\@ifundefined{color}{%
  \def\color#1{}%
  \PackageWarning{chessfss}
   {You haven't load a color package. I will define the color command to do nothing}{}}{}}

\providecommand\cfss@whitefieldmaskcolor{\color{white}}
\providecommand\cfss@blackfieldmaskcolor{\color{gray}}
\providecommand\cfss@whitefieldcolor{}
\providecommand\cfss@blackfieldcolor{}
\providecommand\cfss@whitepiececolor{}
\providecommand\cfss@blackpiececolor{}

\providecommand\cfss@composefmfpcolorchar[6]{%range layer. fm, f, p
  \makebox[0pt][l]{%
    \csname cfss@#1fieldmaskcolor\endcsname#2}%
  \makebox[0pt][l]{%
    \csname cfss@#3fieldcolor\endcsname#4}%
  {\csname cfss@#5piececolor\endcsname#6}}%

\@namedef{cfss@showboardencodingLSBC2}{%
\begin{tabular}{llllll}
\multicolumn{6}{l}{\bfseries Encoding \ttfamily LSBC2}\\[0.5ex]
 Layer:       & fieldmask
              &  field
              & piecemask
              &  piece
              &result\\
 WhiteSquare  &\boardfont\cfss@whitefieldmaskcolor z
              &
              &
              &
              &\boardfont\cfss@WhiteEmptySquare\\
 BlackSquare  &\boardfont\cfss@blackfieldmaskcolor z
              &\boardfont\cfss@blackfieldcolor Z
              &
              &
              &\boardfont\cfss@BlackEmptySquare\\
 WhiteOnWhite &\boardfont\cfss@whitefieldmaskcolor 1
              &\boardfont
              &
              &\boardfont\cfss@whitepiececolor K
              &\boardfont\cfss@WhiteKingOnWhite\\
 WhiteOnBlack &\boardfont\cfss@blackfieldmaskcolor 1
              &\boardfont\cfss@blackfieldcolor\symbol{149}
              &
              &\boardfont\cfss@whitepiececolor K
              &\boardfont\cfss@WhiteKingOnBlack\\
 BlackOnWhite &\boardfont\cfss@whitefieldmaskcolor 1
              &\boardfont
              &
              &\boardfont\cfss@blackpiececolor k
              &\boardfont\cfss@BlackKingOnWhite\\
 BlackOnBlack &\boardfont\cfss@blackfieldmaskcolor 1
              &\boardfont\cfss@blackfieldcolor\symbol{149}
              &
              &\boardfont\cfss@blackpiececolor k
              &\boardfont\cfss@BlackKingOnBlack\\
\end{tabular}}

\DeclareTextCommand\cfss@WhiteEmptySquare {LSBC2}{{\cfss@whitefieldmaskcolor z}}

\DeclareTextCommand\cfss@BlackEmptySquare {LSBC2}
  {{\makebox[0pt][l]{\cfss@blackfieldmaskcolor z}}{\cfss@blackfieldcolor Z}}

\DeclareTextCommand\cfss@WhiteKingOnWhite {LSBC2}
    {\cfss@composefmfpcolorchar
      {white}{1}
      {}{}
      {white}{K}}
\DeclareTextCommand\cfss@BlackKingOnWhite {LSBC2}
   {\cfss@composefmfpcolorchar
      {white}{1}
      {}{}
      {black}{k}}
\DeclareTextCommand\cfss@WhiteKingOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{1}
      {black}{\symbol{149}}
      {white}{K}}
\DeclareTextCommand\cfss@BlackKingOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{1}
      {black}{\symbol{149}}
      {black}{k}}

\DeclareTextCommand\cfss@WhiteQueenOnWhite {LSBC2}
    {\cfss@composefmfpcolorchar
      {white}{5}
      {}{}
      {white}{Q}}
\DeclareTextCommand\cfss@BlackQueenOnWhite {LSBC2}
   {\cfss@composefmfpcolorchar
      {white}{5}
      {}{}
      {black}{q}}
\DeclareTextCommand\cfss@WhiteQueenOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{5}
      {black}{\symbol{153}}
      {white}{Q}}
\DeclareTextCommand\cfss@BlackQueenOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{5}
      {black}{\symbol{153}}
      {black}{q}}

\DeclareTextCommand\cfss@WhiteRookOnWhite {LSBC2}
    {\cfss@composefmfpcolorchar
      {white}{3}
      {}{}
      {white}{R}}
\DeclareTextCommand\cfss@BlackRookOnWhite {LSBC2}
   {\cfss@composefmfpcolorchar
      {white}{3}
      {}{}
      {black}{r}}
\DeclareTextCommand\cfss@WhiteRookOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{3}
      {black}{\symbol{151}}
      {white}{R}}
\DeclareTextCommand\cfss@BlackRookOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{3}
      {black}{\symbol{151}}
      {black}{r}}

\DeclareTextCommand\cfss@WhiteBishopOnWhite {LSBC2}
    {\cfss@composefmfpcolorchar
      {white}{4}
      {}{}
      {white}{B}}
\DeclareTextCommand\cfss@BlackBishopOnWhite {LSBC2}
   {\cfss@composefmfpcolorchar
      {white}{4}
      {}{}
      {black}{b}}
\DeclareTextCommand\cfss@WhiteBishopOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{4}
      {black}{\symbol{152}}
      {white}{B}}
\DeclareTextCommand\cfss@BlackBishopOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{4}
      {black}{\symbol{152}}
      {black}{b}}

\DeclareTextCommand\cfss@WhiteKnightOnWhite {LSBC2}
    {\cfss@composefmfpcolorchar
      {white}{2}
      {}{}
      {white}{N}}
\DeclareTextCommand\cfss@BlackKnightOnWhite {LSBC2}
   {\cfss@composefmfpcolorchar
      {white}{2}
      {}{}
      {black}{n}}
\DeclareTextCommand\cfss@WhiteKnightOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{2}
      {black}{\symbol{150}}
      {white}{N}}
\DeclareTextCommand\cfss@BlackKnightOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{2}
      {black}{\symbol{150}}
      {black}{n}}

\DeclareTextCommand\cfss@WhitePawnOnWhite {LSBC2}
    {\cfss@composefmfpcolorchar
      {white}{6}
      {}{}
      {white}{P}}
\DeclareTextCommand\cfss@BlackPawnOnWhite {LSBC2}
   {\cfss@composefmfpcolorchar
      {white}{6}
      {}{}
      {black}{p}}
\DeclareTextCommand\cfss@WhitePawnOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{6}
      {black}{\symbol{154}}
      {white}{P}}
\DeclareTextCommand\cfss@BlackPawnOnBlack {LSBC2}
   {\cfss@composefmfpcolorchar
      {black}{6}
      {black}{\symbol{154}}
      {black}{p}}

\endinput
%%
%% End of file `lsbc2enc.def'.