Class PlaceholderSpan
java.lang.Object
org.ofdrw.layout.element.Span
org.ofdrw.layout.element.PlaceholderSpan
- All Implemented Interfaces:
TextFontInfo
-
Constructor Summary
ConstructorsConstructorDescriptionPlaceholderSpan(double holdWidth, double height) 创建占位符PlaceholderSpan(int holdNum, double fontSize) 创建占位符PlaceholderSpan(int holdNum, Span sp) 通过复制span的方式创建占位符 -
Method Summary
Modifier and TypeMethodDescription占位符大小,如果holdWidth存在那么返还指定宽高的矩形 否则根据字体进行计算int获取位符数量double占位符宽度setHoldChars(int holdNum) 设置占位的字符setHoldWidth(double holdWidth) 设置占位符宽度获取经过行内换行处理之后的Span列表Methods inherited from class Span
clone, getColor, getDeltaX, getFont, getFontSize, getLetterSpacing, getText, getUnderlineOffset, getUnderlineWidth, getWeight, glyphList, hasLinebreak, isBold, isFill, isIntegrity, isItalic, isUnderline, length, setBold, setColor, setColor, setColor, setFill, setFont, setFontSize, setIntegrity, setItalic, setLetterSpacing, setLinebreak, setText, setUnderline, setUnderline, setWeight, splitModifier and TypeMethodDescriptionclone()int[]getColor()Double[]获取字符X坐标偏移值队列getFont()获取字体对象获取文字字号获取字间距getText()double获取下划线与文字的偏移量double获取下划线宽度org.ofdrw.core.text.text.Weight获取字体粗细获取字体图形列表boolean是否是一个占满剩余行空间的SpanbooleanisBold()isFill()元素是否可以拆分booleanisItalic()booleanintlength()setBold(boolean bold) 设置是否加粗setColor(int[] rgb) 设置字体颜色setColor(int r, int g, int b) 设置字体颜色设置 文字颜色setFill(boolean fill) setFontSize(Double fontSize) setIntegrity(Boolean integrity) setItalic(boolean italic) setLetterSpacing(Double letterSpacing) setLinebreak(boolean linebreak) 设置Span为占满剩下行空间的元素setUnderline(boolean underline) 设置 下划线setUnderline(boolean underline, double offset, double width) 设置下划线setWeight(org.ofdrw.core.text.text.Weight weight) 设置字体粗细Span[]split(int index) 切分元素
-
Constructor Details
-
PlaceholderSpan
public PlaceholderSpan(double holdWidth, double height) 创建占位符- Parameters:
holdWidth- 占位符宽度height- 占位符高度
-
PlaceholderSpan
public PlaceholderSpan(int holdNum, double fontSize) 创建占位符该方式创建的占位符字间距为0
- Parameters:
holdNum- 占位符数目fontSize- 每个占位符字体大小
-
PlaceholderSpan
通过复制span的方式创建占位符- Parameters:
holdNum- 占位符数量sp- 用于复制的原始span
-
-
Method Details
-
setHoldChars
-
getHoldNum
public int getHoldNum()获取位符数量仅在使用占位数量创建对象时有效
PlaceholderSpan(int, double)或PlaceholderSpan(int, Span)- Returns:
- 占位符数量
-
getHoldWidth
-
setHoldWidth
设置占位符宽度如果设置该了宽度,那么HoldNum将会失效
- Parameters:
holdWidth- 占位符宽度,单位mm- Returns:
- this
-
blockSize
-
splitLineBreak
获取经过行内换行处理之后的Span列表- Overrides:
splitLineBreakin classSpan- Returns:
- 带有占满行剩余内容的Span序列
-