Creates a new [[Font]] from a TrueType Font or BMFont file. Created fonts are not cached, in that calling this function with the same arguments will always create a new Font object.

All variants which accept a filename can also accept a [[Data]] object instead.

{{newobjectnotice}}
== Function ==
Create a new BMFont or TrueType font.
=== Synopsis ===
<source lang="lua">
font = love.graphics.newFont( filename )
</source>
=== Arguments ===
{{param|string|filename|The filepath to the BMFont or TrueType font file.}}
=== Returns ===
{{param|Font|font|A Font object which can be used to draw text on screen.}}
=== Notes ===
If the file is a TrueType font, it will be size 12. Use the variant below to create a TrueType font with a custom size.

== Function ==
Create a new TrueType font.
=== Synopsis ===
<source lang="lua">
font = love.graphics.newFont( filename, size, hinting )
</source>
=== Arguments ===
{{param|string|filename|The filepath to the TrueType font file.}}
{{param|number|size|The size of the font in pixels.}}
{{New feature|0.10.0|
{{param|HintingMode|hinting ("normal")|True Type hinting mode.}}
|100}}
=== Returns ===
{{param|Font|font|A Font object which can be used to draw text on screen.}}

== Function ==
Create a new BMFont.
=== Synopsis ===
<source lang="lua">
font = love.graphics.newFont( filename, imagefilename )
</source>
=== Arguments ===
{{param|string|filename|The filepath to the BMFont file.}}
{{param|string|imagefilename|The filepath to the BMFont's image file. If this argument is omitted, the path specified inside the BMFont file will be used.}}
=== Returns ===
{{param|Font|font|A Font object which can be used to draw text on screen.}}

== Function ==
Create a new instance of the default font (Vera Sans) with a custom size.
=== Synopsis ===
<source lang="lua">
font = love.graphics.newFont( size, hinting )
</source>
=== Arguments ===
{{param|number|size (12)|The size of the font in pixels.}}
{{New feature|0.10.0|
{{param|HintingMode|hinting ("normal")|True Type hinting mode.}}
|100}}
=== Returns ===
{{param|Font|font|A Font object which can be used to draw text on screen.}}

== Examples ==
=== Use newFont to draw a custom styled text ===
<source lang="lua">
-- Create a ttf file font with a custom size of 20 pixels.
mainFont = love.graphics.newFont("anyfont.ttf", 20)

function love.draw() 
	-- Setting the font so that it is used when drawning the string.
	love.graphics.setFont(mainFont)

	-- Draws "Hello world!" at position x: 100, y: 200 with the custom font applied.
	love.graphics.print("Hello world!", 100, 200)
end
</source>

== See Also ==
* [[Constructs::Font]]
* [[parent::love.graphics]]
* [[love.graphics.setFont]]
[[Category:Functions]]
[[Sub-Category::Object Creation| ]]
{{#set:Description=Creates a new [[Font]] from a TrueType Font or BMFont file.}}
{{#set:Since=000}}
== Other Languages ==
{{i18n|love.graphics.newFont}}