Skip to content

Commit 6007029

Browse files
committed
修复字体模块set之前必须手动get一次
调整报错界面和底部常驻版本号字体大小
1 parent 09b3c34 commit 6007029

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

font.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,10 @@ end
100100
function FONT.set(size,name)
101101
if not name then name=defaultFont end
102102

103-
local f=fontCache[name]
104-
if not f then return FONT.rawset(size) end
105-
f=f[size]
103+
local f=FONT.get(size,name)
106104

107105
if f~=curFont then
108-
curFont=f or FONT.get(size,name)
106+
curFont=f
109107
set(curFont)
110108
end
111109
end

init.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,7 @@ function love.errorhandler(msg)
637637
GC.scale(k)
638638
setFont(100,'_norm') gc_print(":(",100,0,0,1.2)
639639
setFont(40,'_norm') gc.printf(errorMsg,100,160,SCR.w/k-200)
640-
setFont(25,'_norm') gc.printf(err[1],100,380,SCR.w/k-200)
641-
setFont(20,'_norm')
640+
setFont(20,'_norm') gc.printf(err[1],100,380,SCR.w/k-200)
642641
GC.print(love.system.getOS().."-"..versionText.."\nScene stack:"..sceneStack,100,640)
643642
GC.print("TRACEBACK",100,430)
644643
for i=4,#err-2 do
@@ -786,8 +785,8 @@ function love.run()
786785
gc_replaceTransform(SCR.xOy_d)
787786
-- Version string
788787
gc_setColor(.9,.9,.9,.42)
789-
setFont(20,'_norm')
790-
gc_printf(versionText,-2600,-30,5200,'center')
788+
setFont(15,'_norm')
789+
gc_printf(versionText,-2600,-20,5200,'center')
791790
gc_replaceTransform(SCR.xOy_dl)
792791
local safeX=SCR.safeX/SCR.k
793792

0 commit comments

Comments
 (0)