2
0
John Dodis 1 жил өмнө
parent
commit
d0f1f3eb1e
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      ui2d/ui2d.lua

+ 4 - 1
ui2d/ui2d.lua

@@ -673,7 +673,10 @@ function UI2D.ResetColor( col_name )
 end
 
 function UI2D.SetFontSize( size )
-	font.handle = lovr.graphics.newFont( "ui2d/" .. "DejaVuSansMono.ttf", size, 4 )
+	local info = debug.getinfo( 1, "S" )
+	local lib_path = info.source:match( "@(.*[\\/])" )
+
+	font.handle = lovr.graphics.newFont( lib_path .. "DejaVuSansMono.ttf", size, 4 )
 	font.handle:setPixelDensity( 1.0 )
 	font.h = font.handle:getHeight()
 	font.w = font.handle:getWidth( "W" )