Add forkawesome from compressed Base85 TTF

pull/536/head
Alessandro Toia 3 years ago
parent 552a85aaaa
commit 5656001639

@ -211,7 +211,6 @@ install() {
/usr/bin/install -Dvm644 ./build/release/usr/share/vulkan/implicit_layer.d/MangoHud.json /usr/share/vulkan/implicit_layer.d/MangoHud.json
/usr/bin/install -Dvm644 ./build/release/usr/share/man/man1/mangohud.1 /usr/share/man/man1/mangohud.1
/usr/bin/install -Dvm644 ./build/release/usr/share/doc/mangohud/MangoHud.conf.example /usr/share/doc/mangohud/MangoHud.conf.example
/usr/bin/install -Dvm644 ./build/release/usr/share/MangoHud/icons/forkawesome-webfont.ttf /usr/share/MangoHud/icons/forkawesome-webfont.ttf
/usr/bin/install -vm755 ./build/release/usr/bin/mangohud /usr/bin/mangohud
# FIXME get the triplet somehow

Binary file not shown.

@ -2,6 +2,7 @@
#include "file_utils.h"
#include "font_default.h"
#include "IconsForkAwesome.h"
#include "forkawesome.h"
void create_fonts(const overlay_params& params, ImFont*& small_font, ImFont*& text_font)
{
auto& io = ImGui::GetIO();
@ -60,7 +61,7 @@ void create_fonts(const overlay_params& params, ImFont*& small_font, ImFont*& te
// ImGui takes ownership of the data, no need to free it
if (!params.font_file.empty() && file_exists(params.font_file)) {
io.Fonts->AddFontFromFileTTF(params.font_file.c_str(), font_size, nullptr, same_font && same_size ? glyph_ranges.Data : default_range);
io.Fonts->AddFontFromFileTTF("/usr/share/MangoHud/icons/forkawesome-webfont.ttf", font_size, &config, icon_ranges);
io.Fonts->AddFontFromMemoryCompressedBase85TTF(forkawesome_compressed_data_base85, font_size, &config, icon_ranges);
if (params.no_small_font)
small_font = io.Fonts->Fonts[0];
else
@ -68,7 +69,7 @@ void create_fonts(const overlay_params& params, ImFont*& small_font, ImFont*& te
} else {
const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85();
io.Fonts->AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, font_size, nullptr, default_range);
io.Fonts->AddFontFromFileTTF("/usr/share/MangoHud/icons/forkawesome-webfont.ttf", font_size, &config, icon_ranges);
io.Fonts->AddFontFromMemoryCompressedBase85TTF(forkawesome_compressed_data_base85, font_size, &config, icon_ranges);
if (params.no_small_font)
small_font = io.Fonts->Fonts[0];
else

File diff suppressed because it is too large Load Diff

@ -224,9 +224,7 @@ configure_file(input : '../bin/mangohud.in',
configuration : conf_data,
install_dir : get_option('bindir'),
)
install_data(['../data/forkawesome-webfont.ttf'],
install_dir : join_paths(get_option('datadir'), 'MangoHud', 'icons'),
)
if get_option('include_doc')
install_data(
files('../bin/MangoHud.conf'),

Loading…
Cancel
Save