[dvipdfmx] missing annotation rectangle if the box contains no glyph

Shunsaku Hirata shunsaku.hirata74 at gmail.com
Wed Jun 24 07:17:24 CEST 2020


> > But the original problem was when using hyperref package:
>
> >   \hyperlink{name}{\phantom{text}}text
>
> > Then, hyperref needs to automatically adjust special commands it generates
> > according to the text in \hyperlink{}?
>
> probably it would make more sense then if \phantom would write its
> dimensions to the dvi.

Can hyperref modify the definition of \phantom temporarily within hyperlink (and
if any within other commands which use pdf:bann and pdf:eann) so that it inserts
a special instruction like,

  \special{pdf:xann width 32pt height 9pt depth 1pt}

which tells dvipdfmx to extend the current annotation rectangle being
calculated?
(regardless of if there already is a non-empty box created)

To explain this in more details:
Suppose that the current annotation rectangle is [llx lly urx ury] (or
not created)
and pdf:xann is inserted at position (x, y) with specified size
width:32pt, height:9pt,
depth:1pt (all big-point here), then the rectangle is extended so that
it contains a
rectangle [x y-1 x+32 y+9].

Having such a special command is quite easy for dvipdfmx and implementation
is far more clear than supporting bann-eann containing only horizontal spaces.

> The main problem with the current state is that one has to add a font
> and font glyphs to the pdf. Even if is only a space - it is in the pdf
> at the end. And that is not something one can add by default
> everywhere. But writing out some specials to help dvipdfmx to find the
> annotation rectangle doesn't harm.

Thanks,
Shunsaku Hirata


More information about the dvipdfmx mailing list.