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

Ulrike Fischer news3 at nililand.de
Tue Jun 23 18:11:22 CEST 2020

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

> Yes, height and depth can't be determined. It is possible to use some
> predefined height and depth as default but I'm not sure what value is
> adequate. Also, using current font size may not work, as indicated by
> the example where \Huge is inserted before the phantom text.

> My other concern is that there is no way for dvipdfmx to decide whether
> a horizontal space is due to a phantom text which should be considered
> as part of annotation. For example, the first-line indent of paragraph may
> appear after the \special{pdf:bann} command (DVI instruction "xxx"):

>   \documentclass[]{article}
>   \begin{document}
>   \special{pdf:bann}Hello\special{pdf:eann}
>   \end{document}

> In this case, the horizontal space within the bann-eann block should be
> ignored.

Yes, but I don't think that it would do much harm. Normally there is a
\leavevmode before (\pdfstartlink of pdftex doesn't work in vertical
mode). Also imho a too large annotation rectangle is better
than no annotation at all.

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

> But the original problem was when using hyperref package:

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

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.

--
Mit freundlichen Grüßen
Ulrike Fischer