Remove old font.hpp
This commit is contained in:
parent
f71fda776d
commit
516c2129eb
2 changed files with 0 additions and 35 deletions
|
@ -1,6 +1,5 @@
|
|||
set(SRC
|
||||
include/renderer.hpp
|
||||
include/font.hpp
|
||||
include/pass.hpp
|
||||
include/shadowpass.hpp
|
||||
include/imguipass.hpp
|
||||
|
|
|
@ -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];
|
||||
}
|
Reference in a new issue