|
@@ -673,7 +673,10 @@ function UI2D.ResetColor( col_name )
|
|
end
|
|
end
|
|
|
|
|
|
function UI2D.SetFontSize( size )
|
|
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.handle:setPixelDensity( 1.0 )
|
|
font.h = font.handle:getHeight()
|
|
font.h = font.handle:getHeight()
|
|
font.w = font.handle:getWidth( "W" )
|
|
font.w = font.handle:getWidth( "W" )
|