Processing
03 01
Font 字體
Font хнЧ
Gary told me: ----------------------If I want to know something, check the references. 蓋瑞跟我說 如果不知道怎麼做 就先去找參考(references)
http://www.processing.org/reference/PFont.html
PFont font;
Create a font 創造一個字體物件
void setup(){ size(500,500); font = loadFont("Helvetica-48.vlw"); } Load a font 載入字體
void draw(){ Font size 字體大小 textFont(font, 48); text("word", 10, 50); Content & Loc 內容跟位置 }
WHAT!!!!!!! 甚麼!!!!!!!!!!
How to fix it? 怎麼修阿?
But before that ----------You need to save your file. 在這之前 我們得先存檔
NOW We need to create a “FONT” 再來可以創建一個字體拉
Select the one you want. (also match with the code.) 選你要的(也要跟CODE裡面寫的一樣)
Select the one you want. (also match with the code.) Then Press “OK” 然後按“OK”
Inside your saved folder, there will be a “data” folder. 選你要的(也要跟CODE裡面寫的一樣)
And you will find your font file inside. 然後你就會發現你的字體檔案
Now it works! 行了
Think of how to create different fonts 想想看怎麼 可以怎麼用不同字體
也看看 “TEXT” 的功能吧
Check the text function as well file:///C:/Users/archgary/Deskto p/processing-2.0.3windows64/processing2.0.3/modes/java/reference/text _.html
PFont font01; void setup(){ background(0); size(1260,945); font01 = loadFont("Meiryo-BoldItalic-48.vlw"); }
void draw(){ textFont(font01, 48); for(int i =0; i< width; i+=105){ for(int j =0; j< height; j+=36){ //fill(map(i,0,width,0,255),map(j,0,height,0,255),100); fill(random(0,255),random(0,255),random(0,255)); text("Gary", i, j); } } }