1 /*
2  * Copyright 2015 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/SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN)  // And !SKIA_GDI?
10 
11 #include "include/core/SkFontMgr.h"
12 #include "include/ports/SkTypeface_win.h"
13 #include "src/ports/SkFontMgr_preview.h"
14 
15 std::string SkFontMgr::runtimeOS = "OHOS";
16 std::string containerFontPath = "";
17 std::string fileName = "fontconfig.json";
18 SK_API sk_sp<SkFontMgr> SkFontMgr_New_OHOS(const char *path);
19 
Factory()20 sk_sp<SkFontMgr> SkFontMgr::Factory() {
21     if (SkFontMgr::runtimeOS == "OHOS") {
22         return SkFontMgr_New_OHOS(nullptr);
23     }
24     if (SkFontMgr::runtimeOS == "OHOS_Container") {
25         return SkFontMgr_New_OHOS((containerFontPath + fileName).c_str());
26     }
27     return SkFontMgr_New_DirectWrite();
28 }
29 
30 #endif//defined(SK_BUILD_FOR_WIN)
31