/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #include #include #include "Scene/Texture.hpp" #include "msdfgen.h" #include "msdfgen-ext.h" #include "msdf-atlas-gen/msdf-atlas-gen.h" namespace OpenVulkano::Scene { using namespace msdfgen; using namespace msdf_atlas; using namespace OpenVulkano::Scene; struct GlyphInfo { GlyphGeometry geometry; GlyphBox glyphBox; Texture texture; }; class FontAtlasGenerator { public: void GenerateAtlas(const std::string& fontFile, const std::string& outputFile, const Charset& = Charset::ASCII); std::map& GetAtlasInfo() { return m_symbols; } private: std::pair GetHandlers(const std::string& fontFile); private: ImmediateAtlasGenerator> m_generator; std::map m_symbols; std::string m_loadedFont; }; }