1. 24 Oct, 2018 3 commits
  2. 23 Oct, 2018 1 commit
  3. 09 Oct, 2018 1 commit
  4. 05 Oct, 2018 2 commits
  5. 02 Oct, 2018 1 commit
  6. 01 Oct, 2018 1 commit
  7. 27 Sep, 2018 2 commits
    • Federico Mena Quintero's avatar
      (#349): Don't panic when loading an external image that is bigger than Cairo's limits · 4386196b
      Federico Mena Quintero authored
      We were failing to return a GError, and the Rust code panicked in
      from_glib_full(error), as error = NULL then.
      
      #349
      4386196b
    • 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
      pango_cairo_context_set_resolution().
      
      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
      inches.
      
      This commit also regenerates 310-font-size-at-48dpi-ref.png - it is
      the only other file that uses absolute font sizes.
      
      #348
      dc4f5845
  8. 26 Sep, 2018 2 commits
  9. 25 Sep, 2018 4 commits
  10. 24 Sep, 2018 2 commits
    • Federico Mena Quintero's avatar
      (#344): Don't let a viewBox with overflowing numbers pass through · 7b440303
      Federico Mena Quintero authored
      This commit adds expect_finite_number() and finite_f32() to parsers.rs.
      
      Part of issue #344 is that we need to validate parsed numbers, as
      cssparser can give us back -inf or inf when it overflows.  These
      values ripple down the code and end up creating a NaN inside a
      cairo::Matrix, which makes it invalid.
      
      This commit introduces a CssParserExt trait to have an
      expect_finite_number() method for cssparser::Parser, and the
      corresponding, low-level finite_f32() validation function.
      
      Those functions return a Result<f32, ValueErrorKind>.  This commit
      makes the following return a ValueErrorKind for the error case as
      well:
      
      * impl Parse for f64
      * parsers::number()
      * parsers::number_optional_number()
      * parsers:;integer()
      * parsers::integer_optional_integer()
      
      This has implications in all the callers, since they used to expect a
      ParseError, but must now expect ValueErrorKind.
      
      The biggest change is in transform.rs.  For simplicity, the individual
      parsers for transform functions now have two sections:  the first
      extracts f32 from cssparser::Parser, and the second validates those
      numbers and computes the final result --- instead of doing everything
      at the same time.
      
      #344
      7b440303
    • Federico Mena Quintero's avatar
      1b1fba9d
  11. 21 Sep, 2018 2 commits
  12. 20 Sep, 2018 1 commit
  13. 18 Sep, 2018 6 commits
  14. 13 Sep, 2018 2 commits
  15. 31 Aug, 2018 1 commit
  16. 28 Aug, 2018 1 commit
  17. 27 Aug, 2018 1 commit
  18. 23 Aug, 2018 1 commit
  19. 21 Aug, 2018 2 commits
  20. 31 Jul, 2018 1 commit
  21. 24 Jul, 2018 2 commits
  22. 22 Jul, 2018 1 commit