From 516c2129ebc83a7e600ce71bfa6e8ace17114589 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 21 Feb 2022 00:12:09 -0500 Subject: [PATCH] Remove old font.hpp --- engine/renderer/CMakeLists.txt | 1 - engine/renderer/include/font.hpp | 34 -------------------------------- 2 files changed, 35 deletions(-) delete mode 100755 engine/renderer/include/font.hpp diff --git a/engine/renderer/CMakeLists.txt b/engine/renderer/CMakeLists.txt index 59d5327..10feab0 100755 --- a/engine/renderer/CMakeLists.txt +++ b/engine/renderer/CMakeLists.txt @@ -1,6 +1,5 @@ set(SRC include/renderer.hpp - include/font.hpp include/pass.hpp include/shadowpass.hpp include/imguipass.hpp diff --git a/engine/renderer/include/font.hpp b/engine/renderer/include/font.hpp deleted file mode 100755 index b176e07..0000000 --- a/engine/renderer/include/font.hpp +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -constexpr auto numGlyphs = 95, maxInstances = 11395; -constexpr auto fontSize = 0; - -struct FontChar { - unsigned short x0, y0, x1, y1; - float xoff, yoff, xadvance; - float xoff2, yoff2; -}; - -struct Font { - int width, height; - int ascent, descent, gap; - FontChar sizes[2][numGlyphs]; - float ascentSizes[2]; -}; - -inline Font font; - -inline float get_string_width(std::string s) { - float t = 0.0f; - for(size_t i = 0; i < s.length(); i++) { - auto index = s[i] - 32; - - t += font.sizes[fontSize][index].xadvance; - } - - return t; -} - -inline float get_font_height() { - return font.ascentSizes[fontSize]; -}