changeset 413:8fb4387b2ea1

add: packed textures for font-atlas
author Sam <sam@basx.dev>
date Sat, 20 Jan 2024 21:36:41 +0700
parents 262e771e2573
children 0deefe1c8af6
files semicongine/resources/font.nim tests/test_font.nim
diffstat 2 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/resources/font.nim	Sat Jan 20 21:28:17 2024 +0700
+++ b/semicongine/resources/font.nim	Sat Jan 20 21:36:41 2024 +0700
@@ -77,7 +77,6 @@
     else:
       images.add empty_image
 
-
     free(data)
 
   let packed = pack(images)
--- a/tests/test_font.nim	Sat Jan 20 21:28:17 2024 +0700
+++ b/tests/test_font.nim	Sat Jan 20 21:36:41 2024 +0700
@@ -12,7 +12,7 @@
   # var font = loadFont("DejaVuSans.ttf", lineHeightPixels=90'f32, charset="abcdefghijklmnopqrstuvwxyz ".toRunes)
   var font = loadFont("DejaVuSans.ttf", lineHeightPixels=180'f32)
   var textbox = initText(32, font, "", color=newVec4f(1, 0, 0, 1))
-  let fontscale = 0.001
+  let fontscale = 0.002
   scene.add textbox
   textbox.mesh.transform = scale(fontscale, fontscale)
   engine.loadScene(scene)