KHTML
SVGFontElement.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SVGFontElement_h
00022 #define SVGFontElement_h
00023
00024 #if ENABLE(SVG_FONTS)
00025 #include "SVGExternalResourcesRequired.h"
00026 #include "SVGGlyphElement.h"
00027 #include "SVGGlyphMap.h"
00028 #include "SVGHKernElement.h"
00029 #include "SVGStyledElement.h"
00030
00031 namespace WebCore {
00032
00033 class SVGMissingGlyphElement;
00034 class SVGFontElement : public SVGStyledElement
00035 , public SVGExternalResourcesRequired {
00036 public:
00037 SVGFontElement(const QualifiedName&, Document*);
00038 virtual ~SVGFontElement();
00039
00040 virtual bool rendererIsNeeded(RenderStyle*) { return false; }
00041 virtual const SVGElement* contextElement() const { return this; }
00042
00043 void invalidateGlyphCache();
00044
00045 void getGlyphIdentifiersForString(const String&, Vector<SVGGlyphIdentifier>&) const;
00046
00047 bool getHorizontalKerningPairForStringsAndGlyphs(const String& u1, const String& g1, const String& u2, const String& g2, SVGHorizontalKerningPair& kerningPair) const;
00048
00049 SVGMissingGlyphElement* firstMissingGlyphElement() const;
00050
00051
00052 virtual quint32 id() const { return SVGNames::textTag.id(); }
00053 virtual DOMString tagName() const { return SVGNames::textTag.tagName(); }
00054
00055 private:
00056 void ensureGlyphCache() const;
00057
00058 typedef Vector<SVGHorizontalKerningPair> KerningPairVector;
00059
00060 mutable KerningPairVector m_kerningPairs;
00061 mutable SVGGlyphMap m_glyphMap;
00062 mutable bool m_isGlyphCacheValid;
00063 };
00064
00065 }
00066
00067 #endif // ENABLE(SVG_FONTS)
00068 #endif
00069
00070