Class ArtWord
java.lang.Object
org.ofdrw.layout.element.Div<Canvas>
org.ofdrw.layout.element.canvas.Canvas
org.ofdrw.layout.element.canvas.CanvasBase
org.ofdrw.layout.element.canvas.ArtWord
- All Implemented Interfaces:
Drawer, ElementSplit, RenderPrepare
艺术字元素
本元素在Span元素的效果上增加了艺术字常见效果,,比如斜体,文字左右拉伸,文字垂直拉伸
- Since:
- 2024/6/12
- Author:
- 韩兴元
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()克隆Divvoiddraw(DrawContext ctx) 绘制int[]getColor()getFont()doubledoubledoubledoublegetText()double获取下划线与文字的偏移量double获取下划线宽度doubledoubleorg.ofdrw.core.text.text.Weight获取字体粗细booleanisBold()booleanisItalic()booleanintlength()setBold(boolean bold) 设置是否加粗setColor(int[] rgb) 设置字体颜色setColor(int r, int g, int b) 设置字体颜色设置字体颜色setFontSize(Double fontSize) voidsetHorizontalInclination(double horizontalInclination) voidsetHorizontalScaling(double horizontalScaling) setItalic(boolean italic) setLetterSpacing(Double letterSpacing) voidsetOffsetX(double offsetX) voidsetOffsetY(double offsetY) voidsetTextAlign(TextAlign textAlign) voidsetTextLayoutAlign(TextAlign textLayoutAlign) setUnderline(boolean underline) 设置 下划线setUnderline(boolean underline, double offset, double width) 设置下划线voidsetVerticalInclination(double verticalInclination) voidsetVerticalScaling(double verticalScaling) setWeight(org.ofdrw.core.text.text.Weight weight) 设置字体粗细Methods inherited from class Canvas
doPrepare, elementType, getDrawer, getPreferBlock, setDrawer, setPreferBlockModifier and TypeMethodDescriptionCanvas 不接受宽度重设获取元素类型org.ofdrw.core.basicStructure.pageObj.layer.block.CT_PageBlock获取 优先使用的页面块在进入渲染器之前可以对Canvas的绘制进行重设voidsetPreferBlock(org.ofdrw.core.basicStructure.pageObj.layer.block.CT_PageBlock preferBlock) 设置 优先使用的页面块Methods inherited from class Div
box, 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, widthPlusModifier and TypeMethodDescriptionbox()获取模型区域大小contentSplitAdjust(double sHeight, T div1, T div2) 内容分割调整<T extends Div>
TcopyTo(T div) Clone到制定对象int[]Double[]int[]获取 边框颜色Double[]获取 边框虚线样式getClear()获取 显示样式getFloat()org.ofdrw.core.basicStructure.pageObj.layer.TypegetLayer()返回 图层getLeft()Double[]获取渲染完成回调事件获取透明度Double[]获取内边距getRight()getTop()getWidth()getX()getY()doubleboolean是否是块级元素元素是否可以拆分boolean是否存在边框boolean判断是否为占位符voidonRenderFinish(ElementRenderFinishHandler renderFinishHandler) 设置渲染完成回调事件static Divplaceholder(double width, double height, AFloat aFloat) 空间占位符static Divplaceholder(Rectangle rec, AFloat aFloat) 空间占位符setBackgroundColor(int[] backgroundColor) 设置背景颜色 RGBsetBackgroundColor(int r, int g, int b) 设置背景颜色 RGBsetBackgroundColor(String color) 设置 背景颜色设置 边框宽度setBorderBottom(Double bottom) setBorderColor(int[] rgb) 设置 边框颜色setBorderColor(int r, int g, int b) 设置边框颜色setBorderColor(String color) 设置 边框颜色setBorderDash(Double... dash) 设置 边框虚线样式setBorderLeft(Double left) setBorderRight(Double right) setBorderTop(Double top) 设置盒式模型的主要属性setDisplay(Display display) 设置 显示样式设置浮动样式setIntegrity(Boolean integrity) setLayer(org.ofdrw.core.basicStructure.pageObj.layer.Type layer) 设置 图层设置 外边距setMarginBottom(Double bottom) setMarginLeft(Double left) setMarginRight(Double right) setMarginTop(Double top) setOpacity(Double opacity) 设置透明度setPadding(Double... padding) 设置 内边距setPaddingBottom(Double bottom) setPaddingLeft(Double left) setPaddingRight(Double right) setPaddingTop(Double top) setPlaceholder(boolean placeholder) 设置是否为 占位符setPosition(Position position) 设置位置Div[]split(double sHeight) 根据给定的高度切分元素toString()double
-
Constructor Details
-
ArtWord
-
-
Method Details
-
getColor
public int[] getColor() -
setColor
-
setColor
-
setColor
-
length
public int length()- Returns:
- 字符数量
-
getFont
-
setFont
-
getFontSize
-
setFontSize
-
getLetterSpacing
-
setLetterSpacing
-
isBold
public boolean isBold() -
setBold
设置是否加粗若需要更加细致的控制,可以使用
setWeight(Weight)- Parameters:
bold- 是否加粗- Returns:
- this
-
getWeight
public org.ofdrw.core.text.text.Weight getWeight()获取字体粗细- Returns:
- 字体粗细,可能为null。
-
setWeight
设置字体粗细- Parameters:
weight- 字体粗细- Returns:
- this
-
isItalic
public boolean isItalic() -
setItalic
-
isUnderline
public boolean isUnderline() -
setUnderline
-
setUnderline
设置下划线- Parameters:
underline- 是否启用下划线offset- 下划线与文字的偏移量,可以为负值,默认值为1.2,单位毫米。width- 下划线线宽,默认为0,为0时默认为字体大小的0.05倍。- Returns:
- this
-
getText
-
setText
-
getOffsetY
public double getOffsetY() -
setOffsetY
public void setOffsetY(double offsetY) -
getOffsetX
public double getOffsetX() -
setOffsetX
public void setOffsetX(double offsetX) -
getVerticalInclination
public double getVerticalInclination() -
setVerticalInclination
public void setVerticalInclination(double verticalInclination) -
getHorizontalInclination
public double getHorizontalInclination() -
setHorizontalInclination
public void setHorizontalInclination(double horizontalInclination) -
getVerticalScaling
public double getVerticalScaling() -
setVerticalScaling
public void setVerticalScaling(double verticalScaling) -
getHorizontalScaling
public double getHorizontalScaling() -
setHorizontalScaling
public void setHorizontalScaling(double horizontalScaling) -
getTextAlign
-
setTextAlign
-
getUnderlineOffset
public double getUnderlineOffset()获取下划线与文字的偏移量- Returns:
- 下划线与文字的偏移量,单位毫米
-
getUnderlineWidth
public double getUnderlineWidth()获取下划线宽度- Returns:
- 下划线宽度, 0表示保持默认,默认为字体大小的0.05倍,单位毫米
-
getTextLayoutAlign
-
setTextLayoutAlign
-
clone
-
draw
Description copied from interface:Drawer绘制- Parameters:
ctx- 绘制上下文- Throws:
IOException- 图片读取过程中IO异常
-