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
|
\begin{tikzpicture}[font=\sffamily,>=latex]
\def\text{\scalebox{10}{Xy}}
\sbox\mybox{\pgfinterruptpicture\sffamily\color{black!25}\scalebox{10}{Xy}\endpgfinterruptpicture}
\def\HEIGHT{\ht\mybox}
\def\WIDTH{\wd\mybox}
\def\DEPTH{\dp\mybox}
\def\LLX{.15\WIDTH}
\def\LLY{.5\DEPTH}
\def\URX{.15\WIDTH}
\def\URY{.25\HEIGHT}
\node [inner sep=0pt,anchor=base west] {\usebox\mybox};
\draw (0,0) -- (\WIDTH,0);% node [above,midway] {baseline};
\begin{scope}[blue,every node/.append style={inner sep=2pt}]
\begin{scope}
\draw ([shift={(-\LLX,-\LLY)}]0,-\DEPTH) rectangle ([shift={(\URX,\URY)}]\WIDTH,\HEIGHT);
\end{scope}
\draw [->] (.5\WIDTH,-\DEPTH) -- ++(0,-\LLY) node [right,midway] {\scriptsize lly};
\draw [->] (0,.5*\HEIGHT-.5*\DEPTH) -- ++(-\LLX,0) node [above,midway] {\scriptsize llx};
\draw [->] (.5\WIDTH,\HEIGHT) -- ++(0,\URY) node [right,midway] {\scriptsize ury};
\draw [->] (\WIDTH,.5*\HEIGHT-.5*\DEPTH) -- ++(\URX,0) node [above,midway] {\scriptsize urx};
\draw [->] (.5\WIDTH,-\DEPTH) -- ++(0,-\LLY) node [right,midway] {\scriptsize lly};
\draw (-\LLX,-\LLY) -- ([shift={(+\URX,0)}]\WIDTH,-\LLY);
\path [fill=white,draw] (-\LLX,-\LLY) circle (1pt);
\draw [->] (.5\WIDTH,0pt) -- ++(0,-\LLY) node [right,midway] {\scriptsize lly};
\end{scope}
\draw [thick] (0,-\DEPTH) rectangle (\WIDTH,\HEIGHT);
\path [fill=white,draw=black] (0,0) circle (1pt);
\path let
\p1 = (current bounding box.south west),
\p2 = (current bounding box.north east),
\p3 = (0,-\DEPTH),
\p4 = (\WIDTH,\HEIGHT)
in
(\x3-\x2+\x4,\y3) rectangle (\x4+\x3-\x1,\y4);
\end{tikzpicture}
|