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.
IndexProcessing DevelopmentLibraries,  Tool Development › ControlP5_font size()
Page Index Toggle Pages: 1
ControlP5_font size(?) (Read 2553 times)
ControlP5_font size(?)
Apr 24th, 2009, 9:20am
 
Hi guys,
I'm going crazy for 5 hours to comprise how can I change the font in the textLabel!!!

I wander across the network .. e-v-e-r-y-w-h-e-r-e!!! Shocked

The required parameter is named "TheFont" and It should be an integer. Really, What is it???Is It possible change the font's type or the font's size?I'm resigned!! Cry

Help me please  Embarrassed
Re: ControlP5_font size(?)
Reply #1 - Apr 27th, 2009, 1:46am
 
Guys.. no hope? Embarrassed
Re: ControlP5_font size(?)
Reply #2 - Apr 27th, 2009, 3:14am
 
I haven't used controlP5 yet.
I looked at controlP5 : : Textlabel : : setFont ( ) and indeed the documentation here is a bit cryptic, referring to BitFontRenderer which can't be found on the current documentation...
Searching this one with Google gives only three references: the above reference page, somebody with this class in a stack trace on this forum, and the source itself!
Looking at the latter, I see that "BitFont" means bitmap font.
We have a constant defining the number of fonts to 4, various arrays relying on this number, and four hard-coded fonts:
standard58.gif
standard56.gif
synt24.gif
GrixelKyrou9.gif
(these are images).
In the jar I have (probably old), I see the first three fonts, two very small, one larger. Not the last one which might be in the latest versions.
All this to say:
- the parameter is an int because it refers to one of the built in fonts, so currently the number must be 0 to 3;
- you have no choice of font;
- well, actually you can use your own font: you must generate the corresponding bitmap file, change and recompile this class, and update the jar. Not super flexible, but possible.

I think sojamo should remove the reference to the BitFontRenderer in the public documentation and expand a bit more on what the parameter means. Smiley

Apparently you can use the following constants as font parameter:

ControlP5.standard58
ControlP5.standard56
ControlP5.synt24
ControlP5.grixel
Re: ControlP5_font size(?)
Reply #3 - May 6th, 2009, 7:26pm
 
Grixel seems to work best for me when I want something a little larger.
Not sure if any support unicode... that would be a nice addition to the font list sajamo.
Re: ControlP5_font size(?)
Reply #4 - May 6th, 2009, 10:02pm
 
hi there, i am working on quite a few updates at the moment which  also includes the font handling. bitfonts used by controlP5 will only be able to handle ascii characters ranging from 32-126. there will be a function that easily lets you add your own bitfont-template to the bitfontlist, PFont support will be in place with these updates, too.
some controllers have been updated, checkboxes are available, radiobuttons and checkboxes can be arranged in rows and columns, some controllers will be able use image textures.
the documentation still needs a revision, more examples will be added as well as tutorials/instructions showing how to create your own custom made controllers.
if you want to take a look at the current status, let me know i can pass you a copy - these updates are not ready for an official release yet.
best,
andreas


Re: ControlP5_font size(?)
Reply #5 - May 7th, 2009, 5:31am
 
Those improvements sound great!  Textured buttons will be awesome. If the new code includes improved performance on adding items to the scroll list, I'd love to give it a pre-release run. Smiley That's my biggest issue at the moment.  I've been able to get around the unicode thing by converting it to a latin1 encoded byte[] and then back to a string before placing it into controlP5.
Re: ControlP5_font size(?)
Reply #6 - May 11th, 2009, 12:05am
 
PFont support would be great!  Smiley
Page Index Toggle Pages: 1