[poppler] 3 commits - poppler/CairoOutputDev.cc poppler/CairoOutputDev.h poppler/GfxFont.h utils/pdffonts.1 utils/pdfimages.1 utils/pdfinfo.1 utils/pdftocairo.1 utils/pdftohtml.1 utils/pdftoppm.1 utils/pdftops.1 utils/pdftotext.1

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Aug 22 07:40:47 PDT 2011


 poppler/CairoOutputDev.cc |   12 ++++++++----
 poppler/CairoOutputDev.h  |    1 +
 poppler/GfxFont.h         |    4 ++++
 utils/pdffonts.1          |    8 +++++---
 utils/pdfimages.1         |    8 +++++---
 utils/pdfinfo.1           |    8 +++++---
 utils/pdftocairo.1        |    2 +-
 utils/pdftohtml.1         |    8 ++++++++
 utils/pdftoppm.1          |    8 +++++---
 utils/pdftops.1           |    8 +++++---
 utils/pdftotext.1         |    9 +++++----
 11 files changed, 52 insertions(+), 24 deletions(-)

New commits:
commit 82496b18dc4aff66cc29f2b6607c8f894afe8b49
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Aug 22 16:42:28 2011 +0200

    Update Adrian (C)

diff --git a/poppler/GfxFont.h b/poppler/GfxFont.h
index 9550398..fe4f7ea 100644
--- a/poppler/GfxFont.h
+++ b/poppler/GfxFont.h
@@ -20,6 +20,7 @@
 // Copyright (C) 2007 Jeff Muizelaar <jeff at infidigm.net>
 // Copyright (C) 2007 Koji Otani <sho at bbr.jp>
 // Copyright (C) 2011 Axel Strübing <axel.struebing at freenet.de>
+// Copyright (C) 2011 Adrian Johnson <ajohnson at redneon.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
commit 2576e3a6d9746e2272c620a775e11295932eb5f2
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Aug 22 21:41:36 2011 +0930

    update SEE ALSO section of man pages
    
    - ensure each man page references all other utils
    - sort list of utils in alphabetical order

diff --git a/utils/pdffonts.1 b/utils/pdffonts.1
index fd7386c..e125cfd 100644
--- a/utils/pdffonts.1
+++ b/utils/pdffonts.1
@@ -103,8 +103,10 @@ Other error.
 The pdffonts software and documentation are copyright 1996-2004 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
-.BR pdftops (1),
-.BR pdftotext (1),
+.BR pdfimages (1),
 .BR pdfinfo (1),
+.BR pdftocairo (1),
+.BR pdftohtml (1),
 .BR pdftoppm (1),
-.BR pdfimages (1),
+.BR pdftops (1),
+.BR pdftotext (1)
diff --git a/utils/pdfimages.1 b/utils/pdfimages.1
index 986a296..3f9d816 100644
--- a/utils/pdfimages.1
+++ b/utils/pdfimages.1
@@ -78,8 +78,10 @@ Other error.
 The pdfimages software and documentation are copyright 1998-2004 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
-.BR pdftops (1),
-.BR pdftotext (1),
-.BR pdfinfo (1),
 .BR pdffonts (1),
+.BR pdfinfo (1),
+.BR pdftocairo (1),
+.BR pdftohtml (1),
 .BR pdftoppm (1),
+.BR pdftops (1),
+.BR pdftotext (1)
diff --git a/utils/pdfinfo.1 b/utils/pdfinfo.1
index 1f5528a..274767e 100644
--- a/utils/pdfinfo.1
+++ b/utils/pdfinfo.1
@@ -130,8 +130,10 @@ Other error.
 The pdfinfo software and documentation are copyright 1996-2004 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
-.BR pdftops (1),
-.BR pdftotext (1),
 .BR pdffonts (1),
-.BR pdftoppm (1),
 .BR pdfimages (1),
+.BR pdftocairo (1),
+.BR pdftohtml (1),
+.BR pdftoppm (1),
+.BR pdftops (1),
+.BR pdftotext (1)
diff --git a/utils/pdftocairo.1 b/utils/pdftocairo.1
index 6c647ec..1502003 100644
--- a/utils/pdftocairo.1
+++ b/utils/pdftocairo.1
@@ -251,4 +251,4 @@ The pdftocairo software and documentation are copyright 1996-2004 Glyph
 .BR pdftohtml (1),
 .BR pdftoppm (1),
 .BR pdftops (1),
-.BR pdftotext (1),
+.BR pdftotext (1)
diff --git a/utils/pdftohtml.1 b/utils/pdftohtml.1
index 9d7e2ed..f5c6bb6 100644
--- a/utils/pdftohtml.1
+++ b/utils/pdftohtml.1
@@ -92,3 +92,11 @@ based and benefits a lot from Derek Noonburg's xpdf package.
 
 This manual page was written by Søren Boll Overgaard <boll at debian.org>,
 for the Debian GNU/Linux system (but may be used by others).
+.SH "SEE ALSO"
+.BR pdffonts (1),
+.BR pdfimages (1),
+.BR pdfinfo (1),
+.BR pdftocairo (1),
+.BR pdftoppm (1),
+.BR pdftops (1),
+.BR pdftotext (1)
diff --git a/utils/pdftoppm.1 b/utils/pdftoppm.1
index 66b985c..e84c87d 100644
--- a/utils/pdftoppm.1
+++ b/utils/pdftoppm.1
@@ -142,8 +142,10 @@ Other error.
 The pdftoppm software and documentation are copyright 1996-2004 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
-.BR pdftops (1),
-.BR pdftotext (1),
-.BR pdfinfo (1),
 .BR pdffonts (1),
 .BR pdfimages (1),
