调整字体相关的一些东西

整理代码
This commit is contained in:
MrZ626
2021-08-29 16:08:51 +08:00
parent 16c377427a
commit bd9ee49255
6 changed files with 39 additions and 35 deletions

View File

@@ -1,4 +1,5 @@
local gc=love.graphics
local set=gc.setFont
local fontCache={}
local currentFontSize
@@ -8,7 +9,7 @@ function FONT.set(s)
if not fontCache[s]then
fontCache[s]=gc.setNewFont(s,'light',gc.getDPIScale()*SCR.k*2)
end
gc.setFont(fontCache[s])
set(fontCache[s])
currentFontSize=s
end
end
@@ -33,7 +34,7 @@ function FONT.init(mainFont,secFont)
fontCache[s]=gc.setNewFont(mainFont,s,'light',gc.getDPIScale()*SCR.k*2)
fontCache[s]:setFallbacks(gc.setNewFont(secFont,s,'light',gc.getDPIScale()*SCR.k*2))
end
gc.setFont(fontCache[s])
set(fontCache[s])
currentFontSize=s
end
end