MCPcopy Create free account
hub / github.com/Wassimulator/CactusViewer / UI_load_font_file

Function UI_load_font_file

include/ui/ui_core.cpp:373–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373UI_Font *UI_load_font_file(UI_Context *ctx, char *path, int ASCII_start, int ASCII_end, int *sizes, int sizes_count)
374{
375 int size = 0;
376 unsigned char *buffer = nullptr;
377
378 FILE *file = fopen(path, "rb");
379 fseek(file, 0, SEEK_END);
380 size = ftell(file);
381 fseek(file, 0, SEEK_SET);
382 buffer = (unsigned char *)malloc(size);
383 fread(buffer, size, 1, file);
384 fclose(file);
385
386 UI_Font *F = UI_load_font_memory(ctx, buffer, size, ASCII_start, ASCII_end, sizes, sizes_count);
387
388 free(buffer);
389 return F;
390}
391
392void UI_push_vertex(UI_Context *ctx, UI_Vertex vertex) {
393 UI_assert(ctx != nullptr && "UI context *ctx is a null pointer!");

Callers 1

init_allFunction · 0.85

Calls 1

UI_load_font_memoryFunction · 0.85

Tested by

no test coverage detected