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

Ulrike Fischer news3 at nililand.de
Tue Jun 23 10:10:42 CEST 2020


>> hyperref has a special command which inserts a small glyph to force
>> a non-zero rectangle, but I wonder if dvipdfmx could be adjusted to
>> avoid this work-around.

> In some situations dvipdfmx can't determine the extent of the box to be
> used for annotation reliably.

> Consider the following example:

>   \documentclass[dvipdfmx]{article}
>   \begin{document}
>   Some \special{pdf:bann}{\Huge\phantom{text}}\special{pdf:eann} goes here
>   \end{document}

> Here, dvipdfmx can only guess the horizontal extent from the "right3"
> DVI command. So dvipdfmx can't determine the size of annotation.

You mean it can't get the height and depth? Yes I understand this.
But couldn't it in such cases assume say 10pt?

And couldn't there be a special that would allow to define the sizes in such
cases so that one doesn't have to resort to inject hidden glyphs?

E.g. if I do this:

Some \special{pdf:bann}{\special{pdf:bannstrut height 20pt depth 3pt}%
 \Huge\phantom{text}}\special{pdf:eann} goes here

Then the dvi contains

      xxx: 'pdf:bann'
      xxx: 'pdf:bannstrut height 20pt depth 3pt'
      right: 39.792450pt
      xxx: 'pdf:eann'

This should give enough info for the size doesn't it?

Ulrike Fischer



> Consider the following example:

>   \documentclass[dvipdfmx]{article}
>   \begin{document}
>   Some \special{pdf:bann}{\Huge\phantom{text}}\special{pdf:eann} goes here
>   \end{document}

> To inspect the actual DVI output of latex, output of dvitype command
> can be used:

>   ...
>   139: setchar101 h:=6284178+291271=6575449, hh:=417
>   140: w3 218453 h:=6575449+218453=6793902, hh:=430
>   [Some ]
>   144: xxx 'pdf:bann'
>   154: right3 1146883 h:=6793902+1146883=7940785, hh:=503
>   [ ]
>   158: xxx 'pdf:eann'
>   168: w0 218453 h:=7940785+218453=8159238, hh:=517
>   169: setchar103 h:=8159238+327681=8486919, hh:=538
>   ...

> Here, dvipdfmx can only guess the horizontal extent from the "right3"
> DVI command. So dvipdfmx can't determine the size of annotation.





> Thanks,
> Shunsaku Hirata

> 2019年9月16日(月) 23:51 Ulrike Fischer <news3 at nililand.de>:
>>
>> As been discussed in a hyperref issue
>> https://github.com/ho-tex/hyperref/issues/16 the pdf:bann and pdf:eann
>> specials for creating line-breakable PDF annotations require typeset
>> glyphs in between to compute a non-zero annotation rectangle.
>>
>> hyperref has a special command which inserts a small glyph to force
>> a non-zero rectangle, but I wonder if dvipdfmx could be adjusted to
>> avoid this work-around.
>>
>>
>> \documentclass{article}
>> \usepackage{hyperref}
>>
>> \begin{document}
>>
>> \hypertarget{name}{text} \hypertarget{name2}{text}
>> \clearpage
>> \hyperlink{name}{\phantom{text}}text
>>
>> \hyperlink{name2}{\XeTeXLinkBox{\phantom{text}}}text2
>>
>> \end{document}
>>
>>
>>
>> --
>> Mit freundlichen Grüßen
>> Ulrike Fischer
>>
>>






More information about the dvipdfmx mailing list.