textLeading()
例子
// Text to display. The “\n” is a “new line” character
String lines = “L1\nL2\nL3”;
textSize(12);
fill(0); // Set fill to black
textLeading(10); // Set leading to 10
text(lines, 10, 25);
textLeading(20); // Set leading to 20
text(lines, 40, 25);
textLeading(30); // Set leading to 30
text(lines, 70, 25);
描述
以像素为单位设置文本的行距。这个设定会用在text() 函数后面的所有函数中。注意,在使用textSize() 函数时行距会被重置。例如,如果行距通过textLeading(20) 被设定为20,那么如果在后面某个节点textSize(48) 函数运行的时候,行距会被重置为文本大小的默认值即48.
语法
textLeading(leading)
参数
leading 浮点数:以像素为单位的行距
返回值
void
相关
loadFont()
text()
textFont()
textSize()
- 本文固定链接: http://iprocessing.cn/2017/07/15/textleading文本像素行距/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表