#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)
{
}
};
typedef Vector<SVGKerningPair> KerningPairVector;
class SVGMissingGlyphElement;
class SVGFontElement : public SVGStyledElement
, public SVGExternalResourcesRequired {
public:
static PassRefPtr<SVGFontElement> create(const QualifiedName&, Document*);
void invalidateGlyphCache();
void collectGlyphsForString(const String&, Vector<SVGGlyph>&);
void collectGlyphsForGlyphName(const String&, Vector<SVGGlyph>&);
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;
SVGGlyph svgGlyphForGlyph(Glyph);
Glyph missingGlyph();
SVGMissingGlyphElement* firstMissingGlyphElement() const;
private:
SVGFontElement(const QualifiedName&, Document*);
virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
void ensureGlyphCache();
void registerLigaturesInGlyphCache(Vector<String>&);
BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFontElement)
DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
END_DECLARE_ANIMATED_PROPERTIES
KerningPairVector m_horizontalKerningPairs;
KerningPairVector m_verticalKerningPairs;
SVGGlyphMap m_glyphMap;
Glyph m_missingGlyph;
bool m_isGlyphCacheValid;
};
}
#endif // ENABLE(SVG_FONTS)
#endif