processing怎么输出中文?请指点一下..谢谢
processing吧
全部回复
仅看楼主
level 3
yu972114544 楼主
输出的中文全成了方块...
2017年04月10日 10点04分 1
level 3
yu972114544 楼主
新建了字体
写了这些:PFont font = loadFont("MicrosoftYaHei-25.vlw");
2017年04月10日 10点04分 3
level 3
yu972114544 楼主
结果说变量“font”没被引用?大概是这个意思吧..
2017年04月10日 10点04分 4
level 3
yu972114544 楼主
请大家指点一下~谢谢大家~
2017年04月10日 10点04分 5
level 6
要在调用 text( ) 写字之前,加一句:
textFont( font) ; 来切换字体。
2017年04月11日 09点04分 6
谢谢你[哈哈]~
2017年04月15日 02点04分
等等...知乎你是不是叫暗流涌动啊..
2017年04月15日 02点04分
我试了一下..加上后..连方框都没了.彻底没文字了[泪]
2017年04月15日 08点04分
@yu972114544 你把代码发出来吧。
2017年04月15日 15点04分
level 3
yu972114544 楼主
void setup() {
size(400, 400);
}
void draw() {
background(#FFEE31);
pushMatrix();
translate(200, 200 - 60);
//eyes
PVector mouse = new PVector(mouseX, mouseY);
mouse.sub(200, 200 - 60, 0);
mouse.limit(7);
fill(0);
noStroke();
rectMode(CENTER);
rect(-1*40+mouse.x, -15+mouse.y, 15, 25, 8);
if (mousePressed)
rect(40+mouse.x, -15+mouse.y, 28, 10, 5);
else
rect(40+mouse.x, -15+mouse.y, 15, 25, 8);
//mouth
noFill();
strokeWeight(12);
stroke(0);
arc(0, 0, 150, 120, PI/4, PI-PI/4);
popMatrix();
//text
//PFont font = loadFont("MicrosoftYaHei-25.vlw");
textSize(25);
textAlign(CENTER);
//textFont(font);
text("ASD~", width/2, height/2+100);
}
2017年04月17日 06点04分 8
level 1
PFont myFont;
void setup(){
size(400, 400);
myFont = createFont("fangsong", 32);
}
void draw(){
background(#FFEE31);
pushMatrix();
translate(200, 200 - 60);
//eyes
PVector mouse = new PVector(mouseX, mouseY);
mouse.sub(200, 200 - 60, 0);
mouse.limit(7);
fill(0);
noStroke();
rectMode(CENTER);
rect(-1*40+mouse.x, -15+mouse.y, 15, 25, 8);
if(mousePressed)
rect(40+mouse.x, -15+mouse.y, 28, 10, 5);
else
rect(40+mouse.x, -15+mouse.y, 15, 25, 8);
//mouth
noFill();
strokeWeight(12);
stroke(0);
arc(0, 0, 150, 120, PI/4, PI-PI/4);
popMatrix();
//text
textSize(25);
textAlign(CENTER);
textFont(myFont);
text("我爱你祖国!", width/2, height/2+100);
}
2017年06月19日 14点06分 9
level 3
请教一下,为什么我代码里依旧是乱码,却能现实出来中文呀?
2018年04月15日 14点04分 10
版本太老了,用3以上的版本吧。
2018年04月21日 03点04分
回复 十里桥◆ :谢谢回复
2018年08月03日 01点08分
level 1
在编辑窗口菜单栏中选 文件-->偏好设定-->编辑器和控制台字体中选用汉字字体,这个问题就可以得到解决。
确认以后就可以正常使用了
如图:
2020年03月26日 10点03分 13
1