Update fonts
This commit is contained in:
parent
f15e895af5
commit
eb45f02afa
@ -5,13 +5,12 @@
|
|||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <glm/gtc/type_ptr.hpp>
|
#include <glm/gtc/type_ptr.hpp>
|
||||||
#include <codecvt>
|
|
||||||
#include <locale>
|
|
||||||
|
|
||||||
#include "shader.h"
|
#include "shader.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
#include "unicode.h"
|
||||||
|
|
||||||
namespace kek {
|
namespace kek {
|
||||||
|
|
||||||
@ -70,8 +69,6 @@ TextMetrics TextObject::getMetrics(int sizePixels) {
|
|||||||
return TextMetrics((int) (sizeRatio * offsetX), (int) (sizeRatio * offsetY), (int) (sizeRatio * width), (int) (sizeRatio * height));
|
return TextMetrics((int) (sizeRatio * offsetX), (int) (sizeRatio * offsetY), (int) (sizeRatio * width), (int) (sizeRatio * height));
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> utf32cvt;
|
|
||||||
|
|
||||||
struct RenderChar {
|
struct RenderChar {
|
||||||
float data[24];
|
float data[24];
|
||||||
|
|
||||||
@ -111,7 +108,7 @@ void TextObject::allocateBuffer(TextBlock *block, int numChars) {
|
|||||||
|
|
||||||
void TextObject::loadChars() {
|
void TextObject::loadChars() {
|
||||||
std::map<unsigned int, std::vector<RenderChar>> chars;
|
std::map<unsigned int, std::vector<RenderChar>> chars;
|
||||||
std::u32string str = utf32cvt.from_bytes(text);
|
std::u32string str = Unicode::convertStdToU32(text);
|
||||||
|
|
||||||
float x = 0, y = 0;
|
float x = 0, y = 0;
|
||||||
int lineHeight = font->getDefaultMetrics().lineHeight;
|
int lineHeight = font->getDefaultMetrics().lineHeight;
|
||||||
|
Loading…
Reference in New Issue
Block a user