We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › controlP5 Textarea font size
Page Index Toggle Pages: 1
controlP5 Textarea font size (Read 1825 times)
controlP5 Textarea font size
May 22nd, 2009, 8:50pm
 
Using controlP5 for GUI purposes.  I'm trying to figure out how to manipulate the font size of text within a textfield and can't seem to find any methods for doing so.  Does anyone know if this is possible?

Thanks!
Re: controlP5 Textarea font size
Reply #1 - Apr 18th, 2010, 5:23pm
 
bump
Re: controlP5 Textarea font size
Reply #2 - Apr 18th, 2010, 7:51pm
 
textarea and textfield are controllers that dont work with ControlFont which allows you to use PFonts instead of the default pixelfont used by controlP5. its on the todo list, but for now  i can only suggest to use the slightly bigger font 'grixel' within your textarea, this is how you change the bitfont:
Code:

 myTextarea.valueLabel().setFont(ControlP5.grixel);


if you want to go for a little adventure, you could create your own pixelfont. the pixelfonts used by controlP5 use a bitmap that implements the following characters (in the exact same sequence, first character being a SPACE):

!"#$%&'()*+,-./0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`

here an example bitmap (white background, black characters, red pixel used to separate characters). if you follow modify the example to your needs, creating your own pixelfont for controlP5 should go smoothly.
and this is how you would load the pixelfont into controlP5 (assuming 'yourFont.gif' is located in the data folder of your sketch)
Code:

 int index = Label.bitFontRenderer.addBitFont(loadImage("yourFont.gif"));
 myTextarea.valueLabel().setFont(index);

let me know if this works for you. best,
andreas
Page Index Toggle Pages: 1