diff --git a/rsvg-css.c b/rsvg-css.c
index e988ce5..1ac460e 100644
--- a/rsvg-css.c
+++ b/rsvg-css.c
@@ -94,7 +94,7 @@ typedef enum _RelativeSize {
 
 static double
 rsvg_css_parse_raw_length (const char *str, gint * in,
-                           gint * percent, gint * em, gint * ex, RelativeSize * relative_size)
+                           gint * percent, gint * em, gint * ex, double *fraction, RelativeSize * relative_size)
 {
     double length = 0.0;
     char *p = NULL;
@@ -119,6 +119,7 @@ rsvg_css_parse_raw_length (const char *str, gint * in,
     if (p && *p && (strcmp (p, "px") != 0)) {
         if (!strcmp (p, "pt")) {
             length /= POINTS_PER_INCH;
+            *fraction = 1 / POINTS_PER_INCH;
             *in = TRUE;
         } else if (!strcmp (p, "in"))
             *in = TRUE;
@@ -130,6 +131,7 @@ rsvg_css_parse_raw_length (const char *str, gint * in,
             *in = TRUE;
         } else if (!strcmp (p, "pc")) {
             length /= PICA_PER_INCH;
+            *fraction = 1 / PICA_PER_INCH;
             *in = TRUE;
         } else if (!strcmp (p, "em"))
             *em = TRUE;
@@ -137,6 +139,7 @@ rsvg_css_parse_raw_length (const char *str, gint * in,
             *ex = TRUE;
         else if (!strcmp (p, "%")) {
             *percent = TRUE;
+            *fraction = 0.01;
             length *= 0.01;
         } else {
             double pow_factor = 0.0;
@@ -166,6 +169,7 @@ rsvg_css_parse_raw_length (const char *str, gint * in,
             }
 
             length = 12.0 * pow (1.2, pow_factor) / POINTS_PER_INCH;
+            *fraction = 1 / POINTS_PER_INCH;
             *in = TRUE;
         }
     }
@@ -179,9 +183,11 @@ _rsvg_css_parse_length (const char *str)
     RsvgLength out;
     gint percent, em, ex, in;
     RelativeSize relative_size = RELATIVE_SIZE_NORMAL;
+    double fraction = 1.0;
     percent = em = ex = in = FALSE;
 
-    out.length = rsvg_css_parse_raw_length (str, &in, &percent, &em, &ex, &relative_size);
+    out.length = rsvg_css_parse_raw_length (str, &in, &percent, &em, &ex, &fraction, &relative_size);
+    out.fraction = fraction;
     if (percent)
         out.factor = 'p';
     else if (em)
@@ -252,9 +258,21 @@ _rsvg_css_hand_normalize_length (const RsvgLength * in, gdouble pixels_per_inch,
     return 0;
 }
 
+/*
+ * _rsvg_css_hand_normalize_length_sub:
+ * @in:
+ * @length:
+ * @pixels_per_inch:
+ * @width_or_height:
+ * @font_size:
+ *
+ * Returns:
+ */
 double
-_rsvg_css_hand_normalize_length_sub (const RsvgLength * in, gdouble length, 
-				     gdouble pixels_per_inch, gdouble width_or_height, 
+_rsvg_css_hand_normalize_length_sub (const RsvgLength * in,
+                                     gdouble length, 
+				     gdouble pixels_per_inch,
+                                     gdouble width_or_height,
 				     gdouble font_size)
 {
     if (in->factor == '\0')
@@ -266,8 +284,8 @@ _rsvg_css_hand_normalize_length_sub (const RsvgLength * in, gdouble length,
     else if (in->factor == 'x')
         return length * font_size / 2.;
     else if (in->factor == 'i')
-        return length * pixels_per_inch;
+        return length * in->fraction * pixels_per_inch;
 
     return 0;
 }
 
diff --git a/rsvg-private.h b/rsvg-private.h
index aa883db..369d71c 100644
--- a/rsvg-private.h
+++ b/rsvg-private.h
@@ -213,6 +213,7 @@ struct RsvgRender {
 
 typedef struct {
     double length;
+    double fraction;
     char factor;
 } RsvgLength;
 

