diff src/scripts/graphics.lua @ 432:c7509699cbc6

newFont and setFont now have a default size argument once again
author Bart van Strien <bart@bartbes.ath.cx>
date Fri, 05 Nov 2010 08:14:34 +0100
parents 9c169e17f6b7
children 150b94a9f11f
line wrap: on
line diff
--- a/src/scripts/graphics.lua	Sat Oct 23 14:09:17 2010 -0400
+++ b/src/scripts/graphics.lua	Fri Nov 05 08:14:34 2010 +0100
@@ -1245,23 +1245,23 @@
 ]]
 
 	love.graphics.newFont = function(font, size)
-		if type(font) == "number" then
+		if type(font) == "number" or not font then
 			size = font
 			font = love.filesystem.newFileData(vera_ttf_b64, "Vera.ttf", "base64")
 		end
-		return love.graphics.newFont1(font, size)
+		return love.graphics.newFont1(font, size or 12)
 	end
 
 	love.graphics.setFont = function(font, size)
-		if type(font) == "number" then
+		if type(font) == "number" or not font then
 			size = font
 			font = love.filesystem.newFileData(vera_ttf_b64, "Vera.ttf", "base64")
 		end
-		return love.graphics.setFont1(font, size)
+		return love.graphics.setFont1(font, size or 12)
 	end
 
 	love.graphics.print = function (...)
-		if not love.graphics.getFont() then 
+		if not love.graphics.getFont() then
 			love.graphics.setFont(12)
 		end
 		love.graphics.print1(...)
@@ -1269,7 +1269,7 @@
 	end
 
 	love.graphics.printf = function (...)
-		if not love.graphics.getFont() then 
+		if not love.graphics.getFont() then
 			love.graphics.setFont(12)
 		end
 		love.graphics.printf1(...)