local font = {}
imgui.OnInitialize(function()
imgui.GetIO().IniFilename = nil
local config = imgui.ImFontConfig()
local glyph_ranges = imgui.GetIO().Fonts:GetGlyphRangesCyrillic()
local font_path = getFolderPath(0x14) .. '\\trebucbd.ttf'
config.MergeMode = true
config.PixelSnapH = true
imgui.GetIO().Fonts:Clear()
local builder = imgui.ImFontGlyphRangesBuilder()
local list = { -- Здесь только используемые иконки, чтобы не забивать память
'POWER_OFF',
'LINK',
'CHECK',
'USER',
'BELL',
'GEAR',
'PEOPLE_GROUP',
'EYE',
'CIRCLE_QUESTION',
'INFO',
'HEART',
'USER_SHIELD',
'SCROLL',
'IMAGE',
'CARET_DOWN',
'CARET_UP',
'ALIGN_LEFT',
'ALIGN_RIGHT',
'ALIGN_CENTER',
'NOTE_STICKY',
'FLOPPY_DISK',
'PLAY',
'PAUSE',
'GRADUATION_CAP',
'SCHOOL',
'BOOK'
}
for _, b in ipairs(list) do
builder:AddText(faicons(b))
end
defaultGlyphRanges1 = imgui.ImVector_ImWchar()
builder:BuildRanges(defaultGlyphRanges1)
imgui.GetIO().Fonts:AddFontFromFileTTF(font_path, 14.0, nil, glyph_ranges)
for k,v in pairs({14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 27, 29, 35}) do
font[v] = imgui.GetIO().Fonts:AddFontFromFileTTF(font_path, v, nil, glyph_ranges)
imgui.GetIO().Fonts:AddFontFromMemoryCompressedBase85TTF(faicons.base, v, config, defaultGlyphRanges1[0].Data)
end
end)