Code: Select all
function love.load()
Font = love.graphics.setNewFont(50)
colors = {
height = {230, 159, 0},
ascent = {0, 158, 115},
descent = {213, 94, 0},
baseline = {86, 180, 223},
}
end
function love.draw()
love.graphics.setColor(colors.height)
love.graphics.rectangle('fill', 200*0, 0, 200, Font:getHeight())
love.graphics.setColor(colors.ascent)
love.graphics.rectangle('fill', 200*1, Font:getBaseline()-Font:getAscent(), 200, Font:getAscent())
love.graphics.setColor(colors.descent)
love.graphics.rectangle('fill', 200*2, Font:getBaseline(), 200, -Font:getDescent())
love.graphics.setColor(colors.baseline)
love.graphics.rectangle('fill', 200*3, 0, 200, Font:getBaseline())
love.graphics.setColor(255, 255, 255)
love.graphics.printf('abcdefghijklmnopqrstuvwxyz', 0, 0, 800, 'center')
love.graphics.setColor(colors.height)
love.graphics.print('\n\nFont:getHeight() : '..Font:getHeight(), 0, 0)
love.graphics.setColor(colors.ascent)
love.graphics.print('\n\n\nFont:getAscent() : '..Font:getAscent(), 0, 0)
love.graphics.setColor(colors.descent)
love.graphics.print('\n\n\n\nFont:getDescent() : '..Font:getDescent(), 0, 0)
love.graphics.setColor(colors.baseline)
love.graphics.print('\n\n\n\n\nFont:getBaseline() : '..Font:getBaseline(), 0, 0)
love.graphics.setColor(200, 200, 200)
love.graphics.print('\n\n\n\n\n\nFont:hasGlyph("Ö") : '..tostring(Font:hasGlyph('Ö')), 0, 0)
love.graphics.print('\n\n\n\n\n\n\nFont:hasGlyph("ã®") : '..tostring(Font:hasGlyph('ã®')), 0, 0)
end
This displays some renderer info:
Code: Select all
function love.draw()
love.graphics.print("love.graphics.getRendererInfo('name'): "..love.graphics.getRendererInfo('name'), 20, 20)
love.graphics.print("love.graphics.getRendererInfo('version'): "..love.graphics.getRendererInfo('version'), 20, 40)
love.graphics.print("love.graphics.getRendererInfo('vendor'): "..love.graphics.getRendererInfo('vendor'), 20, 60)
love.graphics.print("love.graphics.getRendererInfo('device'): "..love.graphics.getRendererInfo('device'), 20, 80)
end