| 149 | } |
| 150 | |
| 151 | static std::shared_ptr<hb_font_t> CreateHBFont(const std::shared_ptr<Typeface>& typeface) { |
| 152 | auto cache = GetHBFontCache(); |
| 153 | auto hbFont = cache.find(typeface->uniqueID()); |
| 154 | if (hbFont == nullptr) { |
| 155 | auto hbFace = CreateHBFace(typeface); |
| 156 | if (hbFace == nullptr) { |
| 157 | return nullptr; |
| 158 | } |
| 159 | hbFont = cache.insert(typeface->uniqueID(), std::shared_ptr<hb_font_t>( |
| 160 | hb_font_create(hbFace.get()), hb_font_destroy)); |
| 161 | } |
| 162 | return hbFont; |
| 163 | } |
| 164 | |
| 165 | static std::vector<std::tuple<uint32_t, uint32_t, uint32_t>> ShapeText( |
| 166 | const std::string& text, const std::shared_ptr<Typeface>& typeface) { |
no test coverage detected