public class CT_Text extends CT_GraphicUnit<CT_Text> implements ClipAble
11.2 文字对象 图 59 表 45
proxy| 限定符和类型 | 方法和说明 |
|---|---|
CT_Text |
addCGTransform(CT_CGTransform cgTransform)
【可选】
增加 指定字符编码到字符索引之间的变换关系
描述见 11.4 字符变换
|
CT_Text |
addTextCode(TextCode textCode)
【必选】
增加 文字内容
也就是一段字符编码串
如果字符编码不在XML编码方式的字符范围之内,应采用“\”加四位
十六进制数的格式转义;文字内容中出现的空格也需要转义
若 TextCode 作为占位符使用时一律采用 ¤ (¤)占位
|
List<CT_CGTransform> |
getCGTransforms()
【可选】
获取 指定字符编码到字符索引之间的变换关系序列
描述见 11.4 字符变换
|
Direction |
getCharDirection()
【可选 属性】
获取 字符方向
指定了文字放置的方向,描述见 11.3 文字定位
默认值为 0
|
Boolean |
getFill()
【可选 属性】
获取 是否填充
默认值为 true
|
FillColor |
getFillColor()
【可选】
获取 填充颜色
默认为黑色
|
ST_RefID |
getFont()
【必选 属性】
获取 引用资源文件路径
|
Double |
getHScale()
【可选 属性】
获取 字形在水平方向的缩放比
默认值为 1.0
例如:当 HScale 值为 0.5 时表示实际显示的字宽为原来字宽的一半。
|
Boolean |
getItalic()
【可选 属性】
获取 是否是斜体样式
默认值为 false
|
Direction |
getReadDirection()
【可选 属性】
获取 阅读方向
指定了文字排列的方向,描述见 11.3 文字定位
默认值为 0
|
Double |
getSize()
【必选 属性】
获取 字号,单位为毫米
|
Boolean |
getStroke()
【可选 属性】
获取 是否勾边
默认值为 false
|
StrokeColor |
getStrokeColor()
【可选】
获取 勾边颜色
默认为透明色
|
List<TextCode> |
getTextCodes()
【必选】
获取 文字内容序列
也就是一段字符编码串
如果字符编码不在XML编码方式的字符范围之内,应采用“\”加四位
十六进制数的格式转义;文字内容中出现的空格也需要转义
若 TextCode 作为占位符使用时一律采用 ¤ (¤)占位
|
Weight |
getWeight()
【可选 属性】
设置 文字对象的粗细值
默认值为 400
|
CT_Text |
setCharDirection(Direction charDirection)
【可选 属性】
指定 字符方向
指定了文字放置的方向,描述见 11.3 文字定位
默认值为 0
|
CT_Text |
setFill(Boolean fill)
【可选 属性】
设置 是否填充
默认值为 true
|
CT_Text |
setFillColor(CT_Color fillColor)
【可选】
设置 填充颜色
默认为黑色
|
CT_Text |
setFont(long refId)
【必选 属性】
设置 引用资源文件中定义的字形标识
|
CT_Text |
setFont(ST_RefID font)
【必选 属性】
设置 引用资源文件中定义的字形标识
|
CT_Text |
setHScale(Double hScale)
【可选 属性】
设置 字形在水平方向的缩放比
默认值为 1.0
例如:当 HScale 值为 0.5 时表示实际显示的字宽为原来字宽的一半。
|
CT_Text |
setItalic(Boolean italic)
【可选 属性】
设置 是否是斜体样式
默认值为 false
|
CT_Text |
setReadDirection(Direction readDirection)
【可选 属性】
指定 阅读方向
指定了文字排列的方向,描述见 11.3 文字定位
默认值为 0
|
CT_Text |
setSize(Double size)
【必选 属性】
设置 字号,单位为毫米
|
CT_Text |
setStroke(Boolean stroke)
【可选 属性】
设置 是否勾边
默认值为 false
|
CT_Text |
setStrokeColor(CT_Color strokeColor)
【可选】
设置 勾边颜色
默认为透明色
|
CT_Text |
setWeight(Weight weight)
【可选 属性】
设置 文字对象的粗细值
默认值为 400
|
static CT_Text |
textObject(ST_ID id)
获取文字对象
|
TextObject |
toObj(ST_ID id)
构造文字对象
|
getActions, getAlpha, getBoundary, getCap, getClips, getCTM, getDashOffset, getDashPattern, getDrawParam, getGraphicName, getJoin, getLineWidth, getMiterLimit, getVisible, setActions, setAlpha, setBoundary, setBoundary, setCap, setClips, setCTM, setDashOffset, setDashPattern, setDrawParam, setGraphicName, setJoin, setLineWidth, setMiterLimit, setVisibleaddOFDEntity, getElements, getInstance, getObjID, getOFDElement, getOFDElement, getOFDElements, getOFDElementText, getQualifiedName, removeAll, removeAttr, removeOFDElemByNames, set, setObjID, setObjID, setOFDEntity, setOFDNameaccept, add, add, add, add, add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addElement, addElement, addElement, addEntity, additionalNamespaces, addNamespace, addProcessingInstruction, addProcessingInstruction, addText, appendAttributes, appendContent, asXML, asXPathResult, attribute, attribute, attribute, attributeCount, attributeIterator, attributes, attributeValue, attributeValue, attributeValue, attributeValue, clearContent, clone, content, createCopy, createCopy, createCopy, createXPath, declaredNamespaces, detach, element, element, elementByID, elementIterator, elementIterator, elementIterator, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, equals, getData, getDocument, getName, getNamespace, getNamespaceForPrefix, getNamespaceForURI, getNamespacePrefix, getNamespacesForURI, getNamespaceURI, getNodeType, getNodeTypeName, getParent, getPath, getPath, getProxy, getQName, getQName, getStringValue, getText, getTextTrim, getUniquePath, getUniquePath, getXPathResult, hasContent, hasMixedContent, indexOf, isReadOnly, isRootElement, isTextOnly, matches, node, nodeCount, nodeIterator, normalize, numberValueOf, processingInstruction, processingInstructions, processingInstructions, remove, remove, remove, remove, remove, remove, remove, remove, remove, removeProcessingInstruction, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setAttributes, setAttributeValue, setAttributeValue, setContent, setData, setDocument, setName, setParent, setProcessingInstructions, setProxy, setQName, setText, supportsParent, valueOf, writefinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInstanceadd, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addEntity, additionalNamespaces, addNamespace, addProcessingInstruction, addProcessingInstruction, addText, appendAttributes, attribute, attribute, attribute, attributeCount, attributeIterator, attributes, attributeValue, attributeValue, attributeValue, attributeValue, createCopy, createCopy, createCopy, declaredNamespaces, element, element, elementIterator, elementIterator, elementIterator, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, getData, getNamespace, getNamespaceForPrefix, getNamespaceForURI, getNamespacePrefix, getNamespacesForURI, getNamespaceURI, getQName, getQName, getQualifiedName, getStringValue, getText, getTextTrim, getXPathResult, hasMixedContent, isRootElement, isTextOnly, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setData, setQNameadd, add, add, add, addElement, addElement, addElement, appendContent, clearContent, content, elementByID, indexOf, node, nodeCount, nodeIterator, normalize, processingInstruction, processingInstructions, processingInstructions, remove, remove, remove, remove, removeProcessingInstruction, setContent, setProcessingInstructionsaccept, asXML, asXPathResult, clone, createXPath, detach, getDocument, getName, getNodeType, getNodeTypeName, getParent, getPath, getPath, getUniquePath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, writepublic CT_Text(org.dom4j.Element proxy)
public CT_Text(String name)
public CT_Text()
public TextObject toObj(ST_ID id)
id - 对象IDpublic CT_Text setFont(ST_RefID font)
font - 引用字形资源文件路径public CT_Text setFont(long refId)
refId - IDpublic ST_RefID getFont()
public Double getSize()
public CT_Text setStroke(Boolean stroke)
默认值为 false
stroke - true - 勾边;false - 不勾边public Boolean getStroke()
默认值为 false
public CT_Text setFill(Boolean fill)
默认值为 true
fill - true - 填充;false - 不填充public Boolean getFill()
默认值为 true
public CT_Text setHScale(Double hScale)
默认值为 1.0
例如:当 HScale 值为 0.5 时表示实际显示的字宽为原来字宽的一半。
hScale - 字形在水平方向的缩放比public Double getHScale()
默认值为 1.0
例如:当 HScale 值为 0.5 时表示实际显示的字宽为原来字宽的一半。
public CT_Text setReadDirection(Direction readDirection)
指定了文字排列的方向,描述见 11.3 文字定位
默认值为 0
readDirection - 阅读方向,可选值为Directionpublic Direction getReadDirection()
指定了文字排列的方向,描述见 11.3 文字定位
默认值为 0
Directionpublic CT_Text setCharDirection(Direction charDirection)
指定了文字放置的方向,描述见 11.3 文字定位
默认值为 0
charDirection - 字符方向,可选值为Directionpublic Direction getCharDirection()
指定了文字放置的方向,描述见 11.3 文字定位
默认值为 0
Directionpublic CT_Text setWeight(Weight weight)
默认值为 400
weight - 文字对象的粗细值,可选值Weightpublic CT_Text setItalic(Boolean italic)
默认值为 false
italic - true - 斜体样式; false - 正常public Boolean getItalic()
默认值为 false
public CT_Text setFillColor(CT_Color fillColor)
默认为黑色
fillColor - 填充颜色public FillColor getFillColor()
默认为黑色
public CT_Text setStrokeColor(CT_Color strokeColor)
默认为透明色
strokeColor - 勾边颜色public StrokeColor getStrokeColor()
默认为透明色
public CT_Text addCGTransform(CT_CGTransform cgTransform)
描述见 11.4 字符变换
cgTransform - 字符编码到字符索引之间的变换关系public List<CT_CGTransform> getCGTransforms()
描述见 11.4 字符变换
public CT_Text addTextCode(TextCode textCode)
也就是一段字符编码串
如果字符编码不在XML编码方式的字符范围之内,应采用“\”加四位 十六进制数的格式转义;文字内容中出现的空格也需要转义 若 TextCode 作为占位符使用时一律采用 ¤ (¤)占位
textCode - 文字内容Copyright © 2021. All rights reserved.