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

Function HBGetTable

test/src/utils/TextShaper.cpp:37–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35};
36
37hb_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
49std::shared_ptr<hb_face_t> CreateHBFace(const std::shared_ptr<Typeface>& typeface) {
50 std::shared_ptr<hb_face_t> hbFace;

Callers

nothing calls this directly

Calls 3

copyTableDataMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected