public class Sizers
extends java.lang.Object
WordSizer implementations that you might
find useful. Right now, it's only byWeight(int, int) and
byRank(int, int).WordSizer| Constructor and Description |
|---|
Sizers() |
| Modifier and Type | Method and Description |
|---|---|
static WordSizer |
byRank(int minSize,
int maxSize)
Returns a WordSizer that sizes words by their rank.
|
static WordSizer |
byWeight(int minSize,
int maxSize)
Returns a WordSizer that sizes words by their weight, where the
"heaviest" word will be sized at
maxSize. |
public static WordSizer byWeight(int minSize, int maxSize)
maxSize.
To be specific, the font size for each word will be calculated with:
PApplet.lerp(minSize, maxSize, (float) word.weight)
minSize - the size to draw a Word with weight = 0maxSize - the size to draw a Word with weight = 1public static WordSizer byRank(int minSize, int maxSize)
maxSize.
To be specific, the font size for each word will be calculated with:
PApplet.map(wordRank, 0, wordCount, maxSize, minSize)
minSize - the size to draw the last WordmaxSize - the size to draw the first Word