- 해결
- PDE (Processing Development Environment) 에서 제공하는 CreatFont 기능을 사용합니다.
- 예제
- PDE 를 실행한다.
- 프로젝트를 저장합니다. (저장하지 않고 실행할시 폰트파일이 만들어지지 않음.)
- PDE 메뉴의 Tools -> CreatFont 선택.
- 그림 1-1 과 같은 창이 뜨면 원하는 폰트를 선택한후 OK 버튼을 클릭합니다. 이때, Filename을 기억하고 있어야 합니다.
- 위 그림 1-1 경우 ArialMT-36.vlw 파일이 프로젝트 폴더의 data 폴더 안에 생성됩니다.
- 예제 코드
PFont f; // STEP 2 Declare PFont variable
void setup() {
size(200,200);
f = loadFont( "ArialMT-36.vlw " ); // STEP 3 Load Font
}
void draw() {
background(255);
textFont(f,16); // STEP 4 Specify font to be used
fill(0); // STEP 5 Specify font color
text ( " Mmmmm... Strings ... " ,10,100); // STEP 6 Display Text
}
- Eclipse 예제 코드
package test;
import processing.core.*;
import processing.opengl.*;
public class MyProcessingSketch extends PApplet{
private float a ;
private PFont f ;
private float _x = 0.0f;
private float _y = 0.0f;
public MyProcessingSketch()
{
}
public void setup()
{
size(800, 600,OPENGL);
f = loadFont("asset/YGO550-48.vlw");
}
public void draw() {
background(255);
fill(0) ;
textFont(f,16) ;
textAlign(CENTER) ;
rotateX(radians(_x)) ;
translate(width/2, height/2) ;
text("이",10*cos(radians(_x)),10*sin(radians(_x))) ;
_x++ ;
}
}
'프로그래밍 > Processing' 카테고리의 다른 글
| Processing JMyron can't find dependent libraries 오류 발생 해결 (3) | 2010/04/02 |
|---|---|
| Processing & Eclipse - 비디오(video) 출력하기 (1) | 2010/03/18 |
| Processing - 원하는 폰트 Eclipse에서 사용하기 (0) | 2010/03/17 |
| Processing 이클립스(Eclipse)에서 사용하기 (0) | 2010/03/17 |
TAG processing



