Font disregarded in Freetext annotation with default appearance (DA) but without appearance stream (AP)
Submitted by oli..@..den.de
Assigned to poppler-bugs
Created attachment 141117 Test file with freetext annotation without appearance stream
Attached is an example file with a freetext annotation. This annotation has a default appearance (DA) but no appearance stream (AP). Poppler disregards the font of the annotation. While admittedly the file has been constructed by hand-editing (annotating the file in Adobe Reader and then manually removing the /AP part), it is nevertheless a standard-conforming file.
Fixing this issue is a necessary first step towards fixing https://bugs.freedesktop.org/show_bug.cgi?id=81748 .
I attach a preliminary patch which kind-of fixes the issue. 'Kind-of' only, because there are (at least) two issues with it:
"Syntax Warning: Unknown font type: '???'"
from the call to 'GfxFont::makeFont' in Annot.cc:2933
The text is moved a little bit towards the top of the page (notice how the top part of "This is a test" is cut off).
The fact that poppler renders the text in the wrong color (red instead of black) is a separate bug.
Test file and patch have been written by Tobias Deiminger, who deserves all the praise.
Attachment 141117, "Test file with freetext annotation without appearance stream":