| 232 | } |
| 233 | |
| 234 | static 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 | |
| 248 | PositionedGlyphs TextShaper::Shape(const std::string& text, std::shared_ptr<Typeface> face) { |
| 249 | std::list<HBGlyph> glyphs; |