<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">This problem is not solvable, at least
      not completely:<br>
      <br>
      1. You draw a stave with graphical operators<br>
      2. You draw stave notes as glyphs of a font.<br>
      3. You render it to an image with in this case much too low
      resolution (141.146 dpi)<br>
      <br>
      So we have here either splash or cairo (for drawing the stave) and
      freetype (for drawing the glyphs) which draw it to an image
      without having pixel boundaries.<br>
      <br>
      This problem was discussed a lot of times also in the bug reports,
      s. i.e. <a class="moz-txt-link-freetext" href="https://bugs.freedesktop.org/show_bug.cgi?id=37347">https://bugs.freedesktop.org/show_bug.cgi?id=37347</a><br>
      <br>
      If anyone is able to develop a pixel scissors I would take a
      deeper look into it (and would nominate him to get a Nobel Prize J
      ), in the meantime I would advice to take a much higher resolution
      when render it to an image (at least 300 dpi)<br>
      <br>
      Cheers,<br>
      Thomas<br>
      <br>
      Am 26.03.2017 um 22:11 schrieb William Bader:<br>
    </div>
    <blockquote
cite="mid:CO2PR15MB009203E17B5FFFDB07272D5AC4300@CO2PR15MB0092.namprd15.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
        dir="ltr">
        <p>When I open the test PDF in atril (the Mate desktop version
          of evince) and change the window size (with 'fit page width'),
          once I get below about 80%, small changes make the bars of the
          staff go up and down, and not all of the bars of the
          staff shift equally, so the space between the bars is not
          equal, and that might contribute to the effect that the notes
          are misplaced. I am not sure, but it seems as if it is not
          antialiasing the bars. When you reduce the image to the point
          where pixels are significant and the total number of pixels is
          not the exact amount to leave the same number of pixels
          between each bar, rounding can't create more pixels. You need
          to simulate fractional pixels through antialiasing. The 'w'
          command in PDF sets the line width. It looks like it is
          drawing lines of 0.4, 0.65, 0.8, and 1 point. The tests for <span>thinLineMode
            are in splash/Splash.cc.</span></p>
        <p><span><br>
          </span></p>
        <p><span>William</span></p>
        <p><span><br>
          </span></p>
        <div style="color: rgb(0, 0, 0);">
          <div>
            <hr tabindex="-1" style="display:inline-block; width:98%">
            <div id="x_divRplyFwdMsg" dir="ltr"><font
                style="font-size:11pt" color="#000000" face="Calibri,
                sans-serif"><b>From:</b> poppler
                <a class="moz-txt-link-rfc2396E" href="mailto:poppler-bounces@lists.freedesktop.org"><poppler-bounces@lists.freedesktop.org></a> on behalf
                of <a class="moz-txt-link-abbreviated" href="mailto:pqt@LEFerguson.com">pqt@LEFerguson.com</a> <a class="moz-txt-link-rfc2396E" href="mailto:pqt@LEFerguson.com"><pqt@LEFerguson.com></a><br>
                <b>Sent:</b> Sunday, March 26, 2017 12:34 PM<br>
                <b>To:</b> Albert Astals Cid;
                <a class="moz-txt-link-abbreviated" href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
                <b>Subject:</b> Re: [poppler] Scaling factor and
                placement accuracy</font>
              <div> </div>
            </div>
          </div>
          <font size="2"><span style="font-size:10pt;">
              <div class="PlainText">>>
ourParent->document->setRenderHint(Poppler::Document::Antialiasing);<br>
                >>
ourParent->document->setRenderHint(Poppler::Document::TextAntialiasing<br>
>>ourParent->document->setRenderHint(Poppler::Document::ThinLineSolid);<br>
                <br>
                >Tried thin line shape instead of thing line solid?<br>
                <br>
                Thanks, Albert, I just tried it, same result.<br>
                <br>
                I spent a couple hours last night trying to find the
                area of code that does the actual placement without any
                real luck, to see if there is any kind of rounding
                issue.   I saw a lot of other possible areas like
                anti-aliasing, but basically got lost in the code
                because I don't know enough to know what is actually
                inside the PDF (I tried PDFStreamDumper and can see
                what's inside, and even seeing it I do not understand
                it).
                <br>
                <br>
                So far making the x/y scale factor integral appears to
                avoid the problem; it's hard to prove a negative, but I
                have not seen it occur in that case. This just very
                slightly throws off the desired size I want, and I just
                needed to put a proper color border into the overall
                page to avoid showing an outline, so it's very workable
                for what I want, if it keeps working.<br>
                <br>
                Thanks again,<br>
                <br>
                Linwood<br>
                _______________________________________________<br>
                poppler mailing list<br>
                <a class="moz-txt-link-abbreviated" href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
                <a moz-do-not-send="true"
                  href="https://lists.freedesktop.org/mailman/listinfo/poppler"
                  id="LPlnk715584" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/poppler</a>
                <div id="LPBorder_GT_14905575915020.8702532464665824"
                  style="margin-bottom: 20px; overflow: auto; width:
                  100%; text-indent: 0px;">
                  <table
                    id="LPContainer_14905575914990.9612005051317651"
                    role="presentation" style="width: 90%;
                    background-color: rgb(255, 255, 255); position:
                    relative; overflow: auto; padding-top: 20px;
                    padding-bottom: 20px; margin-top: 20px; border-top:
                    1px dotted rgb(200, 200, 200); border-bottom: 1px
                    dotted rgb(200, 200, 200);" cellspacing="0">
                    <tbody>
                      <tr style="border-spacing: 0px;" valign="top">
                        <td
                          id="TextCell_14905575915000.8425488913535857"
                          colspan="2" style="vertical-align: top;
                          position: relative; padding: 0px; display:
                          table-cell;">
                          <div
                            id="LPTitle_14905575915000.7746580093890942"
                            style="top: 0px; color: rgb(0, 120, 215);
                            font-weight: normal; font-size: 21px;
                            font-family: wf_segoe-ui_light, "Segoe
                            UI Light", "Segoe WP Light",
                            "Segoe UI", "Segoe WP",
                            Tahoma, Arial, sans-serif; line-height:
                            21px;">
                            <a moz-do-not-send="true"
                              id="LPUrlAnchor_14905575915000.7762204401673523"
href="https://lists.freedesktop.org/mailman/listinfo/poppler"
                              target="_blank" style="text-decoration:
                              none;">poppler Info Page - freedesktop.org</a></div>
                          <div
                            id="LPMetadata_14905575915010.035493496038826455"
                            style="margin: 10px 0px 16px; color:
                            rgb(102, 102, 102); font-weight: normal;
                            font-family: wf_segoe-ui_normal, "Segoe
                            UI", "Segoe WP", Tahoma,
                            Arial, sans-serif; font-size: 14px;
                            line-height: 14px;">
                            lists.freedesktop.org</div>
                          <div
                            id="LPDescription_14905575915010.7732279886137667"
                            style="display: block; color: rgb(102, 102,
                            102); font-weight: normal; font-family:
                            wf_segoe-ui_normal, "Segoe UI",
                            "Segoe WP", Tahoma, Arial,
                            sans-serif; font-size: 14px; line-height:
                            20px; max-height: 100px; overflow: hidden;">
                            Subscribing to poppler: Subscribe to poppler
                            by filling out the following form. You will
                            be sent email requesting confirmation, to
                            prevent others from ...</div>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </div>
                <br>
                <br>
              </div>
            </span></font></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
poppler mailing list
<a class="moz-txt-link-abbreviated" href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/poppler">https://lists.freedesktop.org/mailman/listinfo/poppler</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>