HE_Mesh  5.1.0
geomerative.RFont Class Reference
+ Inheritance diagram for geomerative.RFont:

Public Member Functions

 RFont (String fontPath, int size) throws RuntimeException
 
 RFont (String fontPath) throws RuntimeException
 
float getLineSpacing ()
 
String getFamily ()
 
RShape toShape (String text) throws RuntimeException
 
void draw (String text) throws RuntimeException
 
void draw (char character) throws RuntimeException
 

Public Attributes

boolean forceAscii = false
 

Static Protected Member Functions

static RShape getContourAsShape (Glyph glyph, int startIndex, int count)
 
static RShape getContourAsShape (Glyph glyph, int startIndex, int count, float xadv)
 
static RShape getGlyphAsShape (Font font, Glyph glyph, int glyphIndex)
 
static RShape getGlyphAsShape (Font font, Glyph glyph, int glyphIndex, float xadv)
 
static RShape getGlyphAsShape (Font font, Glyph glyph, int glyphIndex, SingleSubst arabInitSubst, SingleSubst arabMediSubst, SingleSubst arabTermSubst)
 
static RShape getGlyphAsShape (Font font, Glyph glyph, int glyphIndex, SingleSubst arabInitSubst, SingleSubst arabMediSubst, SingleSubst arabTermSubst, float xadv)
 

Private Member Functions

CmapFormat getCmapFormat ()
 

Static Private Member Functions

static float midValue (float a, float b)
 

Related Functions

(Note that these are not member functions.)

int size = DEFAULT_SIZE
 
int align = DEFAULT_ALIGN
 
 RFont (String fontPath, int size, int align) throws RuntimeException
 
void setSize (int size)
 
void setAlign (int align) throws RuntimeException
 
RShape toShape (char character)
 
RPolygon toPolygon (char character)
 
RGroup toGroup (String text) throws RuntimeException
 
void draw (char character, PGraphics g) throws RuntimeException
 
void draw (String text, PGraphics g) throws RuntimeException
 
void draw (char character, PApplet g) throws RuntimeException
 
void draw (String text, PApplet g) throws RuntimeException
 

Detailed Description

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 access their geometry. RFont Geometry

Constructor & Destructor Documentation

geomerative.RFont.RFont ( String  fontPath,
int  size 
) throws RuntimeException
geomerative.RFont.RFont ( String  fontPath) throws RuntimeException

Member Function Documentation

void geomerative.RFont.draw ( String  text) throws RuntimeException
void geomerative.RFont.draw ( char  character) throws RuntimeException
CmapFormat geomerative.RFont.getCmapFormat ( )
private
static RShape geomerative.RFont.getContourAsShape ( Glyph  glyph,
int  startIndex,
int  count 
)
staticprotected
static RShape geomerative.RFont.getContourAsShape ( Glyph  glyph,
int  startIndex,
int  count,
float  xadv 
)
staticprotected
String geomerative.RFont.getFamily ( )
static RShape geomerative.RFont.getGlyphAsShape ( Font  font,
Glyph  glyph,
int  glyphIndex 
)
staticprotected
static RShape geomerative.RFont.getGlyphAsShape ( Font  font,
Glyph  glyph,
int  glyphIndex,
float  xadv 
)
staticprotected
static RShape geomerative.RFont.getGlyphAsShape ( Font  font,
Glyph  glyph,
int  glyphIndex,
SingleSubst  arabInitSubst,
SingleSubst  arabMediSubst,
SingleSubst  arabTermSubst 
)
staticprotected
static RShape geomerative.RFont.getGlyphAsShape ( Font  font,
Glyph  glyph,
int  glyphIndex,
SingleSubst  arabInitSubst,
SingleSubst  arabMediSubst,
SingleSubst  arabTermSubst,
float  xadv 
)
staticprotected
float geomerative.RFont.getLineSpacing ( )
static float geomerative.RFont.midValue ( float  a,
float  b 
)
staticprivate
RShape geomerative.RFont.toShape ( String  text) throws RuntimeException

Friends And Related Function Documentation

int align = DEFAULT_ALIGN
related

The alignment of the font. This property can take the following values: RFont.LEFT, RFont.CENTER and RFont.RIGHT align ( )

void draw ( char  character,
PGraphics  g 
) throws RuntimeException
related

Use this method to draw a character on a certain canvas. RFont_draw

Parameters
characterthe character to be drawn
gthe canvas where to draw ( ) ( )
void draw ( String  text,
PGraphics  g 
) throws RuntimeException
related

Use this method to draw a character on a certain canvas. RFont_draw

Parameters
textthe string to be drawn
gthe canvas where to draw ( ) ( )
void draw ( char  character,
PApplet  g 
) throws RuntimeException
related

Use this method to draw a character on a certain canvas. RFont_draw

Parameters
characterchar, the character to be drawn
gthe canvas where to draw ( ) ( )
void draw ( String  text,
PApplet  g 
) throws RuntimeException
related

Use this method to draw a character on a certain canvas. RFont_draw

Parameters
textthe string to be drawn
gthe canvas where to draw ( ) ( )
RFont ( String  fontPath,
int  size,
int  align 
) throws RuntimeException
related

The constructor of the RFont object. Use this in order to create a font with which we will be able to draw and obtain outlines of text. RFont

Parameters
fontPathString, the name of the TrueType Font file which should be situated in the data folder of the sketch.
sizeint, the point size of the font in points.
alignint, this can only take the following values: RFont.LEFT, RFont.CENTER and RFont.RIGHT. ( ) ( ) ( ) ( ) ( )
void setAlign ( int  align) throws RuntimeException
related

Use this method to reset the alignment of the font. This property can take the following values: RFont.LEFT, RFont.CENTER and RFont.RIGHT setAlign

Parameters
alignint, this can only take the following values: RFont.LEFT, RFont.CENTER and RFont.RIGHT.
void setSize ( int  size)
related

Use this method to reset the point size of the font. setSize

Parameters
sizeint, the point size of the font in points.
int size = DEFAULT_SIZE
related

The point size of the font. size ( )

RGroup toGroup ( String  text) throws RuntimeException
related

Use this method to get the outlines of a string in the form of an RGroup. All the elements of the group will be RShapes. RFont_toGroup

Parameters
textString, the string we want the outlines from.
Returns
RGroup, the group of outlines of the character. All the elements are RShapes. ( ) ( )
RPolygon toPolygon ( char  character)
related

Use this method to get the outlines of a character in the form of an RPolygon. RFont_toPolygon

Parameters
characterchar, the character we want the outline from.
Returns
RPolygon, the outline of the character. ( ) ( ) ( )
RShape toShape ( char  character)
related

Use this method to get the outlines of a character in the form of an RShape. RFont_toShape

Parameters
characterchar, the character we want the outline from.
Returns
RShape, the outline of the character. ( ) ( ) ( )

Member Data Documentation

boolean geomerative.RFont.forceAscii = false

Should we try to use ASCII, rather than Unicode?


The documentation for this class was generated from the following file: