[poppler] patch: Use error() instead of fprintf(stderr, ...) in Annot::layoutText

Fabio D'Urso fabiodurso at hotmail.it
Wed May 9 10:31:28 PDT 2012


Currently, Annot::layoutText outputs a warning to stderr when it doesn't know 
how to print a Unicode character, bypassing centralized error() handling.

Patch 0001 fixes it, but with this patch only, character codes cannot be 
printed in upper case any more (because GooString formatting doesn't implement 
uppercase digits):
  AnnotWidget::layoutText, cannot convert U+03c6

With a quick search, it seems that the U+ convention is to always print 
uppercase hex digits.

Patch 0002 (to be applied on top of patch 0001) adds support to output 
uppercase hexadecimal digits (adding a new 'X' suffix to GooString formatting 
routines) and patches Annot::layoutText again to use the new suffix. This is 
the final output:
  AnnotWidget::layoutText, cannot convert U+03C6

To trigger the warning: pick any document with forms and add unusual 
characters (eg www.irs.gov/pub/irs-pdf/fw4.pdf and φ U+03C6)

Fabio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-error-instead-of-fprintf-stderr-.-in-Annot-layou.patch
Type: text/x-patch
Size: 825 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20120509/4e713786/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-GooString-formatting-add-support-for-uppercase-hexad.patch
Type: text/x-patch
Size: 10678 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20120509/4e713786/attachment-0001.bin>


More information about the poppler mailing list