Difference between revisions of "Scaling Rotating Mirroring Clipping"

From Wiki
Jump to navigation Jump to search
(→‎\clip: with the help of wizards...)
(Undo revision 4508 by 66.92.66.221 (Talk))
Line 1: Line 1:
In [http://source.contextgarden.net/tex/context/base/core-mis.mkii core-mis.mkii] ([http://source.contextgarden.net/tex/context/base/core-mis.mkiv core-mis.mkiv] for MkIV) there are some handy command for graphical text manipulation defined.
+
7ZMb3j  <a href="http://gmipfkeiexfa.com/">gmipfkeiexfa</a>, [url=http://lfjthrodjmkl.com/]lfjthrodjmkl[/url], [link=http://stzyvhpmzaea.com/]stzyvhpmzaea[/link], http://wekypunzqwzk.com/
 
 
== \scale ==
 
 
 
You can insert symbols at a reduced size in the text flow. This example creates a filled square scaled to .5 ex height
 
 
 
<texcode>
 
\definefontsynonym[Dingbats][uzdr]
 
\definesymbol[filledSq][\getglyph{Dingbats}{\char110}]
 
\def\FilledSquare%
 
    {\dontleavehmode\scale[height=0.5ex]{\symbol[filledSq]}}
 
</texcode>
 
 
 
In TeX terms, \scale creates a \hbox. If TeX is in vertical
 
mode (as it is when \startlines is in effect, because every line
 
is a paragraph by itself in the mode), then a simple \hbox is
 
not a good enough hint to make it switch to horizontal (paragraph)
 
mode.
 
 
 
Hans then posted a simpler way.
 
<texcode>
 
\getscaledglyph{.5}{Serif}{a}
 
</texcode>
 
 
 
{{todo|An explanation and example of the <cmd>\scale</cmd> command.}}
 
 
 
== \mirror ==
 
 
 
<texcode>
 
There is a \mirror{\sl mirorred} word in this sentence.
 
</texcode>
 
 
 
<context>
 
There is a \mirror{\sl mirorred} word in this sentence.
 
</context>
 
 
 
<code>\mirror</code> makes a <code>\hbox</code> and mirrors the contents. If you want to have a longer paragraph mirrored, you have to make a <code>\vbox</code> manually.
 
 
 
<texcode>
 
\mirror{\vbox{Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do:
 
once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, `and
 
what is the use of a book,' thought Alice `without pictures or conversation?'}}
 
</texcode>
 
 
 
 
 
<context>
 
\mirror{\vbox{Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do:
 
once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, `and
 
what is the use of a book,' thought Alice `without pictures or conversation?'}}
 
</context>
 
 
 
== \rotate ==
 
 
 
You can rotate something by an arbitrary angle by saying something like
 
<texcode>
 
\rotate[rotation=42]{the ultimate answer}
 
</texcode>.
 
<context>
 
\rotate[rotation=42]{the ultimate answer}
 
</context>.
 
 
 
The rotation angle and the location (which determines around which point the content is rotated) are optional and can also be set by
 
<texcode>
 
\setuprotate[rotation=42,location=normal] % normal is the default
 
\rotate{the ultimate answer}
 
</texcode>
 
 
 
An example by Hans Hagen showing the influence of <code>location=</code> argument at different angles:
 
 
 
<texcode>
 
\dostepwiserecurse{0}{359}{45}
 
  {\startlinecorrection[blank]
 
    \hbox
 
      {\expanded{\setuprotate[rotation=\recurselevel]}%
 
      \traceboxplacementtrue
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=depth] {\ruledhbox{\bfb  (depth)}}}}%
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=fit]  {\ruledhbox{\bfb    (fit)}}}}%
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=broad] {\ruledhbox{\bfb  (broad)}}}}%
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=normal]{\ruledhbox{\bfb (normal)}}}}%
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=high]  {\ruledhbox{\bfb  (high)}}}}}
 
    \stoplinecorrection}
 
</texcode>
 
 
 
<context>
 
\setuplayout[location=middle,scale=.5]
 
\dostepwiserecurse{0}{359}{45}
 
  {\startlinecorrection[blank]
 
    \hbox
 
      {\expanded{\setuprotate[rotation=\recurselevel]}%
 
      \traceboxplacementtrue
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=depth] {\ruledhbox{\bfb  (depth)}}}}%
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=fit]  {\ruledhbox{\bfb    (fit)}}}}%
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=broad] {\ruledhbox{\bfb  (broad)}}}}%
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=normal]{\ruledhbox{\bfb (normal)}}}}%
 
      \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=high]  {\ruledhbox{\bfb  (high)}}}}}
 
    \stoplinecorrection}
 
</context>
 
 
 
You can rotate a long paragraph as well.
 
 
 
{{todo|Some more comments, and an example.}}
 
 
 
Depending on the usage you will sometimes probably want to include the content of what you wish to rotate into a box. Compare the following two examples:
 
 
 
<texcode>
 
\setuplayout[width=3cm]
 
\setuprotate[rotation=180,location=broad]
 
 
 
a\rotate{e}i\par
 
a\rotate{\hbox{e}}i
 
</texcode>
 
 
 
<context>
 
\setuplayout[width=3cm]
 
\setuprotate[rotation=180,location=broad]
 
 
 
a\rotate{e}i\par
 
a\rotate{\hbox{e}}i
 
</context>
 
 
 
== \clip ==
 
(This is not just about text manipulation...)
 
 
 
<context source="yes">
 
\clip[nx=3,ny=3,x=1,y=1]{\externalfigure[cow]}
 
</context>
 
 
 
 
 
<context source="yes">
 
\setupcolors[state=start]
 
\definedfont[SansBold at 20mm]
 
\baselineskip 0pt % switch off the space between the stripes
 
\lineskip 0pt
 
\def\MyLogo{\vbox{\hbox{\CONTEXT}\null}} % null is necessary for the whole bounding box
 
\clip[ny=3,y=1]{\color[yellow]\MyLogo}
 
\clip[ny=3,y=2]{\color[orange]\MyLogo}
 
\clip[ny=3,y=3]{\color[red]\MyLogo}
 
</context>
 
 
 
see also <cmd>setupclipping</cmd> and <cmd>clip</cmd>
 

Revision as of 04:15, 24 September 2010

7ZMb3j <a href="http://gmipfkeiexfa.com/">gmipfkeiexfa</a>, [url=http://lfjthrodjmkl.com/]lfjthrodjmkl[/url], [link=http://stzyvhpmzaea.com/]stzyvhpmzaea[/link], http://wekypunzqwzk.com/