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 "SkFontMgr_custom.h"
9#include "SkFontMgr_empty.h"
10
11class EmptyFontLoader : public SkFontMgr_Custom::SystemFontLoader {
12public:
13    EmptyFontLoader() { }
14
15    void loadSystemFonts(const SkTypeface_FreeType::Scanner& scanner,
16                         SkFontMgr_Custom::Families* families) const override
17    {
18        SkFontStyleSet_Custom* family = new SkFontStyleSet_Custom(SkString());
19        families->push_back().reset(family);
20        family->appendTypeface(sk_make_sp<SkTypeface_Empty>());
21    }
22
23};
24
25SK_API sk_sp<SkFontMgr> SkFontMgr_New_Custom_Empty() {
26    return sk_make_sp<SkFontMgr_Custom>(EmptyFontLoader());
27}
28