<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [PATCH] Add support for TextMarkup Annotations in glib frontend"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=51487#c27">Comment # 27</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [PATCH] Add support for TextMarkup Annotations in glib frontend"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=51487">bug 51487</a>
              from <span class="vcard"><a class="email" href="mailto:carlosgc@gnome.org" title="Carlos Garcia Campos <carlosgc@gnome.org>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=51487#c24">comment #24</a>)
<span class="quote">> Created <span class=""><a href="attachment.cgi?id=88275" name="attach_88275" title="Screenghost that shows the difference between cairo and a list of rectangles">attachment 88275</a> <a href="attachment.cgi?id=88275&action=edit" title="Screenghost that shows the difference between cairo and a list of rectangles">[details]</a></span>
> Screenghost that shows the difference between cairo and a list of rectangles

> The demo add two implementations to set the Quadrilaterals.  Using
> cairo_region_t or getting a GList of rectangles.

> For the GList of rectangles I use a deprecated function of poppler-glib: 
> poppler_page_get_selection_region() that deprecated in favor of
> poppler_page_get_selected_region().</span >

Maye text layout would be more appropriate than selected_region. We could add
poppler_page_get_text_layout_for_rectangle as we discussed in the mailing list,
so that you can pass the bbox of the annotations, and then you can build the
list of lines. Or even a more convenient method that returns the list of lines
instad of characters.

<span class="quote">> In the screenshot it is possible to see the difference of both
> implementations:
> * With the GList we get one rectangle per line and it is rendered
>   with small rectangles with small rounding ends.
> * With cairo_region_t we get only 2 rectangles, making one huge rounding ends
>   and one smaller.</span >

Yes, it's clear we really want the list of rectangles.

<span class="quote">> The issue with cairo_region_t is exacerbated when using underline, squiggly
> or strikeout.  Because those are rendered per rectangle. So, instead of
> having every line underline or strikeout, there one big underline for the
> big rectangle.

> Anyhow, you can try the patch setting cairo = TRUE|FALSE inside
> pgd_annots_update_selected_text().</span ></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>