|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.octo.captcha.component.image.fontgenerator.AbstractFontGenerator com.octo.captcha.component.image.fontgenerator.RandomFontGenerator
public class RandomFontGenerator
Description: Random font generator that return one of the available system's (or optionay specified) fonts, using a min and max font size. This list is formerly cleaned of OCR readable font and symbol font
Field Summary | |
---|---|
static java.lang.String[] |
defaultBadFontNamePrefixes
Prefixes of font names that are avoided by default. |
protected java.util.Random |
myRandom
|
Constructor Summary | |
---|---|
RandomFontGenerator(java.lang.Integer minFontSize,
java.lang.Integer maxFontSize)
|
|
RandomFontGenerator(java.lang.Integer minFontSize,
java.lang.Integer maxFontSize,
java.awt.Font[] fontsList)
|
|
RandomFontGenerator(java.lang.Integer minFontSize,
java.lang.Integer maxFontSize,
java.lang.String[] badFontNamePrefixes)
|
Method Summary | |
---|---|
protected java.awt.Font |
applyCustomDeformationOnGeneratedFont(java.awt.Font font)
Provides a way for children class to customize the generated font array |
protected java.awt.Font |
applyStyle(java.awt.Font font)
|
protected java.util.List |
cleanFontList(java.awt.Font[] uncheckFonts)
Create an array of fonts that is known to properly represent all the characters in requiredCharacters. |
java.lang.String[] |
getBadFontNamePrefixes()
|
java.awt.Font |
getFont()
Method from imageFromWord method to apply font to String. |
java.lang.String |
getRequiredCharacters()
|
void |
setBadFontNamePrefixes(java.lang.String[] badFontNamePrefixes)
|
void |
setRequiredCharacters(java.lang.String requiredCharacters)
|
Methods inherited from class com.octo.captcha.component.image.fontgenerator.AbstractFontGenerator |
---|
getMaxFontSize, getMinFontSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String[] defaultBadFontNamePrefixes
protected java.util.Random myRandom
Constructor Detail |
---|
public RandomFontGenerator(java.lang.Integer minFontSize, java.lang.Integer maxFontSize)
public RandomFontGenerator(java.lang.Integer minFontSize, java.lang.Integer maxFontSize, java.awt.Font[] fontsList)
public RandomFontGenerator(java.lang.Integer minFontSize, java.lang.Integer maxFontSize, java.lang.String[] badFontNamePrefixes)
Method Detail |
---|
public java.awt.Font getFont()
protected java.awt.Font applyStyle(java.awt.Font font)
protected java.awt.Font applyCustomDeformationOnGeneratedFont(java.awt.Font font)
font
-
protected java.util.List cleanFontList(java.awt.Font[] uncheckFonts)
requiredCharacters
public java.lang.String getRequiredCharacters()
public void setRequiredCharacters(java.lang.String requiredCharacters)
requiredCharacters
- a list of characters that this class must be able to representpublic java.lang.String[] getBadFontNamePrefixes()
public void setBadFontNamePrefixes(java.lang.String[] badFontNamePrefixes)
badFontNamePrefixes
- an array of font name prefixes that should be not used in generating captchas
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |