





function GHU_Font(_fontPath,_height,_shadow,_color,_outline,_thickOutline,_monochrome)
	local class = GHClass("GHU_Font");
		
	-- input validation
	assert(not(_fontPath) or type(_fontPath)=="string","FontPath must be a string.",_fontPath);
	assert(not(_height) or type(_height)=="number","Height must be a number.",_height);
	assert(not(_shadow) or type(_shadow)=="table","Shadow must be a tabe.",_shadow);
	assert(not(_color) or type(_color)=="table","Color must be a table.",_color);
	assert(not(_outline) or type(_outline)=="boolean","Outline must be a boolean.",_outline);
	assert(not(_thickOutline) or type(_thickOutline)=="boolean","ThickOutline must be a boolean.",_thickOutline);
	assert(not(_monochrome) or type(_monochrome)=="boolean","Monochrome must be a boolean.",_monochrome);
	
	-- detailed validation
	if _color then
		assert(type(_color.r)=="number" and type(_color.g) == "number" and type(_color.b)=="number" ,"Color must be specified as a table with color.r, color.g and color.b as value.",_color);
	end
	if _shadow then
		local s = "Shadow must be specified as a table with color.r, color.g, color.b and color.a as color value and shadow.x, shadow.y as offset value.";
		assert(type(_shadow.r)=="number" and type(_shadow.g) == "number" and type(_shadow.b)=="number" and type(_shadow.a)=="number",s,_shadow);
		assert(type(_shadow.x)=="number" and type(_shadow.y) == "number",s,color);
	end
	
	
	
	-- Setup
	local fontPath 			= _fontPath				or "Fonts\\FRIZQT__.TTF";
	local height 				= _height					or 11;
	local shadow 				= _shadow					or {x=1,y=-1,r=0.4,g=0.4,b=0.4,a=0.75}; 
	local color 				= (not(_color) and {r=0,g=0,b=0,a=1}) or {r=_color.r,	g=_color.g,	b=_color.b,	a = _color.a or 1}; 
	local outline 			= _outline 				or false; 	
	local thickOutline	= _thickOutline 	or false; 
	local monochrome 		= _monochrome 		or false;
	
	-- Create a string with flags
	local flags = "";
	if outline then flags = flags .."OUTLINE, "; end
	if thickOutline then flags = flags.."THICKOUTLINE, "; end
	if monochrome then flags = flags.."MONOCHROME, "; end
	
	if flags:len() > 0 then flags = flags:sub(0,flags:len()-2) end
	
	
	--	*************************************************************************   
	--														Functions
	--  *************************************************************************  
 
	
	-- _function for comparing with another font class
	class.IsSame = function(self,other) 
		local res = true;
		res = res and (self:GetType()					== other:GetType());		
		res = res and (self:GetHeight() 			== other:GetHeight());
		res = res and (self:GetPath() 				== other:GetPath());
		for i=1,4 do res = res and (({self:GetShadowColor()})[i] 		== ({other:GetShadowColor()})[i]); 	end
		for i=1,2 do res = res and (({self:GetShadowOffset()})[i] 	== ({other:GetShadowOffset()})[i]); end
		for i=1,4 do res = res and (({self:GetColor()})[i] 					== ({other:GetColor()})[i]); 				end
		res = res and (self:IsOutline()				== other:IsOutline());
		res = res and (self:IsThickOutline()	== other:IsThickOutline());
		res = res and (self:IsMonochrome() 		== other:IsMonochrome());
		return res;
	end
	
	-- Get functions
	class.GetHeight 			= function(self) return height end
	class.GetPath 				= function(self) return fontPath end
	class.GetShadowColor 	= function(self) return shadow.r,shadow.g,shadow.b,shadow.a; end
	class.GetShadowOffset = function(self) return shadow.x,shadow.y; end
	class.GetColor 				= function(self) return color.r,color.g,color.b,color.a; end
	class.IsOutline 			= function(self) return outline; end
	class.IsThickOutline 	= function(self) return thickOutline; end
	class.IsMonochrome 		= function(self) return monochrome; end
	
	class.GetFont 				= function(self) return fontPath,height,flags; end
	
	class.ApplyFont = function(self,textObj)
		assert(type(textObj)=="table" and textObj.GetObjectType and (textObj:GetObjectType() == "EditBox" or textObj:GetObjectType() == "FontString"),"TextObj must be either an Editbox or a FontString widget object got "..textObj:GetObjectType() );
		
		textObj:SetFont(fontPath,height,flags);
		
		textObj:SetShadowColor(shadow.r,shadow.g,shadow.b,shadow.a);
		textObj:SetShadowOffset(shadow.x,shadow.y);
		
		textObj:SetTextColor(color.r,color.g,color.b,color.a);
		
		
	end
	
	
	return class;
end

