[pdftex] Setting text rendering parameter

Paweł Jackowski P.Jackowski at gust.org.pl
Tue Sep 29 19:18:41 CEST 2009


> Why should it? I got Pawel's posting AFTER I had send mine.
> But you have to answer it yourself:
> * Do you need save/restore? For example, do you exactly know
>   your linewidth setting?

IMO the question is do you need to use \pdfsave and \pdfrestore 
primitives? As far as I remember, they do a little bit more then just 
inserting q..Q into the content stream, as they are `seen' by TeX (and 
affects annots matrices). Anyways, unless you really need those 
primitives, you should not use them, as they generate redundant 
transformations:

1 0 0 1 x y cm
q
1 0 0 1 -x -y cm
...
1 0 0 1 x y cm
Q
1 0 0 1 -x -y cm

No redundancy if you use

\pdfliteral page{q}
\pdfliteral page{Q}


> * For the first solution I would have to study the internals
>   of positioning of \pdfliteral in more detail.
>   At the first glance, I wouldn't want to trust it.
>   But I currently don't have the time.

IMO pdfliterals with 'page' and 'direct' keywords leads to surprises 
when used immediatelly after \pdfliteral in a default mode (with no 
keyword).

Try this,

	\pdfliteral page{0 0 28 28 re S}
	\end

you get a rectangle at lower-left. And this:

	\pdfliteral{}
	\pdfliteral page{0 0 28 28 re S}
	\end

You get a rectangle in the current point.

So yes, mixing pdfliteral modes is dangerous regarding the position.
But I don't mix them in my examples.

Cheers, Paweł
-- 
Pawe/l Jackowski
P.Jackowski at gust.org.pl


More information about the pdftex mailing list