From 76204e3bf12d1dd3d116824e0e159276c05966f9 Mon Sep 17 00:00:00 2001
From: dakkar <dakkar@thenautilus.net>
Date: Sun, 23 Oct 2011 19:42:03 +0100
Subject: dimensioni parametriche (da Marco)

---
 incantesimi/incantesimi.cmd.tex | 91 +++++++++++++++++++++++++++++++----------
 1 file changed, 69 insertions(+), 22 deletions(-)

(limited to 'incantesimi/incantesimi.cmd.tex')

diff --git a/incantesimi/incantesimi.cmd.tex b/incantesimi/incantesimi.cmd.tex
index ef785e9..00741f8 100644
--- a/incantesimi/incantesimi.cmd.tex
+++ b/incantesimi/incantesimi.cmd.tex
@@ -25,30 +25,72 @@
 \setlength{\parindent}{0pt}
 
 %%%%
+\newlength{\etichettawidth}
+\setlength{\etichettawidth}{4.8cm}
+\newlength{\etichettaheight}
+\setlength{\etichettaheight}{7cm}
+
+%%%%
+\newlength{\cardtopmargin}
+\setlength{\cardtopmargin}   {0mm}
+\newlength{\cardbottommargin}
+\setlength{\cardbottommargin}{0mm}
+\newlength{\cardleftmargin}
+\setlength{\cardleftmargin}  {0mm}
+\newlength{\cardrightmargin}
+\setlength{\cardrightmargin} {0mm}
+
+\newlength{\cardwidth}
+\setlength{\cardwidth}{\etichettawidth}
+\addtolength{\cardwidth}{-\cardleftmargin}
+\addtolength{\cardwidth}{-\cardrightmargin}
+
+\newlength{\cardheight}
+\setlength{\cardheight}{\etichettaheight}
+\addtolength{\cardheight}{-\cardtopmargin}
+\addtolength{\cardheight}{-\cardbottommargin}
+
+\newlength{\cardtitlewidth}
+\setlength{\cardtitlewidth}{\cardwidth}
+\pgfmathsetlength{\cardtitlewidth}{min(\etichettawidth-2mm,\cardtitlewidth)}
+
+\newlength{\sidenodeheight}
+\setlength{\sidenodeheight}{3mm}
+
 \newlength{\cardtextwidth}
-\setlength{\cardtextwidth}{4.33cm}
+\setlength{\cardtextwidth}{\cardwidth}
+\pgfmathaddtolength{\cardtextwidth}{-1.5*\sidenodeheight}
 
 %\fontseries{c}\fontshape{sc}
 
