controlP5
Class ControlFont
java.lang.Object
controlP5.ControlFont
public class ControlFont
- extends java.lang.Object
A ControlFont is a container for a PFont that can be used to customize the font of a label. (Designing the Font handling gave me a big
headache, especially when it comes to calculating the dimensions of a font which are not available at all times but only at certain
times. The current status I suppose is a good compromise and works for standard font handling cases. For any special cases it will be
difficult to convince me to make any changes.)
Field Summary |
static boolean |
DEBUG
|
static boolean |
RENDER_2X
set the RENDER_2X variable to true to double render text, this makes the font look bolder especially in OpenGL mode. |
Constructor Summary |
ControlFont(processing.core.PFont theFont)
|
ControlFont(processing.core.PFont theFont,
int theFontSize)
|
ControlFont(processing.core.PFont theFont,
int theFontSize,
int theLineHeight)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
public static boolean DEBUG
RENDER_2X
public static boolean RENDER_2X
- set the RENDER_2X variable to true to double render text, this makes the font look bolder especially in OpenGL mode. use:
ControlFont.RENDER_2X = true;
ControlFont
public ControlFont(processing.core.PFont theFont)
ControlFont
public ControlFont(processing.core.PFont theFont,
int theFontSize)
ControlFont
public ControlFont(processing.core.PFont theFont,
int theFontSize,
int theLineHeight)
adjust
public void adjust(processing.core.PApplet theApplet,
Label theLabel)
draw
public void draw(ControlP5 c,
Label theLabel)
getBaseline
public int getBaseline()
getBottom
public int getBottom()
getCenter
public int getCenter()
getFont
public processing.core.PFont getFont()
getHeight
public int getHeight()
getOffset
public int getOffset(int theIndex)
getOverflow
public int getOverflow()
getSize
public int getSize()
getTextHeight
public int getTextHeight()
getTop
public int getTop()
getWidth
public int getWidth()
getWidthFor
public static int getWidthFor(java.lang.String theText,
Label theLabel,
processing.core.PApplet theApplet)
init
public void init(Label theLabel)
normal
public static void normal()
- sets the rendering of a PFont back to normal and single rendering.
setSize
public void setSize(int theSize)
sharp
public static void sharp()
- renders a PFont twice for better and sharper readability
processing library controlP5 by Andreas Schlegel. (c) 2006-2012