Scale down icons if font is small

pull/536/head
Alessandro Toia 3 years ago
parent 5656001639
commit 62db1495d6

@ -64,16 +64,20 @@ void create_fonts(const overlay_params& params, ImFont*& small_font, ImFont*& te
io.Fonts->AddFontFromMemoryCompressedBase85TTF(forkawesome_compressed_data_base85, font_size, &config, icon_ranges);
if (params.no_small_font)
small_font = io.Fonts->Fonts[0];
else
else {
small_font = io.Fonts->AddFontFromFileTTF(params.font_file.c_str(), font_size * 0.55f, nullptr, default_range);
io.Fonts->AddFontFromMemoryCompressedBase85TTF(forkawesome_compressed_data_base85, font_size * 0.55f, &config, icon_ranges);
}
} else {
const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85();
io.Fonts->AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, font_size, nullptr, default_range);
io.Fonts->AddFontFromMemoryCompressedBase85TTF(forkawesome_compressed_data_base85, font_size, &config, icon_ranges);
if (params.no_small_font)
small_font = io.Fonts->Fonts[0];
else
else {
small_font = io.Fonts->AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, font_size * 0.55f, nullptr, default_range);
io.Fonts->AddFontFromMemoryCompressedBase85TTF(forkawesome_compressed_data_base85, font_size * 0.55f, &config, icon_ranges);
}
}
auto font_file_text = params.font_file_text;

@ -1,5 +1,7 @@
// File: 'forkawesome-webfont.ttf' (218132 bytes)
// Exported using binary_to_compressed_c.cpp
#pragma once
static const char forkawesome_compressed_data_base85[214910+1] =
"7])#######91@P)'/###[),##0rC$#Q6>##T@;*>[VPlmI$g]=5g>11gZn42d%&XpG,>>#I&g<6aNV=BmXpxb-OJM'^5YY#D2XGH-VSA$NiFJ(LjK8/d_(*Hlme+M:6h]=3YN$5#-0%J"
"a+msP.*8>,rM/m&0.d<BHk.w%%s.>-Q@pV-TT$=(^K-G&WbDE-FqEn/<_[FHv'=gu;?^01=<jl&83JuBQ:8>G#cDE-BqEn/DJ[^I&IP+%u3S>-kfWX%34^=BUkAr'X>wu#jx###^bCiF"

Loading…
Cancel
Save