参考 textFont()

textFont()

使用 text() 函数设置字体。

第一个参数font设置字体。 "textFont() 识别一个 p5.Font 对象或一个带有系统字体名称的字符串。例如,'Courier New'

"

第二个参数size是可选的。它以以像素为单位来设置字体大小。 这与调用 textSize() 具有相同的效果。

注意:WebGL 模式仅支持加载 loadFont() 的字体。

示例

语法

textFont()
textFont(font, [size])

参数

font
对象|字符串:

字体为 p5.Font 对象或字符串。

size
数字:

字体大小以像素为单位。

Notice any errors or typos? Please let us know. Please feel free to edit src/typography/loading_displaying.js and open a pull request!

相关参考