[pdftex] Setting text rendering parameter

Heiko Oberdiek oberdiek at uni-freiburg.de
Tue Sep 29 22:18:51 CEST 2009


On Tue, Sep 29, 2009 at 07:18:41PM +0200, Pawe?? Jackowski wrote:

> 
> >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

If you want to remove redundancy, then you have to postprocess
the file (I am doing so with my bundle and latex-tds).
I don't see that Martin's example exclude destinations and links.

> 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.

Yes I remember that \pdfliteral is somewhat context sensitive in its
behaviour. And usually you don't know, what is the context before.
Thus you have to control the context and are relying on internals
that might change in later versions (they have changed in the past).

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>
-- 


More information about the pdftex mailing list