2023-11-28 01:55:41 +01:00
|
|
|
#include <hex/api/imhex_api.hpp>
|
|
|
|
|
|
|
|
#include <romfs/romfs.hpp>
|
|
|
|
|
|
|
|
#include <hex/helpers/utils.hpp>
|
|
|
|
|
|
|
|
#include <fonts/codicons_font.h>
|
2023-12-05 10:49:51 +01:00
|
|
|
#include <fonts/blendericons_font.h>
|
2023-11-28 01:55:41 +01:00
|
|
|
|
2024-01-28 22:14:59 +01:00
|
|
|
namespace hex::fonts {
|
2023-11-28 01:55:41 +01:00
|
|
|
|
2024-06-16 22:41:16 +02:00
|
|
|
void registerFonts() {
|
2023-11-28 13:52:26 +01:00
|
|
|
using namespace ImHexApi::Fonts;
|
|
|
|
|
2023-11-28 10:37:38 +01:00
|
|
|
/**
|
|
|
|
* !!IMPORTANT!!
|
|
|
|
* Always load the font files in decreasing size of their glyphs. This will make the rasterize be more
|
|
|
|
* efficient when packing the glyphs into the font atlas and therefor make the atlas much smaller.
|
|
|
|
*/
|
|
|
|
|
2024-03-28 22:15:30 +01:00
|
|
|
ImHexApi::Fonts::loadFont("Blender Icons", romfs::get("fonts/blendericons.ttf").span<u8>(),{ { ICON_MIN_BI, ICON_MAX_BI } }, { -1_scaled, -1_scaled });
|
2023-11-28 13:52:26 +01:00
|
|
|
|
|
|
|
ImHexApi::Fonts::loadFont("VS Codicons", romfs::get("fonts/codicons.ttf").span<u8>(),
|
|
|
|
{
|
|
|
|
{ ICON_MIN_VS, ICON_MAX_VS }
|
|
|
|
},
|
2024-03-28 22:15:30 +01:00
|
|
|
{ -1_scaled, -1_scaled });
|
2023-11-28 13:52:26 +01:00
|
|
|
|
2024-03-21 21:27:50 +01:00
|
|
|
ImHexApi::Fonts::loadFont("Unifont", romfs::get("fonts/unifont.otf").span<u8>(), {}, {}, 0, 16);
|
2023-11-28 01:55:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|