Upstream version 6.35.121.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / svg / SVGFontFaceSource.cpp
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6
7 #if ENABLE(SVG_FONTS)
8 #include "core/svg/SVGFontFaceSource.h"
9
10 #include "core/svg/SVGFontData.h"
11 #include "core/svg/SVGFontFaceElement.h"
12 #include "platform/fonts/FontDescription.h"
13 #include "platform/fonts/SimpleFontData.h"
14
15 namespace WebCore {
16
17 SVGFontFaceSource::SVGFontFaceSource(PassRefPtr<SVGFontFaceElement> element)
18     : m_svgFontFaceElement(element)
19 {
20 }
21
22 PassRefPtr<SimpleFontData> SVGFontFaceSource::createFontData(const FontDescription& fontDescription)
23 {
24     return SimpleFontData::create(
25         SVGFontData::create(m_svgFontFaceElement.get()),
26         fontDescription.effectiveFontSize(),
27         fontDescription.isSyntheticBold(),
28         fontDescription.isSyntheticItalic());
29 }
30
31 } // namespace WebCore
32
33 #endif // ENABLE(SVG_FONTS)