#ifndef SVGGlyph_h
#define SVGGlyph_h
#if ENABLE(SVG_FONTS)
#include "platform/PlatformExport.h"
#include "platform/fonts/Glyph.h"
#include "platform/graphics/Path.h"
#include <limits>
#include "wtf/text/WTFString.h"
#include "wtf/Vector.h"
namespace WebCore {
struct SVGGlyph {
enum Orientation {
Vertical,
Horizontal,
Both
};
enum ArabicForm {
None = 0,
Isolated,
Terminal,
Initial,
Medial
};
SVGGlyph()
: isPartOfLigature(false)
, orientation(Both)
, arabicForm(None)
, priority(0)
, tableEntry(0)
, unicodeStringLength(0)
, horizontalAdvanceX(0)
, verticalOriginX(0)
, verticalOriginY(0)
, verticalAdvanceY(0)
{
}
static float inheritedValue()
{
static float s_inheritedValue = std::numeric_limits<float>::infinity();
return s_inheritedValue;
}
bool operator==(const SVGGlyph& other) const
{
return isPartOfLigature == other.isPartOfLigature
&& orientation == other.orientation
&& arabicForm == other.arabicForm
&& tableEntry == other.tableEntry
&& unicodeStringLength == other.unicodeStringLength
&& glyphName == other.glyphName
&& horizontalAdvanceX == other.horizontalAdvanceX
&& verticalOriginX == other.verticalOriginX
&& verticalOriginY == other.verticalOriginY
&& verticalAdvanceY == other.verticalAdvanceY
&& languages == other.languages;
}
bool isPartOfLigature : 1;
unsigned orientation : 2;
unsigned arabicForm : 3;
int priority;
Glyph tableEntry;
size_t unicodeStringLength;
String glyphName;
float horizontalAdvanceX;
float verticalOriginX;
float verticalOriginY;
float verticalAdvanceY;
Path pathData;
Vector<String> languages;
};
Vector<SVGGlyph::ArabicForm> PLATFORM_EXPORT charactersWithArabicForm(const String& input, bool rtl);
bool PLATFORM_EXPORT isCompatibleGlyph(const SVGGlyph&, bool isVerticalText, const String& language, const Vector<SVGGlyph::ArabicForm>&, unsigned startPosition, unsigned endPosition);
}
#endif
#endif