GetHeight

Returns the height of a font. The height is measured as the space between the font baseline and cap height.

Syntax

Returns

Returns the font's height.

Example

window=Window:Create()
context=Context:Create(window)
font = Font:Load("Fonts/arial.ttf",36)
context:SetFont(font)


while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end

context:SetColor(0,0,0)
context:Clear()
context:SetColor(1,1,1)

--Display some centered text
local text = "Leadwerks"
local screenwidth = window:GetWidth()
local screenheight = window:GetHeight()
local x = (screenwidth - font:GetTextWidth(text))/2
local y = (screenheight - font:GetHeight())/2

context:SetBlendMode(Blend.Alpha)
context:DrawText(text,x,y)
context:SetBlendMode(Blend.Solid)

context:Sync()
end