-- Load definition file
font_pairs = dofile("fonts/scripts/font_definition.lua")


-- Find and return font definition by name
function GetFontDefinition(name)
	
	-- Try locate pair in table by name
	local definition = font_pairs[name]
	
	-- Check existence
	if definition == nil then
		error("Can not locate font definition with name '" .. name .. "'")
	end	
	
	return definition
end

-- Returns font family name 
function GetFontFamily(name)

	-- Get font family
	local familyName = GetFontDefinition(name).family
	
	-- Check existence
	if familyName == nil then
		error("Can not locate family name in definition '" .. name .."'. Key named 'family' probably missing")
	end
	
	return familyName
end

-- Returns font size
function GetFontSize(name)

	-- Get font size
	local fontSize = GetFontDefinition(name).size
	
	if fontSize == nil then
		error("Can not locate font size in definition '" .. name .."'. Key named 'size' probably missing")
	end 
	
	return fontSize
end