+.BR pdfinfo (1),
+.BR pdftocairo (1),
+.BR pdftohtml (1),
+.BR pdftops (1),
+.BR pdftotext (1)
diff --git a/utils/pdftops.1 b/utils/pdftops.1
index 5a7543e..d508f13 100644
--- a/utils/pdftops.1
+++ b/utils/pdftops.1
@@ -217,8 +217,10 @@ Other error.
 The pdftops software and documentation are copyright 1996-2004 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
-.BR pdftotext (1),
-.BR pdfinfo (1),
 .BR pdffonts (1),
-.BR pdftoppm (1),
 .BR pdfimages (1),
+.BR pdfinfo (1),
+.BR pdftocairo (1),
+.BR pdftohtml (1),
+.BR pdftoppm (1),
+.BR pdftotext (1)
diff --git a/utils/pdftotext.1 b/utils/pdftotext.1
index eb3aa8e..164e618 100644
--- a/utils/pdftotext.1
+++ b/utils/pdftotext.1
@@ -122,9 +122,10 @@ Other error.
 .SH AUTHOR
 The pdftotext software and documentation are copyright 1996-2004 Glyph
 & Cog, LLC.
-.SH "SEE ALSO"
-.BR pdftops (1),
-.BR pdfinfo (1),
 .BR pdffonts (1),
-.BR pdftoppm (1),
 .BR pdfimages (1),
+.BR pdfinfo (1),
+.BR pdftocairo (1),
+.BR pdftohtml (1),
+.BR pdftoppm (1),
+.BR pdftops (1)
commit 23ec5c8d394beb632ee45f6308215646cd1a0195
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Aug 22 21:26:24 2011 +0930

    cairo: only use show_text_glyphs if the surface supports it and the font has toUnicode
    
    When generating pdf output, fonts that do not have toUnicode cause an
    excessive number of empty text ActualText entries to be written due to
    glyphs that do not have have a mapping.

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index cdca10d..968788e 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -139,6 +139,7 @@ CairoOutputDev::CairoOutputDev() {
   currentFont = NULL;
   prescaleImages = gTrue;
   printing = gTrue;
+  use_show_text_glyphs = gFalse;
   inType3Char = gFalse;
   t3_glyph_has_bbox = gFalse;
 
@@ -579,6 +580,9 @@ void CairoOutputDev::updateFont(GfxState *state) {
 
   font_face = currentFont->getFontFace();
   cairo_set_font_face (cairo, font_face);
+
+  use_show_text_glyphs = state->getFont()->hasToUnicodeCMap() &&
+    cairo_surface_has_show_text_glyphs (cairo_get_target (cairo));
  
   double fontSize = state->getFontSize();
   double *m = state->getTextMat();
@@ -1051,7 +1055,7 @@ void CairoOutputDev::beginString(GfxState *state, GooString *s)
 
   glyphs = (cairo_glyph_t *) gmallocn (len, sizeof (cairo_glyph_t));
   glyphCount = 0;
-  if (printing) {
+  if (use_show_text_glyphs) {
     clusters = (cairo_text_cluster_t *) gmallocn (len, sizeof (cairo_text_cluster_t));
     clusterCount = 0;
     utf8Max = len*2; // start with twice the number of glyphs. we will realloc if we need more.
@@ -1070,7 +1074,7 @@ void CairoOutputDev::drawChar(GfxState *state, double x, double y,
     glyphs[glyphCount].x = x - originX;
     glyphs[glyphCount].y = y - originY;
     glyphCount++;
-    if (printing) {
+    if (use_show_text_glyphs) {
       if (utf8Max - utf8Count < uLen*6) {
         // utf8 encoded characters can be up to 6 bytes
 	if (utf8Max > uLen*6)
@@ -1120,7 +1124,7 @@ void CairoOutputDev::endString(GfxState *state)
   if (!(render & 1) && !haveCSPattern) {
     LOG (printf ("fill string\n"));
     cairo_set_source (cairo, fill_pattern);
-    if (printing)
+    if (use_show_text_glyphs)
       cairo_show_text_glyphs (cairo, utf8, utf8Count, glyphs, glyphCount, clusters, clusterCount, (cairo_text_cluster_flags_t)0);
     else
         cairo_show_glyphs (cairo, glyphs, glyphCount);
@@ -1168,7 +1172,7 @@ void CairoOutputDev::endString(GfxState *state)
 
   gfree (glyphs);
   glyphs = NULL;
-  if (printing) {
+  if (use_show_text_glyphs) {
     gfree (clusters);
     clusters = NULL;
     gfree (utf8);
diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h
index b8c0703..ca64ad5 100644
--- a/poppler/CairoOutputDev.h
+++ b/poppler/CairoOutputDev.h
@@ -314,6 +314,7 @@ protected:
   cairo_matrix_t orig_matrix;
   GBool needFontUpdate;                // set when the font needs to be updated
   GBool printing;
+  GBool use_show_text_glyphs;
   cairo_surface_t *surface;
   cairo_glyph_t *glyphs;
   int glyphCount;
diff --git a/poppler/GfxFont.h b/poppler/GfxFont.h
index 09af062..9550398 100644
--- a/poppler/GfxFont.h
+++ b/poppler/GfxFont.h
@@ -221,6 +221,9 @@ public:
 			  Unicode **u, int *uLen,
 			  double *dx, double *dy, double *ox, double *oy) = 0;
 
+  // Does this font have a toUnicode map?
+  GBool hasToUnicodeCMap() { return hasToUnicode; }
+
   /* XXX: dfp shouldn't be public, however the font finding code is currently in
    * GlobalParams. Instead it should be inside the GfxFont class. However,
    * getDisplayFont currently uses FCcfg so moving it is not as simple. */


More information about the poppler mailing list