OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "platform/testing/FontTestHelpers.h" | 5 #include "platform/testing/FontTestHelpers.h" |
6 | 6 |
7 #include "platform/fonts/Font.h" | 7 #include "platform/fonts/Font.h" |
8 #include "platform/fonts/FontCustomPlatformData.h" | 8 #include "platform/fonts/FontCustomPlatformData.h" |
9 #include "platform/fonts/FontDescription.h" | 9 #include "platform/fonts/FontDescription.h" |
10 #include "platform/fonts/FontSelector.h" | 10 #include "platform/fonts/FontSelector.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 font_description.IsSyntheticBold(), | 35 font_description.IsSyntheticBold(), |
36 font_description.IsSyntheticItalic(), font_description.Orientation()); | 36 font_description.IsSyntheticItalic(), font_description.Orientation()); |
37 return SimpleFontData::Create(platform_data, CustomFontData::Create()); | 37 return SimpleFontData::Create(platform_data, CustomFontData::Create()); |
38 } | 38 } |
39 | 39 |
40 void WillUseFontData(const FontDescription&, | 40 void WillUseFontData(const FontDescription&, |
41 const AtomicString& family_name, | 41 const AtomicString& family_name, |
42 const String& text) override {} | 42 const String& text) override {} |
43 void WillUseRange(const FontDescription&, | 43 void WillUseRange(const FontDescription&, |
44 const AtomicString& family_name, | 44 const AtomicString& family_name, |
45 const FontDataForRangeSet&) override{}; | 45 const FontDataForRangeSet&) override {} |
46 | 46 |
47 unsigned Version() const override { return 0; } | 47 unsigned Version() const override { return 0; } |
48 void FontCacheInvalidated() override {} | 48 void FontCacheInvalidated() override {} |
49 void ReportNotDefGlyph() const override{}; | 49 void ReportNotDefGlyph() const override {} |
50 | 50 |
51 private: | 51 private: |
52 TestFontSelector(PassRefPtr<FontCustomPlatformData> custom_platform_data) | 52 TestFontSelector(PassRefPtr<FontCustomPlatformData> custom_platform_data) |
53 : custom_platform_data_(std::move(custom_platform_data)) {} | 53 : custom_platform_data_(std::move(custom_platform_data)) {} |
54 | 54 |
55 RefPtr<FontCustomPlatformData> custom_platform_data_; | 55 RefPtr<FontCustomPlatformData> custom_platform_data_; |
56 }; | 56 }; |
57 | 57 |
58 } // namespace | 58 } // namespace |
59 | 59 |
60 Font CreateTestFont(const AtomicString& family_name, | 60 Font CreateTestFont(const AtomicString& family_name, |
61 const String& font_path, | 61 const String& font_path, |
62 float size) { | 62 float size) { |
63 FontFamily family; | 63 FontFamily family; |
64 family.SetFamily(family_name); | 64 family.SetFamily(family_name); |
65 | 65 |
66 FontDescription font_description; | 66 FontDescription font_description; |
67 font_description.SetFamily(family); | 67 font_description.SetFamily(family); |
68 font_description.SetSpecifiedSize(size); | 68 font_description.SetSpecifiedSize(size); |
69 font_description.SetComputedSize(size); | 69 font_description.SetComputedSize(size); |
70 | 70 |
71 Font font(font_description); | 71 Font font(font_description); |
72 font.Update(TestFontSelector::Create(font_path)); | 72 font.Update(TestFontSelector::Create(font_path)); |
73 return font; | 73 return font; |
74 } | 74 } |
75 | 75 |
76 } // namespace testing | 76 } // namespace testing |
77 } // namespace blink | 77 } // namespace blink |
OLD | NEW |