MCPcopy Create free account
hub / github.com/Tencent/tgfx / GetFallbackTypefaces

Function GetFallbackTypefaces

test/src/utils/TextShaper.cpp:234–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234static std::vector<std::shared_ptr<Typeface>> GetFallbackTypefaces() {
235 std::vector<std::string> fontPaths = {
236 ProjectPath::Absolute("resources/font/NotoSansSC-Regular.otf"),
237 ProjectPath::Absolute("resources/font/NotoColorEmoji.ttf")};
238 std::vector<std::shared_ptr<Typeface>> typefaces;
239 for (const auto& fontPath : fontPaths) {
240 auto typeface = Typeface::MakeFromPath(fontPath);
241 if (typeface) {
242 typefaces.push_back(typeface);
243 }
244 }
245 return typefaces;
246}
247
248PositionedGlyphs TextShaper::Shape(const std::string& text, std::shared_ptr<Typeface> face) {
249 std::list<HBGlyph> glyphs;

Callers 1

ShapeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected