Fix font drawing
Previously did not apply specified fonts, only used them for measurements.
This commit is contained in:
parent
1dda9c258a
commit
34ea0a7d63
|
@ -40,7 +40,13 @@ drawSystem(
|
||||||
"drawText",
|
"drawText",
|
||||||
{ position = T.XyPair, drawAsText = { text = T.str, style = Maybe(T.str), font = Maybe(T.FontData) } },
|
{ position = T.XyPair, drawAsText = { text = T.str, style = Maybe(T.str), font = Maybe(T.FontData) } },
|
||||||
function(e)
|
function(e)
|
||||||
local font = e.drawAsText.font or gfx.getFont() -- e.drawAsText.font or AshevilleSans14Bold
|
local font
|
||||||
|
if e.drawAsText.font then
|
||||||
|
font = e.drawAsText.font
|
||||||
|
gfx.setFont(font)
|
||||||
|
else
|
||||||
|
font = gfx.getFont()
|
||||||
|
end
|
||||||
local textHeight = font:getHeight()
|
local textHeight = font:getHeight()
|
||||||
local textWidth = font:getWidth(e.drawAsText.text)
|
local textWidth = font:getWidth(e.drawAsText.text)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue