首页 > 文档 > textLeading()文本像素行距
2017
07-15

textLeading()文本像素行距

textLeading()

 

例子

textLeading()文本像素行距 - 第1张  | Processing编程艺术// 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()



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。