#ifndef SVGFontElement_h
#define SVGFontElement_h
#if ENABLE(SVG_FONTS)
#include "SVGAnimatedBoolean.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGGlyphElement.h"
#include "SVGGlyphMap.h"
#include "SVGParserUtilities.h"
#include "SVGStyledElement.h"
namespace WebCore {
struct SVGKerningPair {
float kerning;
UnicodeRanges unicodeRange1;
UnicodeRanges unicodeRange2;
HashSet<String> unicodeName1;
HashSet<String> unicodeName2;
HashSet<String> glyphName1;
HashSet<String> glyphName2;
SVGKerningPair()
: kerning(0.0f)
{
}
};
typedef Vector<SVGKerningPair> KerningPairVector;
class SVGMissingGlyphElement;
class SVGFontElement : public SVGStyledElement
, public SVGExternalResourcesRequired {
public:
static PassRefPtr<SVGFontElement> create(const QualifiedName&, Document*);
void invalidateGlyphCache();
void getGlyphIdentifiersForString(const String&, Vector<SVGGlyph>&) const;
float horizontalKerningForPairOfStringsAndGlyphs(const String& u1, const String& g1, const String& u2, const String& g2) const;
float verticalKerningForPairOfStringsAndGlyphs(const String& u1, const String& g1, const String& u2, const String& g2) const;
SVGMissingGlyphElement* firstMissingGlyphElement() const;
private:
SVGFontElement(const QualifiedName&, Document*);
virtual void synchronizeProperty(const QualifiedName&);
virtual bool rendererIsNeeded(RenderStyle*) { return false; }
virtual void fillAttributeToPropertyTypeMap();
virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
void ensureGlyphCache() const;
DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
mutable KerningPairVector m_horizontalKerningPairs;
mutable KerningPairVector m_verticalKerningPairs;
mutable SVGGlyphMap m_glyphMap;
mutable bool m_isGlyphCacheValid;
};
}
#endif // ENABLE(SVG_FONTS)
#endif