geomerative
public class RFont extends java.lang.Object implements processing.core.PConstants
Modifier and Type | Field and Description |
---|---|
int |
align
The alignment of the font.
|
boolean |
forceAscii
Should we try to use ASCII, rather than Unicode?
|
int |
size
The point size of the font.
|
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_RETINA_PIXELS, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_RETINA_PIXELS, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPHERE, SPOT, SQUARE, SUBTRACT, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z
Constructor and Description |
---|
RFont(java.lang.String fontPath) |
RFont(java.lang.String fontPath,
int size) |
RFont(java.lang.String fontPath,
int size,
int align)
The constructor of the RFont object.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(char character) |
void |
draw(char character,
processing.core.PApplet g)
Use this method to draw a character on a certain canvas.
|
void |
draw(char character,
processing.core.PGraphics g)
Use this method to draw a character on a certain canvas.
|
void |
draw(java.lang.String text) |
void |
draw(java.lang.String text,
processing.core.PApplet g)
Use this method to draw a character on a certain canvas.
|
void |
draw(java.lang.String text,
processing.core.PGraphics g)
Use this method to draw a character on a certain canvas.
|
java.lang.String |
getFamily() |
float |
getLineSpacing() |
void |
setAlign(int align)
Use this method to reset the alignment of the font.
|
void |
setSize(int size)
Use this method to reset the point size of the font.
|
RGroup |
toGroup(java.lang.String text)
Use this method to get the outlines of a string in the form of an RGroup.
|
RPolygon |
toPolygon(char character)
Use this method to get the outlines of a character in the form of an RPolygon.
|
RShape |
toShape(char character)
Use this method to get the outlines of a character in the form of an RShape.
|
RShape |
toShape(java.lang.String text) |
public int size
public int align
public boolean forceAscii
public RFont(java.lang.String fontPath, int size, int align) throws java.lang.RuntimeException
fontPath
- String, the name of the TrueType Font file which should be situated in the data folder of the sketch.size
- int, the point size of the font in points.align
- int, this can only take the following values: RFont.LEFT, RFont.CENTER and RFont.RIGHT.java.lang.RuntimeException
public RFont(java.lang.String fontPath, int size) throws java.lang.RuntimeException
java.lang.RuntimeException
public RFont(java.lang.String fontPath) throws java.lang.RuntimeException
java.lang.RuntimeException
public void setSize(int size)
size
- int, the point size of the font in points.public float getLineSpacing()
public void setAlign(int align) throws java.lang.RuntimeException
align
- int, this can only take the following values: RFont.LEFT, RFont.CENTER and RFont.RIGHT.java.lang.RuntimeException
public java.lang.String getFamily()
public RShape toShape(char character)
character
- char, the character we want the outline from.public RPolygon toPolygon(char character)
character
- char, the character we want the outline from.public RGroup toGroup(java.lang.String text) throws java.lang.RuntimeException
text
- String, the string we want the outlines from.java.lang.RuntimeException
public RShape toShape(java.lang.String text) throws java.lang.RuntimeException
java.lang.RuntimeException
public void draw(char character, processing.core.PGraphics g) throws java.lang.RuntimeException
character
- the character to be drawng
- the canvas where to drawjava.lang.RuntimeException
public void draw(java.lang.String text, processing.core.PGraphics g) throws java.lang.RuntimeException
text
- the string to be drawng
- the canvas where to drawjava.lang.RuntimeException
public void draw(char character, processing.core.PApplet g) throws java.lang.RuntimeException
character
- char, the character to be drawng
- the canvas where to drawjava.lang.RuntimeException
public void draw(java.lang.String text, processing.core.PApplet g) throws java.lang.RuntimeException
text
- the string to be drawng
- the canvas where to drawjava.lang.RuntimeException
public void draw(java.lang.String text) throws java.lang.RuntimeException
java.lang.RuntimeException
public void draw(char character) throws java.lang.RuntimeException
java.lang.RuntimeException
Geomerative by Ricard Marxer, http://www.ricardmarxer.com/geomerative/