|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgeomerative.RFont
public class RFont
RShape is a reduced interface for creating, holding and drawing text from TrueType Font files. It's a basic interpreter of TrueType fonts enabling to access any String in the form of a group of shapes. Enabling us in this way to acces their geometry.
Field Summary | |
---|---|
int |
align
The alignement of the font. |
boolean |
forceAscii
Should we try to use ASCII, rather than Unicode? |
int |
size
The point size of the font. |
Fields inherited from interface processing.core.PConstants |
---|
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MOVE, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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()
|
void |
setAlign(int align)
Use this method to reset the alignement 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)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int size
public int align
public boolean forceAscii
Constructor Detail |
---|
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
Method Detail |
---|
public void setSize(int size)
size
- int, the point size of the font in points.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 draw
java.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 draw
java.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 draw
java.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 draw
java.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
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |