Comments, documentation (#1121)
This commit is contained in:
parent
9614552eba
commit
df52f46b13
@ -96,7 +96,9 @@
|
|||||||
EMBEDDING FONT IN SOURCE CODE
|
EMBEDDING FONT IN SOURCE CODE
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
Compile and use 'binary_to_compressed_c.cpp' to create a compressed C style array. Then load the font with:
|
Compile and use 'binary_to_compressed_c.cpp' to create a compressed C style array.
|
||||||
|
See the documentation in binary_to_compressed_c.cpp for instruction on how to use the tool.
|
||||||
|
Then load the font with:
|
||||||
|
|
||||||
ImFont* font = io.Fonts->AddFontFromMemoryCompressedTTF(compressed_data, compressed_data_size, size_pixels, ...);
|
ImFont* font = io.Fonts->AddFontFromMemoryCompressedTTF(compressed_data, compressed_data_size, size_pixels, ...);
|
||||||
|
|
||||||
|
@ -7,12 +7,17 @@
|
|||||||
// Note that even with compression, the output array is likely to be bigger than the binary file..
|
// Note that even with compression, the output array is likely to be bigger than the binary file..
|
||||||
// Load compressed TTF fonts with ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF()
|
// Load compressed TTF fonts with ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF()
|
||||||
|
|
||||||
// Single file application, build with:
|
// Build with, e.g:
|
||||||
// # cl.exe binary_to_compressed_c.cpp
|
// # cl.exe binary_to_compressed_c.cpp
|
||||||
// # gcc binary_to_compressed_c.cpp
|
// # gcc binary_to_compressed_c.cpp
|
||||||
// etc.
|
|
||||||
// You can also find a precompiled Windows binary in the binary/demo package available from https://github.com/ocornut/imgui
|
// You can also find a precompiled Windows binary in the binary/demo package available from https://github.com/ocornut/imgui
|
||||||
|
|
||||||
|
// Usage:
|
||||||
|
// binary_to_compressed_c.exe [-base85] [-nocompress] <inputfile> <symbolname>
|
||||||
|
// Usage example:
|
||||||
|
// # binary_to_compressed_c.exe myfont.ttf MyFont > myfont.cpp
|
||||||
|
// # binary_to_compressed_c.exe -base85 myfont.ttf MyFont > myfont.cpp
|
||||||
|
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user