KHtml

SVGFontElement.h
1 /*
2  Copyright (C) 2007 Eric Seidel <[email protected]>
3  Copyright (C) 2007 Nikolas Zimmermann <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef SVGFontElement_h
22 #define SVGFontElement_h
23 
24 #if ENABLE(SVG_FONTS)
25 #include "SVGExternalResourcesRequired.h"
26 #include "SVGGlyphElement.h"
27 #include "SVGGlyphMap.h"
28 #include "SVGHKernElement.h"
29 #include "SVGStyledElement.h"
30 
31 namespace WebCore
32 {
33 
34 class SVGMissingGlyphElement;
35 class SVGFontElement : public SVGStyledElement
36  , public SVGExternalResourcesRequired
37 {
38 public:
39  SVGFontElement(const QualifiedName &, Document *);
40  virtual ~SVGFontElement();
41 
42  bool rendererIsNeeded(RenderStyle *) override
43  {
44  return false;
45  }
46  const SVGElement *contextElement() const override
47  {
48  return this;
49  }
50 
51  void invalidateGlyphCache();
52 
53  void getGlyphIdentifiersForString(const String &, Vector<SVGGlyphIdentifier> &) const;
54 
55  bool getHorizontalKerningPairForStringsAndGlyphs(const String &u1, const String &g1, const String &u2, const String &g2, SVGHorizontalKerningPair &kerningPair) const;
56 
57  SVGMissingGlyphElement *firstMissingGlyphElement() const;
58 
59  // KHTML ElementImpl pure virtual method
60  quint32 id() const override
61  {
62  return SVGNames::textTag.id();
63  }
64 private:
65  void ensureGlyphCache() const;
66 
67  typedef Vector<SVGHorizontalKerningPair> KerningPairVector;
68 
69  mutable KerningPairVector m_kerningPairs;
70  mutable SVGGlyphMap m_glyphMap;
71  mutable bool m_isGlyphCacheValid;
72 };
73 
74 } // namespace WebCore
75 
76 #endif // ENABLE(SVG_FONTS)
77 #endif
78 
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.