
function arrayDiffer(a, b) {
    if (!a || !b) {
        return true;
    }
    if (a.length !== b.length) {
        return true;
    }
    for (let i = 0; i < a.length; i++) {
        if (a[i] !== b[i]) {
            return true;
        }
    }
    return false;
}

function fontDiffer(a, b) {
    if (a === b) {
        return false;
    }

    return a.fontSize !== b.fontSize ||
        a.fontFamily !== b.fontFamily ||
        a.fontStyle !== b.fontStyle ||
        a.fontWeight !== b.fontWeight ||
        a.kerning !== b.kerning ||
        a.wordSpacing !== b.wordSpacing ||
        a.letterSpacing !== b.letterSpacing;
}

const ViewBoxAttributes = {
    minX: true,
    minY: true,
    vbWidth: true,
    vbHeight: true,
    align: true,
    meetOrSlice: true
};

const NodeAttributes = {
    name: true,
    matrix: {
        diff: arrayDiffer
    },
    scaleX: true,
    scaleY: true,
    opacity: true,
    clipRule: true,
    clipPath: true,
    propList: {
        diff: arrayDiffer
    },
    responsible: true
};

const FillAndStrokeAttributes = {
    fill: {
        diff: arrayDiffer
    },
    fillOpacity: true,
    fillRule: true,
    stroke: {
        diff: arrayDiffer
    },
    strokeOpacity: true,
    strokeWidth: true,
    strokeLinecap: true,
    strokeLinejoin: true,
    strokeDasharray: {
        diff: arrayDiffer
    },
    strokeDashoffset: true,
    strokeMiterlimit: true
};

const RenderableAttributes = {
    ...NodeAttributes,
    ...FillAndStrokeAttributes
};

const GroupAttributes = {
    font: {
        diff: fontDiffer
    },
    ...RenderableAttributes
};

const UseAttributes = {
    href: true,
    width: true,
    height: true,
    ...RenderableAttributes
};

const SymbolAttributes = {
    name: true,
    ...ViewBoxAttributes
};

const PathAttributes = {
    d: true,
    ...RenderableAttributes
};

const TextAttributes = {
    font: {
        diff: fontDiffer
    },
    textAnchor: true,
    textDecoration: true,
    deltaX: arrayDiffer,
    deltaY: arrayDiffer,
    rotate: arrayDiffer,
    positionX: true,
    positionY: true,
    ...RenderableAttributes
};

const TextPathAttributes = {
    href: true,
    method: true,
    spacing: true,
    startOffset: true,
    ...RenderableAttributes
};

const TSpanAttibutes = {
    content: true,
    ...TextAttributes
};

const ClipPathAttributes = {
    name: true
};

const GradientAttributes = {
    gradient: {
        diff: arrayDiffer
    },
    gradientUnits: true,
    gradientTransform: {
        diff: arrayDiffer
    },
    ...ClipPathAttributes
};

const LinearGradientAttributes = {
    x1: true,
    y1: true,
    x2: true,
    y2: true,
    ...GradientAttributes
};

const RadialGradientAttributes = {
    fx: true,
    fy: true,
    rx: true,
    ry: true,
    cx: true,
    cy: true,
    r: true,
    ...GradientAttributes
};


const CircleAttributes = {
    cx: true,
    cy: true,
    r: true,
    ...RenderableAttributes
};

const EllipseAttributes = {
    cx: true,
    cy: true,
    rx: true,
    ry: true,
    ...RenderableAttributes
};

const ImageAttributes = {
    x: true,
    y: true,
    width: true,
    height: true,
    src: true,
    align: true,
    meetOrSlice: true,
    ...RenderableAttributes
};

const LineAttributes = {
    x1: true,
    y1: true,
    x2: true,
    y2: true,
    ...RenderableAttributes
};

const RectAttributes = {
    x: true,
    y: true,
    width: true,
    height: true,
    rx: true,
    ry: true,
    ...RenderableAttributes
};

export {
    PathAttributes,
    TextAttributes,
    TSpanAttibutes,
    TextPathAttributes,
    GroupAttributes,
    ClipPathAttributes,
    CircleAttributes,
    EllipseAttributes,
    ImageAttributes,
    LineAttributes,
    RectAttributes,
    UseAttributes,
    SymbolAttributes,
    LinearGradientAttributes,
    RadialGradientAttributes,
    ViewBoxAttributes
};

@@ -353,17 +353,28 @@
 urn 
+(%0A        
 a.fontS
-iz
+tyl
 e !=
@@ -386,10 +386,11 @@
 ontS
-iz
+tyl
 e %7C%7C
@@ -404,22 +404,23 @@
   a.font
-Family
+Variant
  !== b.f
@@ -426,14 +426,56 @@
 font
-Family
+Variant %7C%7C%0A        a.fontWeight !== b.fontWeight
  %7C%7C%0A
@@ -482,35 +482,37 @@
         a.fontSt
-yle
+retch
  !== b.fontStyle
@@ -500,35 +500,37 @@
 tch !== b.fontSt
-yle
+retch
  %7C%7C%0A        a.fo
@@ -535,63 +535,202 @@
 font
-Weight !== b.fontWeight %7C%7C%0A        a.kerning !== b.kern
+Size !== b.fontSize %7C%7C%0A        a.fontFamily !== b.fontFamily %7C%7C%0A        a.textAnchor !== b.textAnchor %7C%7C%0A        a.textDecoration !== b.textDecoration %7C%7C%0A        a.letterSpacing !== b.letterSpac
 ing 
@@ -789,41 +789,35 @@
   a.
-letterSpacing !== b.letterSpacing
+kerning !== b.kerning%0A    )
 ;%0A%7D%0A

Fix fontDiffer