-\tikzstyle{carta}=[rectangle,minimum width=4.8cm,minimum height=7cm,outer sep=0,use as bounding box
-%  ,ultra thin,draw %uncomment to show card boxes!
+\tikzstyle{etichetta}=[rectangle,minimum width=\etichettawidth,minimum height=\etichettaheight,outer sep=0,use as bounding box
+%  ,ultra thin,draw=blue %uncomment to show etichetta boxes!
 ]
 
-\tikzstyle{title label}=[rectangle,text=blue!80!green!75!black,minimum height=2\baselineskip,font={\small},inner sep=1mm,text width=4.6cm,align=flush center]
+\tikzstyle{carta}=[rectangle,minimum width=\cardwidth,minimum height=\cardheight,outer sep=0
+%  ,ultra thin,draw=red %uncomment to show carte boxes!
+]
 
-\tikzstyle{side label}=[rectangle,text=green!25!black,minimum height=3mm,font=\tiny,inner sep=0.5mm,rotate=270]
+\tikzstyle{title label}=[rectangle,text=blue!80!green!75!black,minimum height=2\baselineskip,font={\small},
+                         inner xsep=0pt,inner ysep=1mm,text width=\cardtitlewidth,align=flush center]
+
+\tikzstyle{side label}=[rectangle,text=green!25!black,minimum height=\sidenodeheight,font=\tiny,outer sep=0pt,inner sep=0.5mm,rotate=270]
 
 \tikzstyle{subt label}=[text=magenta!25!black,font=\scriptsize,inner xsep=2pt,inner ysep=0.2em,text width=\cardtextwidth]
 
-\tikzstyle{descr label}=[rectangle,text=red!50!black,font={\sffamily\footnotesize},inner xsep=2pt,inner ysep=1mm,text width=\cardtextwidth,align=justify]
+\tikzstyle{descr label}=[rectangle,text=red!50!black,font={\sffamily\footnotesize},
+                         inner xsep=2pt,inner ysep=1mm,text width=\cardtextwidth,align=justify]
 
-\tikzstyle{trg label}=[rectangle,text=red!70!blue!90!yellow,font={\sffamily\footnotesize},inner xsep=2pt,inner ysep=1mm,align=#1]
+\tikzstyle{trg label}=[rectangle,text=red!70!blue!90!yellow,font={\sffamily\footnotesize},
+                       inner xsep=2pt,inner ysep=1mm,text width=\cardtextwidth,align=#1]
 
-\tikzstyle{above angles label}=[text=blue!50!black,font=\scriptsize,minimum height=\baselineskip,align=justify]
+\tikzstyle{above angles label}=[text=blue!50!black,font=\scriptsize,minimum height=\baselineskip]
 
-\tikzstyle{angles label}=[rectangle split,rectangle split parts=2,rectangle split part align=left,text=blue!50!black,font=\tiny,align=justify]
+\tikzstyle{angles label}=[rectangle split,rectangle split parts=2,rectangle split part align=left,
+                          inner sep=1mm,text=blue!50!black,font=\tiny]
 
-\tikzstyle{prep label}=[rectangle split,rectangle split parts=2,rectangle split part align=left,draw,ultra thin,minimum width=0.333*4.8cm,text=yellow!10!black,inner xsep=0.1em,inner ysep=0.293em,font={\it\tiny}]%inner ysep is set to have 7mm overall heigh
+\tikzstyle{prep label}=[rectangle,draw,ultra thin,minimum height=0.05\etichettaheight,text=yellow!10!black,
+                        inner xsep=0.1em,inner ysep=0.293em,font={\it\tiny},align=left,text width=0.3333\etichettawidth]
 
 %%%%
 
@@ -76,29 +118,35 @@
 \newcommand{\spellcard}[1]{%
 %\begin{scope}[every node/.style={draw,ultra thin},/spells/.cd,#1]
 \begin{scope}[/spells/.cd,#1]
-\node[carta] (card) {};
+%
+\node[etichetta] (label) {};
+%
+\node[anchor=north west,carta] (card) at ($(label.north west)+(\cardleftmargin,-\cardtopmargin)$) {};
 
 % titolo
 \node [anchor=north,title label] (name) at (card.north)
       {\usefont{OT1}{ptm}{bx}{sc}\pgfkeysvalueof{/spells/name}};
 
 %angolo nord est
-\node [anchor=north west,side label] (type) at ($(card.east |- name.south) - (0mm,0.0mm)$)
+\node [anchor=north west,side label] (type) at (card.east |- name.south)
       {\textsl{\pgfkeysvalueof{/spells/type}}};
 
 %lato sud
-\node [anchor=south,prep label] (prep) at (card.south)
-      {Prep:\nodepart{two}Used:};
+\node [anchor=south,prep label] (used) at ($(card.south)-0.5*(\cardleftmargin+\cardrightmargin,0)$)
+      {Used:};
+
+\node [anchor=south,prep label] (prep) at (used.north)
+      {Prep:};
 
 %lato sud ovest
 \node [anchor=south west,above angles label] (durata) at (card.west |- prep.north)
-      {\textsf{Duration: \pgfkeysvalueof{/spells/durata}}};
+      {\textsf{Dur: \pgfkeysvalueof{/spells/durata}}};
 
 %lato sud est
 \node [anchor=south east,above angles label] (tempo) at (card.east |- prep.north)
       {\pgfkeysvalueof{/spells/tempostr}};
 
-\node [anchor=north east,side label] (ref) at ($(tempo.north east) + (0,3mm)$)
+\node [anchor=north east,side label] (ref) at ($(tempo.north east) + (0,0.05\cardheight)$)
       {\pgfkeysvalueof{/spells/ref}};
 
 
@@ -115,11 +163,10 @@
 \node [anchor=north east,align=flush right,rectangle,subt label] (source) at (type.south west)
       {\emph{\pgfkeysvalueof{/spells/source}}};
 
-\node [anchor=north west,subt label,align=left]
-      (components) at ($(source.south -| card.west) - (0mm,0mm)$)
+\node [anchor=north west,subt label,align=left] (components) at (source.south -| card.west)
       {\textsc{\pgfkeysvalueof{/spells/components}}};
-\node [anchor=north west,subt label,align=flush right]
-      (specialcomp) at (components.south west)
+
+\node [anchor=north west,subt label,align=flush right] (specialcomp) at (components.south west)
       {\tiny\pgfkeysvalueof{/spells/specialcomp}};
 
 
@@ -131,10 +178,10 @@
       {\tiny\fontseries{e}\pgfkeysvalueof{/spells/note}};
 
 % sopra il centro
-\node [anchor=south west,trg label=flush left] (target) at ($(description.north west) + (0,1mm)$)
+\node [anchor=south west,trg label=flush left] (target) at ($(description.north west) + (0,0.014\cardheight)$)
       {{\tiny{}Target/Effect/Area:}\\{\slshape\pgfkeysvalueof{/spells/target}}};
 
-\node [anchor=south east,trg label=flush right] (range) at (target.north -| type.south)
+\node [anchor=east,trg label=flush right] (range) at (target.north -| type.south)
       {{\tiny{}Range:} \textnormal{\itshape\pgfkeysvalueof{/spells/range}}};
 
 %lato est
-- 
cgit v1.2.3

