cn.atomtool.captcha.text.renderer.TextCharacter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of atomtool-captcha Show documentation
Show all versions of atomtool-captcha Show documentation
atomTool核心工具包,包括集合、字符串、Bean等工具类
The newest version!
package cn.atomtool.captcha.text.renderer;
import java.awt.*;
import java.awt.font.TextAttribute;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
public class TextCharacter {
private double x;
private double y;
private double width;
private double height;
private double ascent;
private double descent;
private char character;
private Font font;
private Color color;
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY() {
return y;
}
public void setY(double y) {
this.y = y;
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width = width;
}
public double getHeight() {
return height;
}
public void setHeight(double height) {
this.height = height;
}
public char getCharacter() {
return character;
}
public void setCharacter(char character) {
this.character = character;
}
public Font getFont() {
return font;
}
public void setFont(Font font) {
this.font = font;
}
public Color getColor() {
return color;
}
public void setColor(Color color) {
this.color = color;
}
public double getAscent() {
return ascent;
}
public void setAscent(double ascent) {
this.ascent = ascent;
}
public double getDescent() {
return descent;
}
public void setDescent(double descent) {
this.descent = descent;
}
public AttributedCharacterIterator iterator() {
AttributedString aString = new AttributedString(String
.valueOf(character));
aString.addAttribute(TextAttribute.FONT, font, 0, 1);
return aString.getIterator();
}
}