[Poppler-bugs] [Bug 33269] Expose text attributes in glib interface

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jan 29 04:27:26 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=33269

--- Comment #2 from Carlos Garcia Campos <carlosgc at gnome.org> 2011-01-29 04:27:27 PST ---
Review of attachment 42440:
 --> (https://bugs.freedesktop.org/review?bug=33269&attachment=42440)

We don't want to add a pango dependency, so I think we could create a
PopplerTextInfo object containing the text attributes as exposed by the poppler
core API.

::: glib/poppler-page.cc
@@ +2220,3 @@
+ * Return value: %TRUE if the page contains text, %FALSE otherwise
+ *
+ * Since: 0.16

This should be 0.18

@@ +2252,3 @@
+    {
+      word = wordlist->get (i);
+      *n_attributes += word->getLength () + 1;

Since text attributes are per word, why don't we return a list of words instead
of a list of characters?

@@ +2288,3 @@
+      word->getColor (&r, &g, &b);
+      color_attr = pango_attr_foreground_new ((int)(r * 65535), (int)(g *
65535), (int)(b * 65535));
+

I guess that in most of the cases a lot of words will share the text
attributes, I think we could use a cache and simply add a reference to the
existing text attrs objects to avoid duplicating the same info all the time.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list