Debian Codegraph @

src/ports/SkFontMgr_custom_empty.cpp

raw
1 /*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "include/core/SkFontScanner.h"
9 #include "include/core/SkRefCnt.h"
10 #include "include/ports/SkFontMgr_empty.h"
11 #include "src/ports/SkFontMgr_custom.h"
12
13 class EmptyFontLoader : public SkFontMgr_Custom::SystemFontLoader {
14 public:
15 EmptyFontLoader() { }
16
17 void loadSystemFonts(const SkFontScanner* scanner,
18 SkFontMgr_Custom::Families* families) const override
19 {
20 SkFontStyleSet_Custom* family = new SkFontStyleSet_Custom(SkString());
21 families->push_back().reset(family);
22 family->appendTypeface(sk_make_sp<SkTypeface_Empty>());
23 }
24
25 };
26
27 sk_sp<SkFontMgr> SkFontMgr_New_Custom_Empty() {
28 return sk_make_sp<SkFontMgr_Custom>(EmptyFontLoader());
29 }