1. 01 Oct, 2018 1 commit
  2. 27 Sep, 2018 2 commits
    • Federico Mena Quintero's avatar
      (#348): Fix incorrect font sizing · dc4f5845
      Federico Mena Quintero authored
      Pango considers the font size in a PangoFontDescription to be in
      points, and it converts to pixels by using the resolution set in
      However, we were passing our plainly normalized Length values to
      pango::FontDescription::set_size(), i.e. we were passing them in
      pixels, not points.  Thus, Pango was applying extra scaling, and
      messing up the final size.
      This commit hardcodes a value of 72.0 for Pango's resolution.  This is
      so that it will not apply any extra scaling on top of our
      computations.  We are doing the inches-to-pixels conversion, instead
      of letting Pango do it.
      This commit adds 348-font-size-48dpi.svg which two pairs of squares
      and text elements, which should both render at the same size:  one
      pair is done in userspace pixels, and the other pair is done in
      This commit also regenerates 310-font-size-at-48dpi-ref.png - it is
      the only other file that uses absolute font sizes.
    • Federico Mena Quintero's avatar
      DrawingCtx.get_pango_context() - Use dpi_y for the Pango context's resolution · 611d74f2
      Federico Mena Quintero authored
      Seems like a typo from the initial Rustification.
  3. 25 Sep, 2018 3 commits
  4. 24 Sep, 2018 3 commits
  5. 21 Sep, 2018 2 commits
    • Federico Mena Quintero's avatar
      (#341): Don't infinite-loop with cyclic pattern references · 011dca9a
      Federico Mena Quintero authored
      In each loop iteration in resolve_pattern() we drop the AcquiredNode,
      and so we can't use the implicit stack of acquired nodes to test for
      This commit introduces a NodeStack helper, which code can use to catch
      reference cycles explicitly.
      We also have new test program for files that cause infinite loops.
    • Federico Mena Quintero's avatar
      filters::render() - Take the computed values of the node being filtered, not the whole node · 580beabe
      Federico Mena Quintero authored
      Some time soon I want to merge Artem Vorotnikov's work to replace the
      ubiquitous Rc<Node> with a Rc<NodeTrait>, to have a "real" inheritance
      scheme rather our awkward node.with_impl().
      In the meantime, it turns out that the filters code doesn't need the
      actual node that is being filtered; just a set of computed values to
      pass around while rendering the filter.  So, let's do that.
  6. 19 Sep, 2018 2 commits
  7. 12 Sep, 2018 1 commit
  8. 05 Sep, 2018 9 commits
  9. 03 Sep, 2018 2 commits
  10. 27 Aug, 2018 1 commit
  11. 21 Aug, 2018 2 commits
    • Federico Mena Quintero's avatar
      gitlab#323 - Limit the number of instancings through the <use> element · a9ca82a5
      Federico Mena Quintero authored
      A pathological SVG file can do this:
          <rect id="foo" .../>
          <g id="foo1">
            <use xlink:href="#foo"/>
            ... repeat 10 times ...
          <g id="foo2">
              <use xlink:href="#foo1"/>
              ... repeat 10 times ...
          <g id="foo3">
              <use xlink:href="#foo2"/>
              ... repeat 10 times ...
          ... etc ...
        <use xlink:href="#foo17"/>
      This would cause about 10^17 objects to be rendered.  While this does
      not exhaust memory (the objects are not instanced in memory), it would
      take a really long time to render that many objects.
      So, we now have a limit on up to 500,000 objects instanced through
      <use>.  We can tweak this limit later, or the way in which it is
      computed; the point is that we can now detect this situation and
      propagate an error upstream.
    • Federico Mena Quintero's avatar
      Propagate RenderingError up to the Node.draw() methods · a762912f
      Federico Mena Quintero authored
      This touches most of the code for the "obvious" places where rendering
      errors should be propagated.  It does not yet handle all the places
      where Cairo errors could occur.
  12. 20 Aug, 2018 3 commits
  13. 13 Aug, 2018 1 commit
  14. 01 Aug, 2018 1 commit
  15. 31 Jul, 2018 1 commit
  16. 29 Jul, 2018 2 commits
  17. 12 Jul, 2018 1 commit
  18. 11 Jul, 2018 2 commits
  19. 09 Jul, 2018 1 commit