eseidel | 5fced7c | 2007-10-23 00:38:49 +0000 | [diff] [blame] | 1 | /* |
zimmermann@webkit.org | 711245f | 2010-08-03 19:39:01 +0000 | [diff] [blame] | 2 | * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 3 | * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 | * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public License |
| 17 | * along with this library; see the file COPYING.LIB. If not, write to |
| 18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 | * Boston, MA 02110-1301, USA. |
| 20 | */ |
eseidel | 5fced7c | 2007-10-23 00:38:49 +0000 | [diff] [blame] | 21 | |
commit-queue@webkit.org | 46c0f52 | 2016-11-13 10:05:43 +0000 | [diff] [blame] | 22 | #pragma once |
eseidel | 5fced7c | 2007-10-23 00:38:49 +0000 | [diff] [blame] | 23 | |
zimmermann@webkit.org | ce57f04 | 2007-12-29 02:41:53 +0000 | [diff] [blame] | 24 | #if ENABLE(SVG_FONTS) |
commit-queue@webkit.org | 46c0f52 | 2016-11-13 10:05:43 +0000 | [diff] [blame] | 25 | |
eseidel | 5fced7c | 2007-10-23 00:38:49 +0000 | [diff] [blame] | 26 | #include "SVGElement.h" |
| 27 | |
| 28 | namespace WebCore { |
zimmermann@webkit.org | ce57f04 | 2007-12-29 02:41:53 +0000 | [diff] [blame] | 29 | |
krit@webkit.org | 6a0cb5b | 2010-12-22 20:15:51 +0000 | [diff] [blame] | 30 | class SVGFontElement; |
antti@apple.com | d09a792 | 2012-04-02 19:50:34 +0000 | [diff] [blame] | 31 | class StyleRuleFontFace; |
zimmermann@webkit.org | ce57f04 | 2007-12-29 02:41:53 +0000 | [diff] [blame] | 32 | |
andersca@apple.com | 16d2dd4 | 2014-01-16 23:08:24 +0000 | [diff] [blame] | 33 | class SVGFontFaceElement final : public SVGElement { |
fpizlo@apple.com | 197cd32 | 2018-03-17 06:11:00 +0000 | [diff] [blame] | 34 | WTF_MAKE_ISO_ALLOCATED(SVGFontFaceElement); |
krit@webkit.org | 6a0cb5b | 2010-12-22 20:15:51 +0000 | [diff] [blame] | 35 | public: |
weinig@apple.com | 1092357 | 2015-01-07 20:56:24 +0000 | [diff] [blame] | 36 | static Ref<SVGFontFaceElement> create(const QualifiedName&, Document&); |
darin@apple.com | 3cbd5cb | 2010-08-30 06:51:56 +0000 | [diff] [blame] | 37 | |
krit@webkit.org | 6a0cb5b | 2010-12-22 20:15:51 +0000 | [diff] [blame] | 38 | unsigned unitsPerEm() const; |
| 39 | int xHeight() const; |
mmaxfield@apple.com | 73121d2 | 2015-04-06 15:30:49 +0000 | [diff] [blame] | 40 | int capHeight() const; |
krit@webkit.org | 6a0cb5b | 2010-12-22 20:15:51 +0000 | [diff] [blame] | 41 | float horizontalOriginX() const; |
| 42 | float horizontalOriginY() const; |
| 43 | float horizontalAdvanceX() const; |
| 44 | float verticalOriginX() const; |
| 45 | float verticalOriginY() const; |
| 46 | float verticalAdvanceY() const; |
| 47 | int ascent() const; |
| 48 | int descent() const; |
| 49 | String fontFamily() const; |
zimmermann@webkit.org | ce57f04 | 2007-12-29 02:41:53 +0000 | [diff] [blame] | 50 | |
jschuh@chromium.org | 79d31db | 2011-01-28 22:26:19 +0000 | [diff] [blame] | 51 | SVGFontElement* associatedFontElement() const; |
krit@webkit.org | 6a0cb5b | 2010-12-22 20:15:51 +0000 | [diff] [blame] | 52 | void rebuildFontFace(); |
antti@apple.com | 846f7b3 | 2012-03-27 12:40:38 +0000 | [diff] [blame] | 53 | |
mmaxfield@apple.com | 2b42890 | 2016-02-22 21:40:02 +0000 | [diff] [blame] | 54 | StyleRuleFontFace& fontFaceRule() { return m_fontFaceRule.get(); } |
zimmermann@webkit.org | ce57f04 | 2007-12-29 02:41:53 +0000 | [diff] [blame] | 55 | |
krit@webkit.org | 6a0cb5b | 2010-12-22 20:15:51 +0000 | [diff] [blame] | 56 | private: |
weinig@apple.com | 52e786e | 2013-09-15 18:06:06 +0000 | [diff] [blame] | 57 | SVGFontFaceElement(const QualifiedName&, Document&); |
simon.fraser@apple.com | 985a908 | 2018-09-10 21:19:49 +0000 | [diff] [blame] | 58 | ~SVGFontFaceElement(); |
darin@apple.com | c8b8f87 | 2010-08-30 18:44:06 +0000 | [diff] [blame] | 59 | |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 60 | void parseAttribute(const QualifiedName&, const AtomString&) final; |
darin@apple.com | c8b8f87 | 2010-08-30 18:44:06 +0000 | [diff] [blame] | 61 | |
commit-queue@webkit.org | e6d3df0 | 2016-07-20 21:21:21 +0000 | [diff] [blame] | 62 | void childrenChanged(const ChildChange&) final; |
rniwa@webkit.org | ddc3f39 | 2017-10-21 00:49:21 +0000 | [diff] [blame] | 63 | InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final; |
| 64 | void removedFromAncestor(RemovalType, ContainerNode&) final; |
darin@apple.com | c8b8f87 | 2010-08-30 18:44:06 +0000 | [diff] [blame] | 65 | |
commit-queue@webkit.org | e6d3df0 | 2016-07-20 21:21:21 +0000 | [diff] [blame] | 66 | bool rendererIsNeeded(const RenderStyle&) final { return false; } |
ch.dumez@sisa.samsung.com | 7dd31bf | 2013-08-22 21:58:09 +0000 | [diff] [blame] | 67 | |
mmaxfield@apple.com | 0335753 | 2015-11-02 00:52:46 +0000 | [diff] [blame] | 68 | Ref<StyleRuleFontFace> m_fontFaceRule; |
rniwa@webkit.org | 00bac93 | 2013-01-24 19:18:22 +0000 | [diff] [blame] | 69 | SVGFontElement* m_fontElement; |
krit@webkit.org | 6a0cb5b | 2010-12-22 20:15:51 +0000 | [diff] [blame] | 70 | }; |
eseidel | 5fced7c | 2007-10-23 00:38:49 +0000 | [diff] [blame] | 71 | |
| 72 | } // namespace WebCore |
| 73 | |
zimmermann@webkit.org | ce57f04 | 2007-12-29 02:41:53 +0000 | [diff] [blame] | 74 | #endif // ENABLE(SVG_FONTS) |