| 191 | |
| 192 | #if defined(FONT_USE_HARFBUZZ) |
| 193 | static int LoadHBFont(TTFFont* font, void* buffer, uint32_t buffer_size) |
| 194 | { |
| 195 | hb_blob_t* blob = 0; |
| 196 | hb_face_t* face = 0; |
| 197 | int result = 0; |
| 198 | |
| 199 | blob = hb_blob_create((const char*)buffer, buffer_size, HB_MEMORY_MODE_READONLY, 0, 0); |
| 200 | if (!blob) goto cleanup; |
| 201 | |
| 202 | face = hb_face_create(blob, 0); |
| 203 | if (!face) goto cleanup; |
| 204 | |
| 205 | font->m_HBFont = hb_font_create(face); |
| 206 | result = font->m_HBFont != 0; |
| 207 | |
| 208 | cleanup: |
| 209 | hb_face_destroy(face); |
| 210 | hb_blob_destroy(blob); |
| 211 | return result; |
| 212 | } |
| 213 | #endif |
| 214 | |
| 215 | static HFont LoadTTFInternal(const char* path, const void* buffer, uint32_t buffer_size, bool allocate) |
no test coverage detected