有谁知道如何使用 text() 将一段文本斜体化;命令?我正在使用 Processing.JS(更具体地说,在可汗学院)编写我的代码。
问问题
750 次
3 回答
0
尝试使用以下命令
var str = "Hello World!";
var result = str.italics();
于 2015-05-03T23:25:38.030 回答
0
根据processing.js 文档,看起来您可以根据初始化它的 .ttf 文件使用斜体文本。因此,只需下载斜体 ttf 字体并执行以下操作:
PFont font;
font = loadFont("italic-webdings.ttf") // whatever the name of your italic ttf file is
textFont(font);
String s = "The quick brown fox jumped over the lazy dog.";
text(s, 15, 20, 70, 70);
于 2015-05-03T23:29:13.167 回答
0
您可以使用的 KA 方式
textFont(createFont("brush script ms italic"));
是最接近斜体的字体。
于 2015-08-23T23:53:46.373 回答