Archived
1
Fork 0

Remove old font.hpp

This commit is contained in:
Joshua Goins 2022-02-21 00:12:09 -05:00
parent f71fda776d
commit 516c2129eb
2 changed files with 0 additions and 35 deletions

View file

@ -1,6 +1,5 @@
set(SRC set(SRC
include/renderer.hpp include/renderer.hpp
include/font.hpp
include/pass.hpp include/pass.hpp
include/shadowpass.hpp include/shadowpass.hpp
include/imguipass.hpp include/imguipass.hpp

View file

@ -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];
}