Golden rules change
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user