public class ArtWord extends CanvasBase
| 限定符和类型 | 方法和说明 |
|---|---|
ArtWord |
clone()
克隆Div
|
void |
draw(DrawContext ctx)
绘制
|
int[] |
getColor() |
Font |
getFont() |
Double |
getFontSize() |
double |
getHorizontalInclination() |
double |
getHorizontalScaling() |
Double |
getLetterSpacing() |
double |
getOffsetX() |
double |
getOffsetY() |
String |
getText() |
TextAlign |
getTextAlign() |
TextAlign |
getTextLayoutAlign() |
double |
getUnderlineOffset()
获取下划线与文字的偏移量
|
double |
getUnderlineWidth()
获取下划线宽度
|
double |
getVerticalInclination() |
double |
getVerticalScaling() |
org.ofdrw.core.text.text.Weight |
getWeight()
获取字体粗细
|
boolean |
isBold() |
boolean |
isItalic() |
boolean |
isUnderline() |
int |
length() |
ArtWord |
setBold(boolean bold)
设置是否加粗
若需要更加细致的控制,可以使用
setWeight(Weight) |
ArtWord |
setColor(int[] rgb)
设置字体颜色
|
ArtWord |
setColor(int r,
int g,
int b)
设置字体颜色
|
ArtWord |
setColor(String color)
设置字体颜色
|
ArtWord |
setFont(Font font) |
ArtWord |
setFontSize(Double fontSize) |
void |
setHorizontalInclination(double horizontalInclination) |
void |
setHorizontalScaling(double horizontalScaling) |
ArtWord |
setItalic(boolean italic) |
ArtWord |
setLetterSpacing(Double letterSpacing) |
void |
setOffsetX(double offsetX) |
void |
setOffsetY(double offsetY) |
ArtWord |
setText(String text) |
void |
setTextAlign(TextAlign textAlign) |
void |
setTextLayoutAlign(TextAlign textLayoutAlign) |
ArtWord |
setUnderline(boolean underline)
设置 下划线
|
ArtWord |
setUnderline(boolean underline,
double offset,
double width)
设置下划线
|
void |
setVerticalInclination(double verticalInclination) |
void |
setVerticalScaling(double verticalScaling) |
ArtWord |
setWeight(org.ofdrw.core.text.text.Weight weight)
设置字体粗细
|
doPrepare, elementType, getDrawer, getPreferBlock, setDrawer, setPreferBlockbox, contentSplitAdjust, copyTo, getBackgroundColor, getBorder, getBorderBottom, getBorderColor, getBorderDash, getBorderLeft, getBorderRight, getBorderTop, getClear, getDisplay, getFloat, getHeight, getLayer, getLeft, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOnRenderFinish, getOpacity, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPosition, getRight, getTop, getWidth, getX, getY, heightPlus, isBlockElement, isIntegrity, isNoBorder, isPlaceholder, onRenderFinish, placeholder, placeholder, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBorder, setBorderBottom, setBorderColor, setBorderColor, setBorderColor, setBorderDash, setBorderLeft, setBorderRight, setBorderTop, setBox, setClear, setDisplay, setFloat, setHeight, setIntegrity, setLayer, setLeft, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setOpacity, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPlaceholder, setPosition, setRight, setTop, setWidth, setX, setXY, setY, split, toString, widthPluspublic int[] getColor()
public ArtWord setColor(int[] rgb)
rgb - 颜色值public ArtWord setColor(int r, int g, int b)
r - 红g - 绿b - 懒public int length()
public Font getFont()
public Double getFontSize()
public Double getLetterSpacing()
public boolean isBold()
public ArtWord setBold(boolean bold)
若需要更加细致的控制,可以使用 setWeight(Weight)
bold - 是否加粗public org.ofdrw.core.text.text.Weight getWeight()
public ArtWord setWeight(org.ofdrw.core.text.text.Weight weight)
weight - 字体粗细public boolean isItalic()
public ArtWord setItalic(boolean italic)
public boolean isUnderline()
public ArtWord setUnderline(boolean underline)
underline - 是否启用下划线public ArtWord setUnderline(boolean underline, double offset, double width)
underline - 是否启用下划线offset - 下划线与文字的偏移量,可以为负值,默认值为1.2,单位毫米。width - 下划线线宽,默认为0,为0时默认为字体大小的0.05倍。public String getText()
public double getOffsetY()
public void setOffsetY(double offsetY)
public double getOffsetX()
public void setOffsetX(double offsetX)
public double getVerticalInclination()
public void setVerticalInclination(double verticalInclination)
public double getHorizontalInclination()
public void setHorizontalInclination(double horizontalInclination)
public double getVerticalScaling()
public void setVerticalScaling(double verticalScaling)
public double getHorizontalScaling()
public void setHorizontalScaling(double horizontalScaling)
public TextAlign getTextAlign()
public void setTextAlign(TextAlign textAlign)
public double getUnderlineOffset()
public double getUnderlineWidth()
public TextAlign getTextLayoutAlign()
public void setTextLayoutAlign(TextAlign textLayoutAlign)
public void draw(DrawContext ctx) throws IOException
Drawerctx - 绘制上下文IOException - 图片读取过程中IO异常Copyright © 2024. All rights reserved.