Golden rules change
Some checks failed
CI / React UI Build (push) Successful in 10s
CI / Native Windows Build And Tests (push) Failing after 2m6s
CI / Windows Release Package (push) Has been skipped

This commit is contained in:
2026-05-21 15:45:13 +10:00
parent df0a77ef01
commit dc247ab58d
4 changed files with 237 additions and 190 deletions

View File

@@ -3,6 +3,7 @@
#include "ShaderTypes.h"
#include <filesystem>
#include <map>
#include <string>
#include <vector>
@@ -19,9 +20,30 @@ struct FontAtlasBuildConfig
struct FontAtlasBuildOutput
{
struct Glyph
{
double advance = 0.0;
double planeLeft = 0.0;
double planeTop = 0.0;
double planeRight = 0.0;
double planeBottom = 0.0;
double atlasLeft = 0.0;
double atlasTop = 0.0;
double atlasRight = 0.0;
double atlasBottom = 0.0;
bool hasBounds = false;
};
std::string fontId;
std::filesystem::path imagePath;
std::filesystem::path jsonPath;
unsigned width = 0;
unsigned height = 0;
double ascender = -0.9;
double descender = 0.25;
double lineHeight = 1.2;
std::vector<unsigned char> rgbaPixels;
std::map<unsigned, Glyph> glyphsByCodepoint;
};
class FontAtlasBuilder
@@ -44,6 +66,8 @@ public:
private:
std::filesystem::path PackageCacheDirectory(const ShaderPackage& shaderPackage) const;
bool LoadAtlasJson(FontAtlasBuildOutput& output, std::string& error) const;
bool LoadAtlasImage(FontAtlasBuildOutput& output, std::string& error) const;
static std::string SanitizePathToken(const std::string& value);
static bool RunProcess(const std::string& commandLine, const std::filesystem::path& workingDirectory, std::string& error);