[XeTeX] Version 0.5 available

Ross Moore ross at ics.mq.edu.au
Sat May 1 10:07:15 CEST 2004


On 01/05/2004, at 12:23 PM, Ross Moore wrote:

>> * graphic scaling and rotation options reimplemented to correctly  
>> "chain" multiple transformations (aside: note that the .xdv format is  
>> not currently stable across versions!)
>
> The chaining is not quite in agreement with \includegraphics options  
> yet.


> It becomes more complicated with longer chains.
> Compare (using pdfLaTeX):
>
>  \includegraphics[scale=.5,height=2cm,angle=30,width=5cm]{xetex.jpg}
>
> with
>
> \XeTeXpicfile "xetex.jpg" scaled 500 height 2cm rotated 30 width 5cm
> and
> \XeTeXpicfile "xetex.jpg" height 2cm rotated 30 width 5cm
>
> where neither is "correct".
>
>
> Better agreement is obtained with:
>
>  \XeTeXpicfile "xetex.jpg" scaled 920 height 2cm rotated 30 width 5cm
>
> As yet I'm not sure yet how  ~0.92 arises as the correct scaling.
> Of course the rotation alters the aspect-ratio, so the trigonometry
> leads to awkward scaling factors.

I understand this now.
You can see what happens with the following example,
which should be run with both  pdfLaTeX  and  XeLaTeX.
Compare the results:


\documentclass[11pt]{article}
\ifx\pdfliteral\undefined\else\usepackage{graphicx}\fi

\begin{document}
\noindent
\ifx\pdfliteral\undefined
\framebox{\setbox0=\hbox{\XeTeXpicfile "xetex.jpg" width 5cm}%
  \typeout{picture: wd=\the\wd0, ht=\the\ht0, dp0=\the\dp0}\box0}\\%
\framebox{\setbox0=\hbox{\XeTeXpicfile "xetex.jpg" rotated 30 width  
5cm}%
  \typeout{rotated: wd=\the\wd0, ht=\the\ht0, dp0=\the\dp0}\box0}\\%
\framebox{\setbox0=\hbox{\XeTeXpicfile "xetex.jpg" width 5cm rotated  
30}%
  \typeout{rotated: wd=\the\wd0, ht=\the\ht0, dp0=\the\dp0}\box0}%
  \else
\framebox{\setbox0=\hbox{\includegraphics[width=5cm]{xetex.jpg}}%
  \typeout{picture: wd=\the\wd0, ht=\the\ht0, dp0=\the\dp0}\box0}\\%
\framebox{\setbox0=\hbox{\includegraphics[angle=30,width=5cm]{xetex.jpg} 
}%
  \typeout{rotated: wd=\the\wd0, ht=\the\ht0, dp0=\the\dp0}\box0}\\%
\framebox{\setbox0=\hbox{\includegraphics[width=5cm,angle=30]{xetex.jpg} 
}%
  \typeout{rotated: wd=\the\wd0, ht=\the\ht0, dp0=\the\dp0}\box0}%
  \fi \\
  \framebox{\setbox0=\hbox{\vrule width 5truecm height 2cm}%
  \typeout{rule cm:wd=\the\wd0, ht=\the\ht0, dp0=\the\dp0}\box0}\\
  \framebox{\setbox0=\hbox{\vrule width 5cm height 2cm}%
  \typeout{truecm: wd=\the\wd0, ht=\the\ht0, dp0=\the\dp0}\box0}

  \end{document}


XeTeX has both of the 'rotated' images as being the same size;
that is,
    \XeTeXpicfile "xetex.jpg" rotated 30 width 5cm
    \XeTeXpicfile "xetex.jpg" width 5cm rotated 30
give the same result,
but with pdfLaTeX (and other drivers)
    \includegraphics[angle=30,width=5cm]{xetex.jpg}
    \includegraphics[width=5cm,angle=30]{xetex.jpg}
are different.

When a rectangle is rotated, its bounding-box width
always increases, reaching a maximum as the diagonal
becomes horizontal. (Depending upon the height,
it needs to be rotated through quite a large angle
before the width becomes less than the initial width.)

Thus the 2nd \includegraphics example gives a rotation
of a 5cm-wide rectangle, which thus has width > 5cm;
whereas the 1st example is specified to have width 5cm.

XeTeX always does the rotation last, so will produce
a rectangle of width > 5cm in both cases.


Since I don't know what is possible with the Quartz
interface that you are using, it's hard to suggest a fix.

Is it possible for you to reprocess results returned
from Quartz ?
e.g.  render a rotated image, then re-render the result
scaled to a specified width or height ?

It's the latter that needs to be measured for typesetting,
and then be placed into the final PDF.


If this is possible, then the next desirable thing would
be to be able to rotate/scale arbitrary TeX material.
But surely that's significantly harder.



Cheers

	Ross


>>
>> Jonathan
>>
>> _______________________________________________
>> XeTeX mailing list
>> postmaster at tug.org
>> http://tug.org/mailman/listinfo/xetex
>>
>>

------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------



More information about the XeTeX mailing list