Set an already-loaded [[Font]] as the current font or create and load a new one from the file and size.

It's recommended that [[Font]] objects are created with [[love.graphics.newFont]] in the loading stage and then passed to this function in the drawing stage.

== 関数 ==
=== 概要 ===
<source lang="lua">
love.graphics.setFont( font )
</source>
=== 引数 ===
{{param (日本語)|Font|font|The Font object to use.}}
=== 返値 ===
ありません。

== 関数 ==
{{oldin (日本語)|[[0.8.0 (日本語)|0.8.0]]|080|type=異形}}
=== 概要 ===
<source lang="lua">
love.graphics.setFont( filename, size )
</source>
=== 引数 ===
{{param (日本語)|string|filename|The filepath to the font.}}
{{param (日本語)|number|size (12)|The size of the font.}}
=== 返値 ===
ありません。
== 関数 ==
{{oldin (日本語)|[[0.8.0 (日本語)|0.8.0]]|080|type=異形}}
This variant creates a new font using the default font and the size specified, and sets it as the current font. '''Do not use this function in [[love.update]] or [[love.draw]].''' That would create a new font every frame, eating up memory very quickly.
=== 概要 ===
<source lang="lua">
love.graphics.setFont( size )
</source>
=== 引数 ===
{{param (日本語)|number|size (12)|The size of the font.}}
=== 返値 ===
ありません。
== 用例 ==
=== Draw some text with default font, 18px ===
<source lang="lua">
function love.graphics.load()
  love.graphics.setFont(love.graphics.newFont(18))
end

function love.draw()
	love.graphics.print("Hello", 300, 300)
end
</source>

=== Draw some text with custom font, 18px ===
<source lang="lua">
function love.load()
    Font = love.graphics.newFont("font.ttf", 18)
end

function love.draw()
    love.graphics.setFont(Font)
    love.graphics.print("Hello World", 0, 0)
end
</source>
== 関連 ==
* [[parent::love.graphics (日本語)]]
* [[love.graphics.newFont (日本語)]]
* [[love.graphics.getFont (日本語)]]
[[Category:Functions (日本語)]]
{{#set:Description=Set an already-loaded Font as the current font.}}
{{#set:Since=000}}
{{#set:Sub-Category=State (日本語)}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.setFont}}