Summary: | Evince freezes when selecting text from specific pdf documents | ||
---|---|---|---|
Product: | poppler | Reporter: | Germán Poo-Caamaño <gpoo+bfdo> |
Component: | cairo backend | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | carlosgc, jason |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
URL: | https://bugzilla.gnome.org/show_bug.cgi?id=659730 | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
PDF test case
Set text matrix when painting selection Screenshot showing the issue with text selected |
Description
Germán Poo-Caamaño
2013-02-18 08:12:46 UTC
I forgot to mention: I tested with poppler-glib-demo from df3556240 (master) and cairo 1.12.14 (0dac37c41). Probably a duplicate of https://bugs.freedesktop.org/show_bug.cgi?id=54939 Created attachment 76226 [details] [review] Set text matrix when painting selection The freezing is cairo allocating huge surfaces because the font size and matrix are scaled too large. This patch saves the current transformation matrix so it can be applied when the selection is painted. By the way, does anybody else think we should just deprecate the glib frontend's poppler_page_render_selection function and have evince use poppler_page_get_selected_region and draw the selection boxes itself? The only advantage I can think of for the current method is that we can change the color of the text when it is selected, but I'm not sure that is worth the trouble. Any comments on this patch? Carlos seems to be quite busy lately, any other of the glib guys around? While with this patch, evince no longers tries to allocate huges amounts of memory (and hence it no longer freezes), the rendering of the selection still seems broken (in my testing). Jason, do you get good selection after applying your patch with the test case proposed by Germán? Created attachment 76923 [details]
Screenshot showing the issue with text selected
(In reply to comment #7) > While with this patch, evince no longers tries to allocate huges amounts of > memory (and hence it no longer freezes), the rendering of the selection > still seems broken (in my testing). Jason, do you get good selection after > applying your patch with the test case proposed by Germán? José, The rendering of the selection could be an issue with Type3 fonts. See https://bugs.freedesktop.org/show_bug.cgi?id=54939 and compare with the screenshot I attached on this bug. *** Bug 54945 has been marked as a duplicate of this bug. *** So the problem is not with the patch, but with the fact that for the test case, the Text output is completely broken... Just run pdftotext on the test case to see what I mean. So the missing glyphs are just because in the "text detected" by poppler, there is a space! and since we visit words to render selections, it just does not work... That means that I think that the patch is doing the right thing, and fixing the fact that the text in the test case should give us good selections for this file. (In reply to comment #11) > So the problem is not with the patch, but with the fact that for the test > case, the Text output is completely broken... Just run pdftotext on the test > case to see what I mean. So the missing glyphs are just because in the "text > detected" by poppler, there is a space! and since we visit words to render > selections, it just does not work... > > That means that I think that the patch is doing the right thing, and fixing > the fact that the text in the test case should give us good selections for > this file. I do not disagree with you. I am only saying there are two different bugs. The one related with slowness (and memory) and one related with the glyphs shown when the text is selected. This bug is about the former. The latter, I think, is related to https://bugs.freedesktop.org/show_bug.cgi?id=12980 and/or https://bugs.freedesktop.org/show_bug.cgi?id=60243 (see comment 4). IMVHO, the patch fixes this particular bug (slowness and memory). (In reply to comment #12) > [...] > This bug is about the former. The latter, I think, is related to > https://bugs.freedesktop.org/show_bug.cgi?id=12980 and/or > https://bugs.freedesktop.org/show_bug.cgi?id=60243 (see comment 4). Here I meant: https://bugs.freedesktop.org/show_bug.cgi?id=60243#c4 All these bugs with ugly text selection have in common Type3 fonts. I agree they are different bugs, the patch looks good, I've just pushed it to both branches. Sorry for delay reviewing it. *** Bug 12980 has been marked as a duplicate of this bug. *** |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.