Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
txt
src
txt
test_font_manager.h
Go to the documentation of this file.
1
/*
2
* Copyright 2017 Google Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef TXT_TEST_FONT_MANAGER_H_
18
#define TXT_TEST_FONT_MANAGER_H_
19
20
#include <memory>
21
#include <string>
22
#include <vector>
23
24
#include "flutter/fml/macros.h"
25
#include "
third_party/skia/include/core/SkFontMgr.h
"
26
#include "
txt/asset_font_manager.h
"
27
#include "
txt/font_asset_provider.h
"
28
29
namespace
txt
{
30
31
// A font manager intended for tests that matches all requested fonts using
32
// one family.
33
class
TestFontManager
:
public
AssetFontManager
{
34
public
:
35
TestFontManager
(std::unique_ptr<FontAssetProvider> font_provider,
36
std::vector<std::string> test_font_family_names);
37
38
~TestFontManager
()
override
;
39
40
private
:
41
std::vector<std::string> test_font_family_names_;
42
43
sk_sp<SkFontStyleSet>
onMatchFamily
(
const
char
family_name[])
const override
;
44
45
FML_DISALLOW_COPY_AND_ASSIGN
(
TestFontManager
);
46
};
47
48
}
// namespace txt
49
50
#endif
// TXT_TEST_FONT_MANAGER_H_
SkFontMgr.h
asset_font_manager.h
sk_sp
Definition
SkRefCnt.h:220
txt::AssetFontManager
Definition
asset_font_manager.h:31
txt::TestFontManager
Definition
test_font_manager.h:33
txt::TestFontManager::~TestFontManager
~TestFontManager() override
txt::TestFontManager::onMatchFamily
sk_sp< SkFontStyleSet > onMatchFamily(const char family_name[]) const override
Definition
test_font_manager.cc:30
FML_DISALLOW_COPY_AND_ASSIGN
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
macros.h:27
font_asset_provider.h
txt
Definition
paragraph_builder_skia.cc:26
Generated on Fri Apr 26 2024 06:18:17 for Flutter Engine by
1.9.8