2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2008 Rob Buis <buis@kde.org>
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
31 #include <wtf/Vector.h>
32 #include <wtf/text/WTFString.h>
36 // Describe a glyph from a SVG Font.
44 // SVG Font depends on exactly this order.
54 : isPartOfLigature(false)
59 , unicodeStringLength(0)
60 , horizontalAdvanceX(0)
67 // Used to mark our float properties as "to be inherited from SVGFontData"
68 static float inheritedValue()
70 static float s_inheritedValue = std::numeric_limits<float>::infinity();
71 return s_inheritedValue;
74 bool operator==(const SVGGlyph& other) const
76 return isPartOfLigature == other.isPartOfLigature
77 && orientation == other.orientation
78 && arabicForm == other.arabicForm
79 && tableEntry == other.tableEntry
80 && unicodeStringLength == other.unicodeStringLength
81 && glyphName == other.glyphName
82 && horizontalAdvanceX == other.horizontalAdvanceX
83 && verticalOriginX == other.verticalOriginX
84 && verticalOriginY == other.verticalOriginY
85 && verticalAdvanceY == other.verticalAdvanceY
86 && languages == other.languages;
89 bool isPartOfLigature : 1;
91 unsigned orientation : 2; // Orientation
92 unsigned arabicForm : 3; // ArabicForm
95 size_t unicodeStringLength;
98 float horizontalAdvanceX;
99 float verticalOriginX;
100 float verticalOriginY;
101 float verticalAdvanceY;
104 Vector<String> languages;
107 Vector<SVGGlyph::ArabicForm> charactersWithArabicForm(const String& input, bool rtl);
108 bool isCompatibleGlyph(const SVGGlyph&, bool isVerticalText, const String& language, const Vector<SVGGlyph::ArabicForm>&, unsigned startPosition, unsigned endPosition);
110 } // namespace WebCore
112 #endif // ENABLE(SVG_FONTS)