summaryrefslogtreecommitdiff
path: root/graphics/mahjong
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-04-16 03:01:42 +0000
committerNorbert Preining <norbert@preining.info>2021-04-16 03:01:42 +0000
commit487e248ea8406af82362ed0cf749198b48b38183 (patch)
tree6f072320e61713126c79e01b3ebcb4609a030aa7 /graphics/mahjong
parent0c0d0a7c62a746c3907f924435e917b8f137cd2d (diff)
CTAN sync 202104160301
Diffstat (limited to 'graphics/mahjong')
-rw-r--r--graphics/mahjong/LICENSE21
-rw-r--r--graphics/mahjong/Makefile111
-rw-r--r--graphics/mahjong/README.md73
-rw-r--r--graphics/mahjong/mahjong-code.pdfbin0 -> 608878 bytes
-rw-r--r--graphics/mahjong/mahjong-code.tex2
-rw-r--r--graphics/mahjong/mahjong.dtx404
-rw-r--r--graphics/mahjong/mahjong.ins63
-rw-r--r--graphics/mahjong/mahjong.pdfbin0 -> 509597 bytes
-rw-r--r--graphics/mahjong/mahjong.tex2
-rw-r--r--graphics/mahjong/tiles/0m.pdfbin0 -> 4657 bytes
-rw-r--r--graphics/mahjong/tiles/0p.pdfbin0 -> 4432 bytes
-rw-r--r--graphics/mahjong/tiles/0s.pdfbin0 -> 4974 bytes
-rw-r--r--graphics/mahjong/tiles/1m.pdfbin0 -> 3997 bytes
-rw-r--r--graphics/mahjong/tiles/1p.pdfbin0 -> 4465 bytes
-rw-r--r--graphics/mahjong/tiles/1s.pdfbin0 -> 16962 bytes
-rw-r--r--graphics/mahjong/tiles/1z.pdfbin0 -> 3463 bytes
-rw-r--r--graphics/mahjong/tiles/2m.pdfbin0 -> 4050 bytes
-rw-r--r--graphics/mahjong/tiles/2p.pdfbin0 -> 3860 bytes
-rw-r--r--graphics/mahjong/tiles/2s.pdfbin0 -> 3391 bytes
-rw-r--r--graphics/mahjong/tiles/2z.pdfbin0 -> 3499 bytes
-rw-r--r--graphics/mahjong/tiles/3m.pdfbin0 -> 4168 bytes
-rw-r--r--graphics/mahjong/tiles/3p.pdfbin0 -> 3725 bytes
-rw-r--r--graphics/mahjong/tiles/3s.pdfbin0 -> 3996 bytes
-rw-r--r--graphics/mahjong/tiles/3z.pdfbin0 -> 3170 bytes
-rw-r--r--graphics/mahjong/tiles/4m.pdfbin0 -> 4327 bytes
-rw-r--r--graphics/mahjong/tiles/4p.pdfbin0 -> 3897 bytes
-rw-r--r--graphics/mahjong/tiles/4s.pdfbin0 -> 4298 bytes
-rw-r--r--graphics/mahjong/tiles/4z.pdfbin0 -> 3129 bytes
-rw-r--r--graphics/mahjong/tiles/5m.pdfbin0 -> 4584 bytes
-rw-r--r--graphics/mahjong/tiles/5p.pdfbin0 -> 4363 bytes
-rw-r--r--graphics/mahjong/tiles/5s.pdfbin0 -> 4925 bytes
-rw-r--r--graphics/mahjong/tiles/5z.pdfbin0 -> 2281 bytes
-rw-r--r--graphics/mahjong/tiles/6m.pdfbin0 -> 4373 bytes
-rw-r--r--graphics/mahjong/tiles/6p.pdfbin0 -> 4778 bytes
-rw-r--r--graphics/mahjong/tiles/6s.pdfbin0 -> 5312 bytes
-rw-r--r--graphics/mahjong/tiles/6z.pdfbin0 -> 4206 bytes
-rw-r--r--graphics/mahjong/tiles/7m.pdfbin0 -> 4096 bytes
-rw-r--r--graphics/mahjong/tiles/7p.pdfbin0 -> 5363 bytes
-rw-r--r--graphics/mahjong/tiles/7s.pdfbin0 -> 5114 bytes
-rw-r--r--graphics/mahjong/tiles/7z.pdfbin0 -> 2994 bytes
-rw-r--r--graphics/mahjong/tiles/8m.pdfbin0 -> 4047 bytes
-rw-r--r--graphics/mahjong/tiles/8p.pdfbin0 -> 5209 bytes
-rw-r--r--graphics/mahjong/tiles/8s.pdfbin0 -> 4968 bytes
-rw-r--r--graphics/mahjong/tiles/9m.pdfbin0 -> 4248 bytes
-rw-r--r--graphics/mahjong/tiles/9p.pdfbin0 -> 5812 bytes
-rw-r--r--graphics/mahjong/tiles/9s.pdfbin0 -> 5908 bytes
-rw-r--r--graphics/mahjong/tiles/Back.pdf72
-rw-r--r--graphics/mahjong/tiles/Blank.pdf72
-rw-r--r--graphics/mahjong/tiles/Front.pdfbin0 -> 1244 bytes
-rw-r--r--graphics/mahjong/tiles/space.pdfbin0 -> 2281 bytes
50 files changed, 820 insertions, 0 deletions
diff --git a/graphics/mahjong/LICENSE b/graphics/mahjong/LICENSE
new file mode 100644
index 0000000000..73b877f67b
--- /dev/null
+++ b/graphics/mahjong/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2021 Daniel Schmitz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/graphics/mahjong/Makefile b/graphics/mahjong/Makefile
new file mode 100644
index 0000000000..3241091af2
--- /dev/null
+++ b/graphics/mahjong/Makefile
@@ -0,0 +1,111 @@
+## Makefile for mahjong package
+# Directories
+BUILD=build
+TEXBUILD=$(BUILD)/tex
+OUT=out
+TEXMF_HOME:= $(shell kpsewhich -var-value TEXMFHOME)
+# TDS directories
+TDS=$(BUILD)/tds
+TDSDOC=$(TDS)/doc/latex/mahjong
+TDSSRC=$(TDS)/source/latex/mahjong
+TDSTEX=$(TDS)/tex/latex/mahjong
+# CTAN directories
+CTAN=$(BUILD)/ctan
+CTAN_MAHJONG=$(CTAN)/mahjong
+# Compilers
+LATEX=latex -output-directory $(TEXBUILD)
+LATEXMK=latexmk -lualatex -outdir=$(TEXBUILD) -auxdir=$(TEXBUILD) -interaction=nonstopmode
+ZIP=zip -r
+dir_guard=@mkdir -p $(@D)
+
+.PHONY: all clean install
+
+all: $(OUT)/mahjong-ctan.zip
+
+clean:
+ rm -rf $(BUILD)
+ rm -rf $(OUT)
+ rm -f mahjong.sty
+
+install: all
+ unzip $(CTAN)/mahjong.tds.zip -d $(TEXMF_HOME)
+
+
+# Extract package from DTX source
+$(TEXBUILD)/mahjong.sty: mahjong.ins mahjong.dtx
+ $(dir_guard)
+ $(LATEX) $<
+
+# Compile documentation
+$(TEXBUILD)/%.pdf: %.tex $(TEXBUILD)/mahjong.sty tiles
+ $(LATEXMK) $<
+
+# Move everything to TDS staging area where it belongs
+$(TDSDOC)/%.pdf: $(TEXBUILD)/%.pdf
+ $(dir_guard)
+ cp $< $@
+
+$(TDSDOC)/%.tex: %.tex
+ $(dir_guard)
+ cp $< $@
+
+$(TDSDOC)/README.md: README.md
+ $(dir_guard)
+ cp $< $@
+
+$(TDSDOC)/LICENSE: LICENSE
+ $(dir_guard)
+ cp $< $@
+
+$(TDSSRC)/mahjong.dtx: mahjong.dtx
+ $(dir_guard)
+ cp $< $@
+
+$(TDSSRC)/mahjong.ins: mahjong.ins
+ $(dir_guard)
+ cp $< $@
+
+$(TDSSRC)/Makefile: Makefile
+ $(dir_guard)
+ cp $< $@
+
+$(TDSTEX)/%.sty: $(TEXBUILD)/%.sty
+ $(dir_guard)
+ cp $< $@
+
+$(TDSTEX)/tiles: tiles
+ cp -r $< $@
+
+# Create TDS zip and moved it to CTAN staging area
+$(CTAN)/mahjong.tds.zip: $(TDSDOC)/mahjong.pdf $(TDSDOC)/mahjong-code.pdf
+$(CTAN)/mahjong.tds.zip: $(TDSDOC)/mahjong.tex $(TDSDOC)/mahjong-code.tex
+$(CTAN)/mahjong.tds.zip: $(TDSDOC)/README.md $(TDSDOC)/LICENSE
+$(CTAN)/mahjong.tds.zip: $(TDSSRC)/mahjong.ins $(TDSSRC)/mahjong.dtx $(TDSSRC)/Makefile
+$(CTAN)/mahjong.tds.zip: $(TDSTEX)/mahjong.sty $(TDSTEX)/tiles
+ $(dir_guard)
+ cd $(TDS) && $(ZIP) $(@F) *
+ mv $(TDS)/$(@F) $@
+
+# Move everything to CTAN staging area
+$(CTAN_MAHJONG)/%.pdf: $(TDSDOC)/%.pdf
+ $(dir_guard)
+ cp $< $@
+
+$(CTAN_MAHJONG)/%.tex: $(TDSDOC)/%.tex
+ $(dir_guard)
+ cp $< $@
+
+$(CTAN_MAHJONG)/%: %
+ $(dir_guard)
+ cp -r $< $@
+
+# Create final zip archive for upload to CTAN
+$(OUT)/mahjong-ctan.zip: $(CTAN_MAHJONG)/mahjong.tex $(CTAN_MAHJONG)/mahjong.pdf
+$(OUT)/mahjong-ctan.zip: $(CTAN_MAHJONG)/mahjong-code.tex $(CTAN_MAHJONG)/mahjong-code.pdf
+$(OUT)/mahjong-ctan.zip: $(CTAN_MAHJONG)/README.md $(CTAN_MAHJONG)/LICENSE
+$(OUT)/mahjong-ctan.zip: $(CTAN_MAHJONG)/mahjong.dtx $(CTAN_MAHJONG)/mahjong.ins
+$(OUT)/mahjong-ctan.zip: $(CTAN_MAHJONG)/Makefile
+$(OUT)/mahjong-ctan.zip: $(CTAN_MAHJONG)/tiles $(CTAN)/mahjong.tds.zip
+ $(dir_guard)
+ cd $(CTAN) && $(ZIP) $(@F) ./*
+ mv $(CTAN)/$(@F) $@ \ No newline at end of file
diff --git a/graphics/mahjong/README.md b/graphics/mahjong/README.md
new file mode 100644
index 0000000000..553f76717f
--- /dev/null
+++ b/graphics/mahjong/README.md
@@ -0,0 +1,73 @@
+# mahjong-tex
+A LaTeX 3 package for typesetting mahjong hands using MPSZ algebraic notation.
+This package provides an interface for LaTeX 2e, so you can use it without any experience in LaTeX 3.
+
+![A display of all tiles used for Riichi Mahjong](doc/all_tiles.png)
+
+This package focuses on Riichi (a.k.a. Japanese) Mahjong but can be used to typeset any style.
+However, flower tiles are currently missing.
+
+## Usage
+```
+\usepackage{mahjong}
+\mahjong{<tiles>}
+```
+Insert mahjong tiles as specified by `<tiles>`. For instance,
+```
+\mahjong{119p 19s 19m 1234567z}
+```
+produces an image of the "Thirteen Orphans" hand with a pair of 1 dots.
+
+![A row of mahjong tiles: 1 dots, 1 dots, 9 dots, 1 bamboo, 9 bamboo, 1 character, 9 character, east wind, south wind, west wind, north wind, white dragon, green dragon, and red dragon](doc/13orphans.png)
+
+Additional supported features are:
+
+* Red fives
+* Concealed tiles
+* Spaces
+* Blank tiles
+* Rotated tiles (90° counter-clockwise)
+* Stacked, rotated tiles
+
+```
+\mahjong{X44Xp-123's-50"5m-33?z}
+```
+![4 groups of mahjong tiles separated by spaces.
+Group 1: A concealed tile, showing its red backside, 4 dots, 4 dots, concealed tile.
+Group 2: 1 bamboo, 2 bamboo, 3 bamboo, rotated 90° counter-clockwise.
+Group 3: 5 character, two red 5 character, rotated 90° counter-clockwise and stacked, 5 character.
+Group 4: south wind, south wind, a tile with a question mark.](doc/expansions.png)
+
+The size of the typeset hand can be changed.
+Either locally as an optional argument to `\mahjong` or as a package option.
+
+## Prerequisites
+You need a sufficiently recent version of LaTeX which ships with the L3 programming layer.
+This applies to all version released after October 2019.
+
+mahjong depends on stackengine, which is included in all major TeX distributions.
+
+## Building
+A simple invocation of make is enough to produce a zip file in `out/` which can be submitted to CTAN.
+```
+make
+```
+
+## Installation
+Run
+```
+make install
+```
+
+to install the package to your local texmf directory.
+It should be available for use in your documents.
+
+Run
+```
+texdoc mahjong
+```
+to get an introduction to the package, including the extended flavor of MPSZ notation this package uses.
+
+## Attribution
+The mahjong tiles used in this package were created by [@FluffyStuff](https://github.com/FluffyStuff).
+The original repository is [FluffyStuff/riichi-mahjong-tiles](https://github.com/FluffyStuff/riichi-mahjong-tiles), used under CC-BY. \ No newline at end of file
diff --git a/graphics/mahjong/mahjong-code.pdf b/graphics/mahjong/mahjong-code.pdf
new file mode 100644
index 0000000000..f3610c91c6
--- /dev/null
+++ b/graphics/mahjong/mahjong-code.pdf
Binary files differ
diff --git a/graphics/mahjong/mahjong-code.tex b/graphics/mahjong/mahjong-code.tex
new file mode 100644
index 0000000000..3f35b00e9f
--- /dev/null
+++ b/graphics/mahjong/mahjong-code.tex
@@ -0,0 +1,2 @@
+\AtBeginDocument{\AlsoImplementation}
+\input{mahjong.dtx} \ No newline at end of file
diff --git a/graphics/mahjong/mahjong.dtx b/graphics/mahjong/mahjong.dtx
new file mode 100644
index 0000000000..17b65bc232
--- /dev/null
+++ b/graphics/mahjong/mahjong.dtx
@@ -0,0 +1,404 @@
+% \iffalse meta-comment
+%
+% Copyright (c) 2021 Daniel Schmitz
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+% associated documentation files (the "Software"), to deal in the Software without restriction,
+% including without limitation the rights to use, copy, modify, merge, publish, distribute,
+% sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in all copies or substantial
+% portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+% NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+% DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+% OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+%
+% \fi
+
+% \iffalse
+
+%<*driver>
+\documentclass[full]{l3doc}
+\usepackage[height=1.5\baselineskip]{mahjong}
+\usepackage{tabularx}
+\usepackage{array}
+\usepackage{booktabs}
+\usepackage{multicol}
+\usepackage{cleveref}
+\usepackage{gensymb}
+\renewcommand{\arraystretch}{1.8}
+\parskip 6pt
+\parindent 0pt
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+\DocInput{mahjong.dtx} \end{document}
+%</driver>
+% \fi
+
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+
+% \changes{v0.5}{2020/04/07}{First working version, minimal error handling}
+% \changes{v0.9}{2020/04/11}{Fully functional}
+% \changes{v1.0}{2020/04/14}{First complete release}
+%
+% \GetFileInfo{mahjong.sty}
+% \DoNotIndex{\#,\$,\%,\&,\@,\\,\{,\},\^,\_,\~,\ }
+% \DoNotIndex{\advance,\begingroup,\catcode,\closein}
+% \DoNotIndex{\closeout,\day,\def,\edef,\else,\empty,\endgroup}
+
+% \title{The \textsf{mahjong} package\thanks{This document corresponds to \textsf{mahjong}~\fileversion, dated~\filedate}}
+% \author{Daniel Schmitz \\ \texttt{schmytzi@gmail.com}}
+%
+% \maketitle
+% \tableofcontents
+% \begin{abstract}
+% The \textsf{mahjong} package provides a \LaTeXe{} and \LaTeX~3 interface for typesetting mahjong tiles using an extended version of MPSZ algebraic notation.
+% Features include spaces, rotated, blank, and concealed tiles, as well as red fives.
+% The size of the mahjong tiles can be controlled using a package option and an optional argument of |\mahjong|.
+% It is primarily aimed at Riichi (aka. Japanese) Mahjong but can be used to typeset any style of mahjong.
+% However, flower tiles and jokers are currently missing.
+% \end{abstract}
+%
+% \begin{documentation}
+% \section{Introduction}
+% Mahjong is a tile-based game originating from China which is popular in East and South-East Asia and has since spread throughout the world.
+% The \textsf{mahjong} package provides an interface for typesetting mahjong tiles and hands using MPSZ algebraic notation.
+% This documentation assumes familiarity with the game in general but none of its many styles.
+% Nonetheless, some basic terms will be defined because of differing vocabulary among players.
+%
+% \newcommand{\rmahjong}[1]{\raisebox{-.4\height}{\mahjong{#1}}}
+% \section{Mahjong Tiles}
+% \subsection{Suited Tiles}
+% The suited tiles are referred to as follows:
+%
+% \begin{tabular}{@{} l l @{}}
+% \toprule
+% \textbf{Suit} & \textbf{Tiles} \\
+% \midrule
+% Bamboo & \rmahjong{1234506789s} \\
+% Dots & \rmahjong{1234506789p} \\
+% Character & \rmahjong{1234506789m} \\
+% \bottomrule
+% \end{tabular}
+%
+% Suited tiles are referred to using the pattern \meta{value} \meta{suit}.
+% For instance, \mahjong{4s} is called \textit{4~Bamboo}.
+%
+% \subsection{Honor Tiles}
+% This documentation refers to the seven honor tiles as follows:
+%
+% \begin{tabular}{@{}c c c c@{}}
+% \toprule
+% \multicolumn{4}{c}{\bfseries Winds} \\
+% \mahjong{1z} & \mahjong{2z} & \mahjong{3z} & \mahjong{4z} \\
+% East Wind (E) & South Wind (S) & West Wind (W) & North Wind (N) \\
+% \midrule
+% \multicolumn{4}{c}{\bfseries Dragons} \\
+% \mahjong{5z} & \mahjong{6z} & \mahjong{7z} & \\
+% White Dragon & Green Dragon & Red Dragon & \\
+% \bottomrule
+% \end{tabular}
+%
+% \section{MPSZ Algebraic Notation}
+% \subsection{Standard Notation}
+% \begin{table}
+% \centering
+% \caption[MPSZ reference]{MPSZ notation reference. Each tile is identified by its column's number and its row's letter.}
+% \label{tab:mpszref}
+% \begin{tabular}{ccccccccccc}
+% & \textbf{0} & \textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} \\
+% \textbf{s} & \raisebox{-.75\baselineskip}{\rmahjong{0s}} & \rmahjong{1s} & \rmahjong{2s} & \rmahjong{3s} & \rmahjong{4s} & \rmahjong{5s} & \rmahjong{6s} & \rmahjong{7s} & \rmahjong{8s} & \rmahjong{9s} \\
+% \textbf{p} & \rmahjong{0p} & \rmahjong{1p} & \rmahjong{2p} & \rmahjong{3p} & \rmahjong{4p} & \rmahjong{5p} & \rmahjong{6p} & \rmahjong{7p} & \rmahjong{8p} & \rmahjong{9p} \\
+% \textbf{m} & \rmahjong{0m} & \rmahjong{1m} & \rmahjong{2m} & \rmahjong{3m} & \rmahjong{4m} & \rmahjong{5m} & \rmahjong{6m} & \rmahjong{7m} & \rmahjong{8m} & \rmahjong{9m} \\
+% \textbf{z} & & \rmahjong{1z} & \rmahjong{2z} & \rmahjong{3z} & \rmahjong{4z} & \rmahjong{5z} & \rmahjong{6z} & \rmahjong{7z} & &
+% \end{tabular}
+% \end{table}
+%
+% % \DeleteShortVerb{\"}
+% MPSZ notation assigns each tile an identifier consisting of a digit and a letter (\cref{tab:mpszref}).
+% For suited tiles, the digit corresponds to the tile's value and the letter to its suit, Bamboo (|s|), Dots (|p|) or Character (|m|).
+% For instance, |2m| identifies \mahjong{2m} (2~Character).
+% The only exception ot this rule are red fives, whose numeric value is 0.
+% Red 5 Bamboo, for example, has identifier |0s|.
+% Honor tiles are assigned the "suit" |z|, with |1z| -- |4z| corresponding to E, S, W and N, and |5z| -- |7z| to the white, green and red dragon, respectively.
+%
+% Collections of tiles, such as melds or hands, are represented by concatenating the identifiers of the tiles they comprise.
+% For instance, |3s4s5s| corresponds to \mahjong{3s4s5s}.
+% Groups of tiles sharing the same suit can be abbreviated by omitting all but the last suit identifier.
+% The above example can also be expressed as |345s|.
+% Spaces are ignored and the notation is case-insensitive.
+%
+% \subsection{Extensions}
+% \paragraph{Spaces.} Spaces can be inserted using |-|:
+% |444s-567s| produces \mahjong{444s-567s}.
+%
+% \paragraph{Concealed Tiles.} \mahjong{X} Concealed (or face-down) tiles are represented by |X|.
+% They don't need a suit identifier and don't act as one.
+% |123s X 456s| and |123 X 456s| are therefore equivalent.
+%
+% \paragraph{Blank Tiles.} \mahjong{?} Blank or unknown tiles are represented by |?|.
+% Just like concealed tiles, they don't change the current suit.
+% |123s ? 456s| and |123 ? 456s| are equivalent, for instance.
+%
+% \paragraph{Rotation.} Inserting an apostrophe (|'|) rotates the \textit{preceeding} tile counter-clockwise.
+% For instance, |6'66m| is rendered as \mahjong{6'66m}.
+% This can only be done once per tile, i.e. it is not possible to rotate them 180\degree{} or 270\degree{}.
+% When you want to rotate the last tile of a group, it doesn't matter whether the apostrophe appears before or after the suit, so |77'm| and |77m'| are equivalent.
+%
+%
+% \paragraph{Rotation and Stacking.} Quotes (|"|) cause the \textit{preceeding} tile to be rendered as two rotated and stacked tiles.
+% For instance, |77"7z| produces \mahjong{77"7z}.
+%
+% \section{Typesetting Mahjong Tiles in Your Document}
+% \DescribeMacro{\mahjong}
+% The main interface is |\mahjong| \oarg{height} \marg{hand}.
+% \meta{hand} refers to a tile sequence in MPSZ notation as discussed above and \meta{height} specifies the height of the rendered mahjong tiles.
+% If \meta{height} is not specified, the default height is used.
+%
+% \DescribeMacro{\mahjong_typeset_hand:n} \DescribeMacro{\mahjong_typeset_hand:x}
+% The \LaTeX~3 interface for rendering mahjong tiles are |\mahjong_typeset_hand:n| and its variants.
+% This macro accepts the hand to be rendered in MPSZ notation.
+% The height can be specified by setting |\l_mahjong_tile_height| \DescribeMacro{\l_mahjong_tile_height} and the default height is saved in |\g_mahjong_default_height|. \DescribeMacro{\g_mahjong_default_height}
+%
+% The default height can be set using the package's |height| parameter.
+% For instance, |\usepackage[height=2\baselineskip]{mahjong}| sets the default size of mahjong tiles to double the value of |\baselineskip| in the context they are rendered in.
+% The parameter defaults to |\baselineskip|.
+%
+% \section{Acknowledgments}
+% The mahjong tiles used in this package were created by GitHub user \href{https://github.com/FluffyStuff}{FluffyStuff}.
+% The original repository is \href{https://github.com/FluffyStuff/riichi-mahjong-tiles}{FluffyStuff/riichi-mahjong-tiles}, used under CC-BY Version 4.0.
+% \end{documentation}
+% \begin{implementation}
+%
+% \begin{macrocode}
+%<*pkg>
+%<@@=mahjong>
+\NeedsTeXFormat{LaTeX2e}[2019/10/01]
+\RequirePackage{expl3}
+\ProvidesExplPackage{mahjong}{2021/04/14}{1.0}{Typeset Mahjong Hands}
+\RequirePackage{xparse}
+\RequirePackage{l3keys2e}
+\RequirePackage{graphicx}
+\RequirePackage{stackengine}
+% \end{macrocode}
+
+% \begin{macrocode}
+\msg_new:nnnn {mahjong} {invalid_token}
+{Token ~ #1 ~ is ~ not ~ valid ~ in ~ MPSZ ~ notation}
+{Valid ~ tokens ~ are ~ digits ~ 0-9, ~ m, ~ p, ~ s, ~ z, ~ x, ~ -, ~ ?, ~ ', ~ and ~ " }
+\msg_new:nnnn {mahjong} {unknown_tile}
+{I~don't~know~tile~#1.}
+{Please~check~the~documentation~for~recognized~tiles.}
+\msg_new:nnnn {mahjong} {unknown_orientation}
+{Orientation ~ #1 ~ is ~ unknown}
+{This ~ should ~ not ~ happen.~ Please ~ create ~ a ~ bug ~ report.}
+
+\keys_define:nn {mahjong} {
+ height .dim_gset:N = \g_mahjong_default_height
+}
+
+% Identifiers for all suits
+\cs_new:Npn \c_@@_suits_tl {mpsz}
+% Allowed tokens
+\cs_new:Npn \c_@@_allowed_tokens_tl {0123456789mpsz-?x'"}
+
+% Variables have to be declared globally
+\tl_new:N \l_@@_suit_tl
+\tl_new:N \l_@@_tiles_tl
+\tl_new:N \l_@@_reversed_tl
+\tl_new:N \l_@@_hand_tl
+\tl_new:N \l_@@_current_suit_tl
+\tl_new:N \l_@@_current_group_tl
+\tl_new:N \l_@@_current_char
+
+
+\dim_set:Nn \g_mahjong_default_height {\baselineskip}
+\dim_new:N \l_mahjong_tile_height
+
+\int_new:N \l_@@_tile_orientation_int
+\seq_new:N \l_@@_tile_maps_seq
+\str_new:N \l_@@_file_path_str
+
+
+\ProcessKeysPackageOptions{mahjong}
+% \end{macrocode}
+
+% \begin{macro}[aux]{\@@_make_tile:nn, \@@_make_tile:VV, \@@_make_tile:xV, \@@_make_tile:nV}
+% Inserts a mahjong tile into the input stream.
+% This functions only handles that use the front background and have a forground,
+% i.e. regular and blank tiles.
+% \begin{macrocode}
+\cs_set:Npn \@@_make_tile:nn #1#2 {
+ \file_if_exist:nTF {#1} {
+ \int_case:nnF {#2} {
+ {0} {
+ \stackinset{c}{0pt}{c}{0pt}{
+ \includegraphics[
+ angle=0,
+ height=.85\l_mahjong_tile_height]
+ {#1}
+ }{
+ \includegraphics[
+ angle=0,
+ height=\l_mahjong_tile_height]
+ {tiles/Front.pdf}
+ }
+ } {1} {
+ \stackinset{c}{0pt}{c}{0pt}{
+ \includegraphics[
+ angle=90,
+ width=.85\l_mahjong_tile_height]
+ {#1}
+ }{
+ \includegraphics[
+ angle=90,
+ width=\l_mahjong_tile_height]
+ {tiles/Front.pdf}
+ }
+ } {2} {
+ % Stack 2 rotated tiles on top of each other.
+ \stackon [0pt] {
+ \@@_make_tile:nn {#1} {1}
+ } {
+ \@@_make_tile:nn {#1} {1}
+ }
+ }
+ } {
+ \msg_fatal:nnx {mahjong} {unknown_orientation} {#2}
+ }
+ } {
+ \msg_error:nnx {mahjong} {unknown_tile} {#1}
+ }
+}
+
+\cs_generate_variant:Nn \@@_make_tile:nn {VV, xV, nV}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\mahjong_typeset_hand:n, \mahjong_typeset_hand:x}
+% Parseses and typesets a mahjong hand in MPSZ notation.
+% Set |\l_mahjong_tile_height| to control the tiles' size.
+% \begin{macrocode}
+% Parses a full hand
+\cs_set:Npn \mahjong_typeset_hand:n #1 {
+ \tl_set:Nx \l_@@_hand_tl {\text_lowercase:n {#1}}
+ % MPSZ notation is easier to parse right-to-left, so reverse string
+ % There is no string reversal function but we can reverse token lists
+ % Token lists and strings are freely convertible between each other
+ \tl_set:Nx \l_@@_reversed_tl {\tl_reverse:V \l_@@_hand_tl}
+ \tl_map_variable:NNn \l_@@_reversed_tl \l_@@_current_char {
+ % Check if we recognize the current token
+ \exp_args:NVV \tl_if_in:nnF \c_@@_allowed_tokens_tl \l_@@_current_char {
+ \msg_error:nnx {mahjong} {invalid_token} {\l_@@_current_char}
+ }
+ \exp_args:NVV \tl_if_in:nnTF \c_@@_suits_tl \l_@@_current_char {
+ % If we've found a suit identifier, change the current suit
+ \tl_set:NV \l_@@_current_suit_tl \l_@@_current_char
+ } {
+ \str_case:VnF \l_@@_current_char {
+ {'} {
+ % An apostrophe indicates that the next tile is rotated
+ \int_set:Nn \l_@@_tile_orientation_int {1}
+ }
+ {"} {
+ % Quotes mean the next tile is actually 2 rotated tiles stacked on top of each other
+ \int_set:Nn \l_@@_tile_orientation_int {2}
+ }
+ } {
+ % Default case: We've got a complete tile identifier
+ % Turn it into a property list
+ \prop_clear:N \l_tmpa_prop
+ \prop_put:NnV \l_tmpa_prop {suit} \l_@@_current_suit_tl
+ \prop_put:NnV \l_tmpa_prop {face} \l_@@_current_char
+ \prop_put:NnV \l_tmpa_prop {orientation} \l_@@_tile_orientation_int
+ % Add it to the beginning of the sequence (we are parsing in reverse)
+ \seq_put_left:NV \l_@@_tile_maps_seq \l_tmpa_prop
+ \int_set:Nn \l_@@_tile_orientation_int {0}
+ }
+ }
+ }
+ % Typesetting begins here. Sequence is in correct order
+ \seq_map_variable:NNn \l_@@_tile_maps_seq \l_tmpa_prop {
+ \prop_get:NnN \l_tmpa_prop {face} \l_tmpa_tl
+ \prop_get:NnN \l_tmpa_prop {orientation} \l_tmpa_int
+ \str_case:VnF \l_tmpa_tl {
+ {-} {
+ % If the current face is a dash, insert a space
+ \includegraphics[height=\l_mahjong_tile_height]{tiles/space.pdf}
+ } {x} {
+ % Insert a flipped tile
+ \int_case:nn {\l_tmpa_int} {
+ {0} { % Upright
+ \includegraphics[
+ angle=0,
+ height=\l_mahjong_tile_height]
+ {tiles/Back.pdf}
+ } {1} { % Rotated
+ \includegraphics[
+ angle=90,
+ width=\l_mahjong_tile_height]
+ {tiles/Back.pdf}
+ } {2} { % Rotated and stacked
+ \stackon [0pt] {
+ \includegraphics[
+ angle=90,
+ width=\l_mahjong_tile_height]
+ {tiles/Back.pdf}
+ } {
+ \includegraphics[angle=90,
+ width=\l_mahjong_tile_height]
+ {tiles/Back.pdf}
+ }
+ }
+ }
+ } {?} { % Blank tile
+ \@@_make_tile:nV {tiles/Blank.pdf} \l_tmpa_int
+ }
+ } { % Any other tile identified by a code.
+ \@@_make_tile:xV {tiles/\l_tmpa_tl\prop_item:Nn \l_tmpa_prop {suit}.pdf} \l_tmpa_int
+ }
+ }
+ % Clear the list for the next invocation
+ \seq_clear:N \l_@@_tile_maps_seq
+}
+
+% Have TeX automatically expand the argument for us
+\cs_generate_variant:Nn \@@_typeset_hand:n {x}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mahjong}
+% This is the only \LaTeXe{} macro in this package.
+% It typesets a mahjong hand.
+% \begin{macrocode}
+\NewDocumentCommand{\mahjong}{O{\g_mahjong_default_height} m}{
+ \dim_set:Nn \l_mahjong_tile_height {#1}
+ \mahjong_typeset_hand:n {#2}
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+% \end{implementation}
+%
+% \PrintChanges
+\endinput
diff --git a/graphics/mahjong/mahjong.ins b/graphics/mahjong/mahjong.ins
new file mode 100644
index 0000000000..4b622adb2a
--- /dev/null
+++ b/graphics/mahjong/mahjong.ins
@@ -0,0 +1,63 @@
+%% Copyright (c) 2021 Daniel Schmitz
+%%
+%% Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+%% associated documentation files (the "Software"), to deal in the Software without restriction,
+%% including without limitation the rights to use, copy, modify, merge, publish, distribute,
+%% sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+%% furnished to do so, subject to the following conditions:
+%%
+%% The above copyright notice and this permission notice shall be included in all copies or substantial
+%% portions of the Software.
+%%
+%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+%% NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+%% DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+%% OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+\input l3docstrip.tex
+\keepsilent
+\usedir{tex/latex/mahjong}
+
+\preamble
+Copyright (c) 2021 Daniel Schmitz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, distribute,
+sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+\endpreamble
+
+\askforoverwritefalse
+\generate{\file{mahjong.sty}{\from{mahjong.dtx}{pkg}}}
+
+\obeyspaces
+\Msg{****************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the *}
+\Msg{* following file and directory into a directory *}
+\Msg{* searched by TeX: *}
+\Msg{* *}
+\Msg{* mahjong.sty *}
+\Msg{* tiles/ *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file *}
+\Msg{* mahjong.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{****************************************************}
+
+\endbatchfile \ No newline at end of file
diff --git a/graphics/mahjong/mahjong.pdf b/graphics/mahjong/mahjong.pdf
new file mode 100644
index 0000000000..c2fce9c266
--- /dev/null
+++ b/graphics/mahjong/mahjong.pdf
Binary files differ
diff --git a/graphics/mahjong/mahjong.tex b/graphics/mahjong/mahjong.tex
new file mode 100644
index 0000000000..dee2386237
--- /dev/null
+++ b/graphics/mahjong/mahjong.tex
@@ -0,0 +1,2 @@
+\AtBeginDocument{\OnlyDescription}
+\input{mahjong.dtx} \ No newline at end of file
diff --git a/graphics/mahjong/tiles/0m.pdf b/graphics/mahjong/tiles/0m.pdf
new file mode 100644
index 0000000000..847242a572
--- /dev/null
+++ b/graphics/mahjong/tiles/0m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/0p.pdf b/graphics/mahjong/tiles/0p.pdf
new file mode 100644
index 0000000000..4bbf1d0a87
--- /dev/null
+++ b/graphics/mahjong/tiles/0p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/0s.pdf b/graphics/mahjong/tiles/0s.pdf
new file mode 100644
index 0000000000..a543f3d0a0
--- /dev/null
+++ b/graphics/mahjong/tiles/0s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/1m.pdf b/graphics/mahjong/tiles/1m.pdf
new file mode 100644
index 0000000000..83ab34999a
--- /dev/null
+++ b/graphics/mahjong/tiles/1m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/1p.pdf b/graphics/mahjong/tiles/1p.pdf
new file mode 100644
index 0000000000..7b5034abd0
--- /dev/null
+++ b/graphics/mahjong/tiles/1p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/1s.pdf b/graphics/mahjong/tiles/1s.pdf
new file mode 100644
index 0000000000..b963ece881
--- /dev/null
+++ b/graphics/mahjong/tiles/1s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/1z.pdf b/graphics/mahjong/tiles/1z.pdf
new file mode 100644
index 0000000000..35743a24ae
--- /dev/null
+++ b/graphics/mahjong/tiles/1z.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/2m.pdf b/graphics/mahjong/tiles/2m.pdf
new file mode 100644
index 0000000000..a252424bc1
--- /dev/null
+++ b/graphics/mahjong/tiles/2m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/2p.pdf b/graphics/mahjong/tiles/2p.pdf
new file mode 100644
index 0000000000..8aba2ebcb1
--- /dev/null
+++ b/graphics/mahjong/tiles/2p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/2s.pdf b/graphics/mahjong/tiles/2s.pdf
new file mode 100644
index 0000000000..d27c407793
--- /dev/null
+++ b/graphics/mahjong/tiles/2s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/2z.pdf b/graphics/mahjong/tiles/2z.pdf
new file mode 100644
index 0000000000..5dd1b04649
--- /dev/null
+++ b/graphics/mahjong/tiles/2z.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/3m.pdf b/graphics/mahjong/tiles/3m.pdf
new file mode 100644
index 0000000000..abc870258d
--- /dev/null
+++ b/graphics/mahjong/tiles/3m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/3p.pdf b/graphics/mahjong/tiles/3p.pdf
new file mode 100644
index 0000000000..11f8fce3df
--- /dev/null
+++ b/graphics/mahjong/tiles/3p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/3s.pdf b/graphics/mahjong/tiles/3s.pdf
new file mode 100644
index 0000000000..4156f41725
--- /dev/null
+++ b/graphics/mahjong/tiles/3s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/3z.pdf b/graphics/mahjong/tiles/3z.pdf
new file mode 100644
index 0000000000..59dabc8fe3
--- /dev/null
+++ b/graphics/mahjong/tiles/3z.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/4m.pdf b/graphics/mahjong/tiles/4m.pdf
new file mode 100644
index 0000000000..7cfa8bee4c
--- /dev/null
+++ b/graphics/mahjong/tiles/4m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/4p.pdf b/graphics/mahjong/tiles/4p.pdf
new file mode 100644
index 0000000000..b8c8f611ce
--- /dev/null
+++ b/graphics/mahjong/tiles/4p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/4s.pdf b/graphics/mahjong/tiles/4s.pdf
new file mode 100644
index 0000000000..33621ef290
--- /dev/null
+++ b/graphics/mahjong/tiles/4s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/4z.pdf b/graphics/mahjong/tiles/4z.pdf
new file mode 100644
index 0000000000..91e8614d7f
--- /dev/null
+++ b/graphics/mahjong/tiles/4z.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/5m.pdf b/graphics/mahjong/tiles/5m.pdf
new file mode 100644
index 0000000000..7e781c266a
--- /dev/null
+++ b/graphics/mahjong/tiles/5m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/5p.pdf b/graphics/mahjong/tiles/5p.pdf
new file mode 100644
index 0000000000..6a4d090ff4
--- /dev/null
+++ b/graphics/mahjong/tiles/5p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/5s.pdf b/graphics/mahjong/tiles/5s.pdf
new file mode 100644
index 0000000000..fd729c9a89
--- /dev/null
+++ b/graphics/mahjong/tiles/5s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/5z.pdf b/graphics/mahjong/tiles/5z.pdf
new file mode 100644
index 0000000000..53a731f449
--- /dev/null
+++ b/graphics/mahjong/tiles/5z.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/6m.pdf b/graphics/mahjong/tiles/6m.pdf
new file mode 100644
index 0000000000..8341644d59
--- /dev/null
+++ b/graphics/mahjong/tiles/6m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/6p.pdf b/graphics/mahjong/tiles/6p.pdf
new file mode 100644
index 0000000000..28832f6c17
--- /dev/null
+++ b/graphics/mahjong/tiles/6p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/6s.pdf b/graphics/mahjong/tiles/6s.pdf
new file mode 100644
index 0000000000..92b96149e8
--- /dev/null
+++ b/graphics/mahjong/tiles/6s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/6z.pdf b/graphics/mahjong/tiles/6z.pdf
new file mode 100644
index 0000000000..df836b96f0
--- /dev/null
+++ b/graphics/mahjong/tiles/6z.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/7m.pdf b/graphics/mahjong/tiles/7m.pdf
new file mode 100644
index 0000000000..91f0f11274
--- /dev/null
+++ b/graphics/mahjong/tiles/7m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/7p.pdf b/graphics/mahjong/tiles/7p.pdf
new file mode 100644
index 0000000000..97e28ec00a
--- /dev/null
+++ b/graphics/mahjong/tiles/7p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/7s.pdf b/graphics/mahjong/tiles/7s.pdf
new file mode 100644
index 0000000000..dc9e03da54
--- /dev/null
+++ b/graphics/mahjong/tiles/7s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/7z.pdf b/graphics/mahjong/tiles/7z.pdf
new file mode 100644
index 0000000000..0402a4bda6
--- /dev/null
+++ b/graphics/mahjong/tiles/7z.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/8m.pdf b/graphics/mahjong/tiles/8m.pdf
new file mode 100644
index 0000000000..5cacf6a975
--- /dev/null
+++ b/graphics/mahjong/tiles/8m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/8p.pdf b/graphics/mahjong/tiles/8p.pdf
new file mode 100644
index 0000000000..51d2a2dfe0
--- /dev/null
+++ b/graphics/mahjong/tiles/8p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/8s.pdf b/graphics/mahjong/tiles/8s.pdf
new file mode 100644
index 0000000000..a9531d2c50
--- /dev/null
+++ b/graphics/mahjong/tiles/8s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/9m.pdf b/graphics/mahjong/tiles/9m.pdf
new file mode 100644
index 0000000000..711c0c7f32
--- /dev/null
+++ b/graphics/mahjong/tiles/9m.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/9p.pdf b/graphics/mahjong/tiles/9p.pdf
new file mode 100644
index 0000000000..fd0a9aca8c
--- /dev/null
+++ b/graphics/mahjong/tiles/9p.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/9s.pdf b/graphics/mahjong/tiles/9s.pdf
new file mode 100644
index 0000000000..fafdd63c88
--- /dev/null
+++ b/graphics/mahjong/tiles/9s.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/Back.pdf b/graphics/mahjong/tiles/Back.pdf
new file mode 100644
index 0000000000..b134215024
--- /dev/null
+++ b/graphics/mahjong/tiles/Back.pdf
@@ -0,0 +1,72 @@
+%PDF-1.4
+%쏢
+%%Invocation: path/gs -P- -dSAFER -dCompatibilityLevel=1.4 -q -P- -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=? -sOutputFile=? -P- -dSAFER -dCompatibilityLevel=1.4 ?
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+x]KB! E]E7`gD@?|b !}! s CYN[q\&81ः$Jщꑡ%%*;w'5Rγ D # 3ו$ʥnލנ.ԇU  V<endstream
+endobj
+6 0 obj
+146
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 225 300]
+/Parent 3 0 R
+/Resources<</ProcSet[/PDF]
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+/Metadata 7 0 R
+>>
+endobj
+7 0 obj
+<</Type/Metadata
+/Subtype/XML/Length 1195>>stream
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+<?adobe-xap-filters esc="CRLF"?>
+<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
+<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
+<rdf:Description rdf:about="" xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.53.3'/>
+<rdf:Description rdf:about="" xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2021-04-05T20:21:28+02:00</xmp:ModifyDate>
+<xmp:CreateDate>2021-04-05T20:21:28+02:00</xmp:CreateDate>
+<xmp:CreatorTool>GPL Ghostscript 9533 (ps2write)</xmp:CreatorTool></rdf:Description>
+<rdf:Description rdf:about="" xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:499c5954-ce58-11f6-0000-8cdb42dd55f4'/>
+<rdf:Description rdf:about="" xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
+</rdf:RDF>
+</x:xmpmeta>
+
+
+<?xpacket end='w'?>
+endstream
+endobj
+2 0 obj
+<</Producer(GPL Ghostscript 9.53.3)
+/CreationDate(D:20210405202128+02'00')
+/ModDate(D:20210405202128+02'00')
+/Creator(GPL Ghostscript 9533 \(ps2write\))>>endobj
+xref
+0 8
+0000000000 65535 f
+0000000590 00000 n
+0000001925 00000 n
+0000000531 00000 n
+0000000417 00000 n
+0000000182 00000 n
+0000000398 00000 n
+0000000654 00000 n
+trailer
+<< /Size 8 /Root 1 0 R /Info 2 0 R
+/ID [<FD45E84558D170C61AC891B6AF2FDB1D><FD45E84558D170C61AC891B6AF2FDB1D>]
+>>
+startxref
+2094
+%%EOF
diff --git a/graphics/mahjong/tiles/Blank.pdf b/graphics/mahjong/tiles/Blank.pdf
new file mode 100644
index 0000000000..c0bea0b96b
--- /dev/null
+++ b/graphics/mahjong/tiles/Blank.pdf
@@ -0,0 +1,72 @@
+%PDF-1.4
+%쏢
+%%Invocation: path/gs -P- -dSAFER -dCompatibilityLevel=1.4 -q -P- -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=? -sOutputFile=? -P- -dSAFER -dCompatibilityLevel=1.4 ?
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+xmSq[1 *@0(#5h`Yв5N"(.]^Lxvm@s˥N{/Ň<p)WZҵI7KUSƺ]aTd":(wބR$Mzv()"r39"{"ŵe2,X&12 "Sd<Ml^Dm Qcv&{\8#Ħ1^0IrRD;gJLdg:/lX1/R$Ó5IüST\$N-bY:Kxr^U}h}4MzZx]EzAM,CAG>0@qY&3Ed>Wg8R sE1txCcD3Mħ4 Nl`G8~urҶ㟘~ήendstream
+endobj
+6 0 obj
+442
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 225 300]
+/Parent 3 0 R
+/Resources<</ProcSet[/PDF]
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+/Metadata 7 0 R
+>>
+endobj
+7 0 obj
+<</Type/Metadata
+/Subtype/XML/Length 1195>>stream
+<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
+<?adobe-xap-filters esc="CRLF"?>
+<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
+<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
+<rdf:Description rdf:about="" xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 9.53.3'/>
+<rdf:Description rdf:about="" xmlns:xmp='http://ns.adobe.com/xap/1.0/'><xmp:ModifyDate>2021-04-05T20:21:28+02:00</xmp:ModifyDate>
+<xmp:CreateDate>2021-04-05T20:21:28+02:00</xmp:CreateDate>
+<xmp:CreatorTool>GPL Ghostscript 9533 (ps2write)</xmp:CreatorTool></rdf:Description>
+<rdf:Description rdf:about="" xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='uuid:499c5954-ce58-11f6-0000-3fd31d066f7a'/>
+<rdf:Description rdf:about="" xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title></rdf:Description>
+</rdf:RDF>
+</x:xmpmeta>
+
+
+<?xpacket end='w'?>
+endstream
+endobj
+2 0 obj
+<</Producer(GPL Ghostscript 9.53.3)
+/CreationDate(D:20210405202128+02'00')
+/ModDate(D:20210405202128+02'00')
+/Creator(GPL Ghostscript 9533 \(ps2write\))>>endobj
+xref
+0 8
+0000000000 65535 f
+0000000886 00000 n
+0000002221 00000 n
+0000000827 00000 n
+0000000713 00000 n
+0000000182 00000 n
+0000000694 00000 n
+0000000950 00000 n
+trailer
+<< /Size 8 /Root 1 0 R /Info 2 0 R
+/ID [<A14E4ACDE358009ED2B5C0F368B47857><A14E4ACDE358009ED2B5C0F368B47857>]
+>>
+startxref
+2390
+%%EOF
diff --git a/graphics/mahjong/tiles/Front.pdf b/graphics/mahjong/tiles/Front.pdf
new file mode 100644
index 0000000000..2d5e1ca0c3
--- /dev/null
+++ b/graphics/mahjong/tiles/Front.pdf
Binary files differ
diff --git a/graphics/mahjong/tiles/space.pdf b/graphics/mahjong/tiles/space.pdf
new file mode 100644
index 0000000000..53bfe4dc59
--- /dev/null
+++ b/graphics/mahjong/tiles/space.pdf
Binary files differ