- Replace header include guards with `#pragma once` and perform minor optimizations. - Replaced traditional include guards with `#pragma once` for simplicity and to reduce boilerplate in all headers. - Improved CLI line number handling with clamping and error messaging. - Enhanced `chdir` error handling for macOS GUI builds. - Removed redundant logic for GUI builds. - Adjusted font constructor and registry to handle `const` data pointers consistently.
94 lines
2.9 KiB
C++
94 lines
2.9 KiB
C++
#include "FontRegistry.h"
|
|
#include "FontList.h"
|
|
|
|
namespace kte::Fonts {
|
|
void
|
|
InstallDefaultFonts()
|
|
{
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"default",
|
|
BrassMono::DefaultFontBoldCompressedData,
|
|
BrassMono::DefaultFontBoldCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"b612",
|
|
B612Mono::DefaultFontRegularCompressedData,
|
|
B612Mono::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"brassmono",
|
|
BrassMono::DefaultFontBoldCompressedData,
|
|
BrassMono::DefaultFontBoldCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"brassmonocode",
|
|
BrassMonoCode::DefaultFontBoldCompressedData,
|
|
BrassMonoCode::DefaultFontBoldCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"fira",
|
|
FiraCode::DefaultFontRegularCompressedData,
|
|
FiraCode::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"go",
|
|
Go::DefaultFontRegularCompressedData,
|
|
Go::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"ibm",
|
|
IBMPlexMono::DefaultFontRegularCompressedData,
|
|
IBMPlexMono::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"idealist",
|
|
Idealist::DefaultFontRegularCompressedData,
|
|
Idealist::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"inconsolata",
|
|
Inconsolata::DefaultFontRegularCompressedData,
|
|
Inconsolata::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"inconsolataex",
|
|
InconsolataExpanded::DefaultFontRegularCompressedData,
|
|
InconsolataExpanded::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"iosevka",
|
|
Iosoveka::DefaultFontRegularCompressedData,
|
|
Iosoveka::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"iosevkaex",
|
|
IosevkaExtended::DefaultFontRegularCompressedData,
|
|
IosevkaExtended::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"sharetech",
|
|
ShareTech::DefaultFontRegularCompressedData,
|
|
ShareTech::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"space",
|
|
SpaceMono::DefaultFontRegularCompressedData,
|
|
SpaceMono::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"syne",
|
|
Syne::DefaultFontRegularCompressedData,
|
|
Syne::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"triplicate",
|
|
Triplicate::DefaultFontRegularCompressedData,
|
|
Triplicate::DefaultFontRegularCompressedSize
|
|
));
|
|
FontRegistry::Instance().Register(std::make_unique<Font>(
|
|
"unispace",
|
|
Unispace::DefaultFontRegularCompressedData,
|
|
Unispace::DefaultFontRegularCompressedSize
|
|
));
|
|
}
|
|
} |