diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2021-10-11 15:31:57 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2021-10-11 15:31:57 +0200 |
| commit | 93b9098d3e51a4ee92c060d1a4ec85e3a55a0054 (patch) | |
| tree | 9223eb5623e69355596869aa3689bf53651f95f2 | |
| parent | cd36afe9e4f194a832c122aa7de835b8a0878fcd (diff) | |
| download | muhqs-game-93b9098d3e51a4ee92c060d1a4ec85e3a55a0054.tar.gz muhqs-game-93b9098d3e51a4ee92c060d1a4ec85e3a55a0054.zip | |
[tikzcards] improve left strip text scaling
| -rw-r--r-- | latex/tikzcards.tex | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/latex/tikzcards.tex b/latex/tikzcards.tex index 8d3a29ae..de5441ab 100644 --- a/latex/tikzcards.tex +++ b/latex/tikzcards.tex @@ -21,6 +21,13 @@ \pgfmathsetmacro{\leftStripLongHeight}{ \cardheight - (3 * \strippadding) - \stripShortHeight } + +% Thresholds for the text in the left strip +\pgfmathsetmacro{\leftStripLongHeightNormal}{\leftStripLongHeight * 0.75} +\pgfmathsetmacro{\leftStripLongHeightSmall}{\leftStripLongHeight * 0.85} +\pgfmathsetmacro{\leftStripLongHeightFootnotesize}{\leftStripLongHeight * 0.95} +\pgfmathsetmacro{\leftStripLongHeightScriptsize}{\leftStripLongHeight * 1.05} + \pgfmathsetmacro{\leftStripTextXCoord}{\strippadding + 0.5 * \stripwidth} \pgfmathsetmacro{\costXCoord}{\cardwidth - 0.5 * \stripwidth - \strippadding} @@ -123,19 +130,26 @@ \fill[strip, #1] \shapeLeftStripShort; \end{scope} - \node(leftStripTextInvisible) at (\leftStripTextXCoord, \leftStripLongHeight - \strippadding) + \node(leftStripTextInvisible) at (\leftStripTextXCoord, \leftStripLongHeight - \textpadding) [rotate=90, anchor=east, font=\normalsize, opacity=0] { \uppercase{#4 - #2} }; \getnodedimen{leftStripTextInvisible} - \node(leftStripText) at (\leftStripTextXCoord, \leftStripLongHeight - \strippadding) + \node(leftStripText) at (\leftStripTextXCoord, \leftStripLongHeight - \textpadding) [rotate=90, anchor=east, font=\normalsize] { \color{white} - \ifdimgreater{\nodeheight}{\leftStripLongHeight cm - (\leftStripLongHeight cm / 4)} - {{\small \uppercase{#4 - #2}}} + + \ifdimgreater{\leftStripLongHeightNormal cm}{\nodeheight} {\uppercase{#4 - #2}} + {\ifdimgreater{\leftStripLongHeightSmall cm}{\nodeheight} + {\small \uppercase{#4 - #2}} + {\ifdimgreater{\leftStripLongHeightFootnotesize cm}{\nodeheight} + {\footnotesize \uppercase{#4 - #2}} + {\ifdimgreater{\leftStripLongHeightScriptsize cm}{\nodeheight} + {\scriptsize \uppercase{#4 - #2}} + {\tiny \uppercase{#4 - #2}}}}} }; \node at (\leftStripTextXCoord, \cardheight - \strippadding - \strippadding - 0.37) { @@ -278,6 +292,6 @@ % Module containing the card \newcommand{\cardmodule}[1]{ \node[rotate=90, right] at - (\strippadding + 0.5 * \stripwidth, \strippadding + \strippadding) + (\strippadding + 0.5 * \stripwidth, \textpadding) {\color{black}#1}; } |
