font-update

This commit is contained in:
a.pilote
2021-08-23 06:27:28 -04:00
parent 69fd08d941
commit eb69e6db0f
4 changed files with 11 additions and 8 deletions

View File

@@ -72,5 +72,6 @@ project "Freetype"
symbols "on"
filter "configurations:Release"
files { "freetype/src/base/ftdebug.c" }
runtime "Release"
optimize "on"

View File

@@ -40,9 +40,7 @@ namespace Nuake {
for (auto e : camView)
{
auto [transform, camera] = camView.get<TransformComponent, CameraComponent>(e);
//
Matrix4 cameraTransform = camera.CameraInstance->GetTransformRotation();
}
auto transformView = m_Scene->m_Registry.view<ParentComponent, TransformComponent>();
@@ -63,6 +61,8 @@ namespace Nuake {
globalPosition += transformComponent.Translation;
globalRotation += transformComponent.Rotation;
globalScale *= transformComponent.Scale;
parentComponent = parentComponent.Parent.GetComponent<ParentComponent>();
}
transform.GlobalTranslation = globalPosition + transform.Translation;

View File

@@ -67,12 +67,13 @@ namespace Nuake
~Font()
{
if (ft)
{
if (font)
msdfgen::destroyFont(font);
msdfgen::deinitializeFreetype(ft);
}
if (!ft)
return;
if (font)
msdfgen::destroyFont(font);
msdfgen::deinitializeFreetype(ft);
}
bool load(const char* fontFilename)

View File

@@ -123,6 +123,7 @@ FontHandle * loadFont(FreetypeHandle *library, const char *filename) {
return NULL;
FontHandle *handle = new FontHandle;
FT_Error error = FT_New_Face(library->library, filename, 0, &handle->face);
if (error) {
delete handle;
return NULL;