2019-06-19 17:32:01 +00:00
|
|
|
// Copyright 2019 Google LLC.
|
|
|
|
#include "modules/skparagraph/include/FontCollection.h"
|
2019-06-21 16:22:32 +00:00
|
|
|
#include "modules/skparagraph/include/TypefaceFontProvider.h"
|
2020-03-27 19:40:37 +00:00
|
|
|
#include "src/core/SkFontDescriptor.h"
|
2019-06-19 17:32:01 +00:00
|
|
|
|
|
|
|
namespace skia {
|
|
|
|
namespace textlayout {
|
|
|
|
class TestFontCollection : public FontCollection {
|
|
|
|
public:
|
2019-10-09 13:43:02 +00:00
|
|
|
TestFontCollection(const std::string& resourceDir, bool testOnly = false, bool loadFonts = true);
|
2019-06-19 17:32:01 +00:00
|
|
|
|
|
|
|
size_t fontsFound() const { return fFontsFound; }
|
2019-10-09 13:43:02 +00:00
|
|
|
bool addFontFromFile(const std::string& path, const std::string& familyName = "");
|
2019-06-19 17:32:01 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string fResourceDir;
|
|
|
|
size_t fFontsFound;
|
2019-06-21 16:22:32 +00:00
|
|
|
sk_sp<TypefaceFontProvider> fFontProvider;
|
|
|
|
std::string fDirs;
|
2019-06-19 17:32:01 +00:00
|
|
|
};
|
|
|
|
} // namespace textlayout
|
2019-06-21 16:22:32 +00:00
|
|
|
} // namespace skia
|