OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 26 matching lines...) Expand all Loading... | |
37 PassRefPtr<SVGVKernElement> SVGVKernElement::create(const QualifiedName& tagName , Document* document) | 37 PassRefPtr<SVGVKernElement> SVGVKernElement::create(const QualifiedName& tagName , Document* document) |
38 { | 38 { |
39 return adoptRef(new SVGVKernElement(tagName, document)); | 39 return adoptRef(new SVGVKernElement(tagName, document)); |
40 } | 40 } |
41 | 41 |
42 Node::InsertionNotificationRequest SVGVKernElement::insertedInto(ContainerNode* rootParent) | 42 Node::InsertionNotificationRequest SVGVKernElement::insertedInto(ContainerNode* rootParent) |
43 { | 43 { |
44 if (rootParent->inDocument()) { | 44 if (rootParent->inDocument()) { |
45 ContainerNode* fontNode = parentNode(); | 45 ContainerNode* fontNode = parentNode(); |
46 if (fontNode && fontNode->hasTagName(SVGNames::fontTag)) { | 46 if (fontNode && fontNode->hasTagName(SVGNames::fontTag)) { |
47 if (SVGFontElement* element = static_cast<SVGFontElement*>(fontNode) ) | 47 if (SVGFontElement* element = toSVGFontElement(fontNode)) |
tkent
2013/07/06 06:14:37
Ditto.
| |
48 element->invalidateGlyphCache(); | 48 element->invalidateGlyphCache(); |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 return SVGElement::insertedInto(rootParent); | 52 return SVGElement::insertedInto(rootParent); |
53 } | 53 } |
54 | 54 |
55 void SVGVKernElement::removedFrom(ContainerNode* rootParent) | 55 void SVGVKernElement::removedFrom(ContainerNode* rootParent) |
56 { | 56 { |
57 ContainerNode* fontNode = parentNode(); | 57 ContainerNode* fontNode = parentNode(); |
58 if (fontNode && fontNode->hasTagName(SVGNames::fontTag)) { | 58 if (fontNode && fontNode->hasTagName(SVGNames::fontTag)) { |
59 if (SVGFontElement* element = static_cast<SVGFontElement*>(fontNode)) | 59 if (SVGFontElement* element = toSVGFontElement(fontNode)) |
tkent
2013/07/06 06:14:37
Ditto.
| |
60 element->invalidateGlyphCache(); | 60 element->invalidateGlyphCache(); |
61 } | 61 } |
62 SVGElement::removedFrom(rootParent); | 62 SVGElement::removedFrom(rootParent); |
63 } | 63 } |
64 | 64 |
65 void SVGVKernElement::buildVerticalKerningPair(KerningPairVector& kerningPairs) | 65 void SVGVKernElement::buildVerticalKerningPair(KerningPairVector& kerningPairs) |
66 { | 66 { |
67 String u1 = fastGetAttribute(SVGNames::u1Attr); | 67 String u1 = fastGetAttribute(SVGNames::u1Attr); |
68 String g1 = fastGetAttribute(SVGNames::g1Attr); | 68 String g1 = fastGetAttribute(SVGNames::g1Attr); |
69 String u2 = fastGetAttribute(SVGNames::u2Attr); | 69 String u2 = fastGetAttribute(SVGNames::u2Attr); |
70 String g2 = fastGetAttribute(SVGNames::g2Attr); | 70 String g2 = fastGetAttribute(SVGNames::g2Attr); |
71 if ((u1.isEmpty() && g1.isEmpty()) || (u2.isEmpty() && g2.isEmpty())) | 71 if ((u1.isEmpty() && g1.isEmpty()) || (u2.isEmpty() && g2.isEmpty())) |
72 return; | 72 return; |
73 | 73 |
74 SVGKerningPair kerningPair; | 74 SVGKerningPair kerningPair; |
75 if (parseGlyphName(g1, kerningPair.glyphName1) | 75 if (parseGlyphName(g1, kerningPair.glyphName1) |
76 && parseGlyphName(g2, kerningPair.glyphName2) | 76 && parseGlyphName(g2, kerningPair.glyphName2) |
77 && parseKerningUnicodeString(u1, kerningPair.unicodeRange1, kerningPair. unicodeName1) | 77 && parseKerningUnicodeString(u1, kerningPair.unicodeRange1, kerningPair. unicodeName1) |
78 && parseKerningUnicodeString(u2, kerningPair.unicodeRange2, kerningPair. unicodeName2)) { | 78 && parseKerningUnicodeString(u2, kerningPair.unicodeRange2, kerningPair. unicodeName2)) { |
79 kerningPair.kerning = fastGetAttribute(SVGNames::kAttr).string().toFloat (); | 79 kerningPair.kerning = fastGetAttribute(SVGNames::kAttr).string().toFloat (); |
80 kerningPairs.append(kerningPair); | 80 kerningPairs.append(kerningPair); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 } | 84 } |
85 | 85 |
86 #endif // ENABLE(SVG_FONTS) | 86 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |