0

i know quite quell processing.org, in java. and i like it. from a little bit i have done some work with html, javascript, css, jquery, d3.js. i wan surprised how nicly and easily i can style my stuffs: with css. and i incredibly love it. do the code, and style the visual output. forget bad headache trying to code some nice draw elements, manage different color, font, margin and floats between gui elements.

now, just for give it a try, i'm figure how to syle a processing.org font?

ps i'm using processing.js from pure js code as described here

nkint
  • 11,513
  • 31
  • 103
  • 174

1 Answers1

1

Declare your own css @font-face rule, with some font-family name like "ABCXYZ" and then in the sketch code use a var pfont = createFont("ABCXYZ",[size]); call to set up your font and then apply it like any other using textFont(pfont)

Mike 'Pomax' Kamermans
  • 49,297
  • 16
  • 112
  • 153
  • perfect! i'm using processing in plain javascript not importing it in global namespace so i have to use processing.createfont() and processin.text() but it works! – nkint Feb 23 '13 at 15:18
  • var p = new Processing([canvas reference]); p.setup = function() { p.textFont(p.createFont("ABCXYZ",12)); [...] }; p.draw() = function() { ... }; p.setup(); – Mike 'Pomax' Kamermans Feb 23 '13 at 15:30