changeset 874:a91219ef6ef9

add: packed textures for font-atlas
author Sam <sam@basx.dev>
date Sat, 20 Jan 2024 21:36:41 +0700
parents 1ed09c1bc79c
children a9d2f56556c5
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)