| 35 | }; |
| 36 | |
| 37 | hb_blob_t* HBGetTable(hb_face_t*, hb_tag_t tag, void* userData) { |
| 38 | auto data = reinterpret_cast<PtrWrapper<Typeface>*>(userData)->ptr->copyTableData(tag); |
| 39 | if (data == nullptr) { |
| 40 | return nullptr; |
| 41 | } |
| 42 | auto wrapper = new PtrWrapper<Data>(data); |
| 43 | return hb_blob_create(static_cast<const char*>(data->data()), |
| 44 | static_cast<unsigned int>(data->size()), HB_MEMORY_MODE_READONLY, |
| 45 | static_cast<void*>(wrapper), |
| 46 | [](void* ctx) { delete reinterpret_cast<PtrWrapper<Data>*>(ctx); }); |
| 47 | } |
| 48 | |
| 49 | std::shared_ptr<hb_face_t> CreateHBFace(const std::shared_ptr<Typeface>& typeface) { |
| 50 | std::shared_ptr<hb_face_t> hbFace; |
nothing calls this directly
no test coverage detected