문제

Processing.js documentation does not explain how you use a web-safe font with bold style. I have already tried loadFont("tahoma_bold.ttf") placing a font I downloaded on the same folder as the script (/project/main.js and /project/tahoma_bold.ttf). I have also tried /project/data/tahoma_bold.ttf. How do you do it?

도움이 되었습니까?

해결책

Hey so I ran into a similar problem a couple of months ago when I tried the same thing but a little more complicated since I was running it in a web2py page. Here's the link to my answer for that.

And here is the simple answer I can think of for your question: instead of doing a loadfont, try:

textFont(createFont("/tahoma_bold.ttf",14));

One of two things will happen. If it works, congrats! If not, you need to add or remove parts of the path (try messing with backslashes) because it's likely the font can't be found. If you get some sort of result and comment back, I can keep helping you figure this one out.

Hope it works!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top