% !TEX TS-program = lualatex
\documentclass[]{article}

% This was created by Chris Staecker
% You are free to do whatever you want with it.

% Requires the EB Garamond font, available at Google Fonts,
% and also River Liffey Italic, which I got here:
% https://textfonts.net/river-liffey-font.html

% Export to 1000dpi for squareshop print file

\newcommand{\paperdim}{23cm}

\usepackage[paperwidth=\paperdim, paperheight=\paperdim,margin=0pt ]{geometry}

\usepackage{wasysym,marvosym} % for zodiac signs

\usepackage{fontspec}

\setmainfont[ BoldFont = *,
    BoldFeatures={RawFeature={+axis={wght=900}}},
    ItalicFont = EBGaramond-Italic-VariableFont_wght.ttf,
    ]{EBGaramond-VariableFont_wght.ttf} % for letters


\usepackage{nopageno,fullpage}
\usepackage{xfp}

\usepackage{tikz}

\usetikzlibrary{decorations.pathmorphing}

\tikzstyle{wiggle}=[thick,decorate,decoration={random steps,segment length=4pt,amplitude=.1pt}] 
%\tikzstyle{wiggle}=[] % use this instead of previous line to speed it up

\tikzstyle{rmletters}=[scale=2.2]
\tikzstyle{gkletters}=[scale=2]
\tikzstyle{numbers}=[scale=2,xscale=1.3]

\usepackage{background}


\backgroundsetup{
scale=1,
color=black,
opacity=1,
angle=0,
contents={%
  \includegraphics[width=\paperwidth,height=\paperheight]{parchment-square.jpg}
    }%
}
\newcommand{\bigbox}[1]{\noindent\raisebox{-\height}[0pt][0pt]{%
\makebox[\linewidth][l]{#1}}}
  
\oddsidemargin=-1in
\topmargin=-1in

\usepackage{layout}


\begin{document}

\pagestyle{empty}
\clearpage

\def\letters{{"a","b","c","d","e","f","g","h","i","k","l","m","n","o","p","q","r","ſ","t","v","x","y","z","\&","α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "σ", "τ", "υ", "φ", "χ", "ψ"}}
\bigbox{
\begin{tikzpicture}[scale=.665,transform shape,rotate=.15]
\path (0,0) -- (0,29.6);
\path (-4.5,0) -- (0,0);

\foreach \i in {0,...,24} {
 \draw[wiggle] (0,\i) -- (24,\i);
 \draw[wiggle] (\i,0) -- (\i,24);
 }
 
%letters
\foreach \i in {0,...,23} {
 \node[shift={(.5,.5)},rmletters] at (\i,0) {\pgfmathparse{\letters[\i]}\textbf{\pgfmathresult}}; %bottom
 \node[shift={(.5,.5)},rmletters] at (0,\i) {\pgfmathparse{\letters[\i]}\textbf{\pgfmathresult}}; %left
}
\foreach \i in {1,...,22} {
 \node[shift={(.5,.5)},gkletters] at (23,\i) {\pgfmathparse{\letters[\i+23]}\textbf{\pgfmathresult}}; %right
}
\foreach \i in {1,...,23} {
 \node[shift={(.5,.5)},rotate=-90,gkletters] at (\i,23) {\pgfmathparse{\letters[\i+23]}\textbf{\pgfmathresult}}; %top
}

%diagonal dots
\foreach \i in {1,...,22} {
 \node[shift={(.5,.5)},scale=3] at (\i,\i) {.};
}

%omegas
\node[shift={(.5,.5)},rotate=-45, gkletters,scale=1.5] at (6,3) {\textbf{ω}};
\node[shift={(.5,.5)},rotate=-45, gkletters, scale=1.5] at (3,6) {\textbf{ω}};

% "Pro pag."
\node[rotate=-90,scale=3,anchor=west] at (28.8,28) {\textit{Pro pag.}};

% zodiac signs
\node[rotate=-45,scale=3.4,xscale=1.5] at (-1.7,-1.7) {\Aries}; %SW
\node[rotate=135,scale=3.5,xscale=-1.1] at (27.6,-3.5) {\Cancer}; %SE
\node[rotate=-45,scale=4] at (-3,27.1) {\Taurus}; %NW
%\node[rotate=-45,scale=4] at (-3.4,27.5) {\Taurus}; %NW %really it should be this one, but it messes up the left margin
\node[rotate=-45,scale=3.4,xscale=2.3] at (25.9,25.9) {\gemini}; %NE

\setmainfont{River Liffey Italic.ttf} % this font looks better for the numbers

%numbers
\foreach \i in {0,...,22} {
 \node[shift={(.9,.3)},rotate=-45,anchor=north west, numbers] at (\i,0) {\fpeval{2^\i}}; %bottom
 \node[shift={(-.5,.3)},rotate=-45,anchor=south east, numbers] at (0,\i) {\fpeval{2^\i}}; %left
 }
\foreach \i in {24,...,46} {
 \node[shift={(.7,0)},rotate=-45,anchor=south east, numbers] at ({\i-24},24) {\fpeval{2^\i}}; %top
 \node[shift={(.7,1.5)},rotate=-45,anchor=north west, numbers] at (24,{\i-24}) {\fpeval{2^\i}}; %right
}
\node[shift={(1.5,.3)},rotate=-45,anchor=north west, numbers] at (23,0) {8388608};
\node[shift={(-.5,.8)},rotate=-45,anchor=south east, numbers] at (0,23) {8388608};

% 130
\node[rotate=-90,scale=1.2,anchor=west,numbers] at (28.8,24.6) {130};

% diagonal underlines
\foreach \i in {1,...,23} {
 \draw[rotate around={-45:(\i,0)},wiggle] (\i,0) -- ({\i+1.45 + .115*(\i-1)}, 0); %bottom
 \draw[rotate around={45:(0,\i)},wiggle] (0,\i) -- (0,{\i+1.45 + .115*(\i-1)}); %left
 \draw[rotate around={-45:(24,\i)},wiggle] (24,\i) -- ({24+4 + .18*(\i-1)},\i); %right
 \draw[rotate around={135:(\i,24)},wiggle] (\i,24) -- ({\i+4.2 + .16*(\i-1)}, 24); %top 
}



\end{tikzpicture}
}


\end{document}