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 (日本語)}}
== 関数 ==
Create a new BMFont or TrueType font.
=== 概要 ===
<source lang="lua">
font = love.graphics.newFont( filename )
</source>
=== 引数 ===
{{param (日本語)|string|filename|The filepath to the BMFont or TrueType font file.}}
=== 返値 ===
{{param (日本語)|Font|font|A Font object which can be used to draw text on screen.}}
=== 注釈 ===
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.

== 関数 ==
Create a new TrueType font.
=== 概要 ===
<source lang="lua">
font = love.graphics.newFont( filename, size, hinting )
</source>
=== 引数 ===
{{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}}
=== 返値 ===
{{param (日本語)|Font|font|A Font object which can be used to draw text on screen.}}

== 関数 ==
Create a new BMFont.
=== 概要 ===
<source lang="lua">
font = love.graphics.newFont( filename, imagefilename )
</source>
=== 引数 ===
{{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.}}
=== 返値 ===
{{param (日本語)|Font|font|A Font object which can be used to draw text on screen.}}

== 関数 ==
Create a new instance of the default font (Vera Sans) with a custom size.
=== 概要 ===
<source lang="lua">
font = love.graphics.newFont( size, hinting )
</source>
=== 引数 ===
{{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}}
=== 返値 ===
{{param (日本語)|Font|font|A Font object which can be used to draw text on screen.}}

== 用例 ==
=== 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>

== 関連 ==
* [[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}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.newFont}}