public class XSSFTextRun
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
double |
getCharacterSpacing() |
java.awt.Color |
getFontColor() |
java.lang.String |
getFontFamily() |
double |
getFontSize() |
byte |
getPitchAndFamily() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties |
getRPr() |
java.lang.String |
getText() |
TextCap |
getTextCap() |
org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun |
getXmlObject() |
boolean |
isBold() |
boolean |
isItalic() |
boolean |
isStrikethrough() |
boolean |
isSubscript() |
boolean |
isSuperscript() |
boolean |
isUnderline() |
void |
setBaselineOffset(double baselineOffset)
Set the baseline for both the superscript and subscript fonts.
(为上标和下标字体设置基线。)
|
void |
setBold(boolean bold)
Specifies whether this run of text will be formatted as bold text
(指定此文本运行是否将格式化为粗体文本)
|
void |
setCharacterSpacing(double spc)
Set the spacing between characters within a text run.
(设置文本运行中字符之间的间距。)
|
void |
setFont(java.lang.String typeface)
Specifies the typeface, or name of the font that is to be used for this text run.
(指定要用于此文本运行的字体或字体名称。)
|
void |
setFontColor(java.awt.Color color) |
void |
setFontFamily(java.lang.String typeface, byte charset, byte pictAndFamily, boolean isSymbol) |
void |
setFontSize(double fontSize) |
void |
setItalic(boolean italic) |
void |
setStrikethrough(boolean strike)
Specifies whether a run of text will be formatted as strikethrough text.
(指定是否将一行文本格式化为删除线文本。)
|
void |
setSubscript(boolean flag)
Set whether the text in this run is formatted as subscript.
(设置本次运行中的文本是否格式化为下标。)
|
void |
setSuperscript(boolean flag)
Set whether the text in this run is formatted as superscript.
(设置本次运行中的文本是否格式化为上标。)
|
void |
setText(java.lang.String text) |
void |
setUnderline(boolean underline) |
java.lang.String |
toString() |
public java.lang.String getText()
public void setText(java.lang.String text)
public org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun getXmlObject()
public void setFontColor(java.awt.Color color)
public java.awt.Color getFontColor()
public void setFontSize(double fontSize)
fontSize
- font size in points. The value of
-1
unsets the Sz attribute from the underlying xml bean
(fontSize - 以磅为单位的字体大小。 -1 的值从底层 xml bean 取消设置 Sz 属性)
public double getFontSize()
public double getCharacterSpacing()
public void setCharacterSpacing(double spc)
The spacing is specified in points. Positive values will cause the text to expand, negative values to condense.
(设置文本运行中字符之间的间距。间距以磅为单位指定。正值将导致文本扩展,负值将导致压缩。)spc
- character spacing in points.
(spc - 以点为单位的字符间距。)
public void setFont(java.lang.String typeface)
typeface
- the font to apply to this text run. The value of
null
unsets the Typeface attribute from the underlying xml.
(typeface - 应用于此文本运行的字体。 null 的值从基础 xml 中取消设置 Typeface 属性。)
public void setFontFamily(java.lang.String typeface, byte charset, byte pictAndFamily, boolean isSymbol)
public java.lang.String getFontFamily()
public byte getPitchAndFamily()
public void setStrikethrough(boolean strike)
strike
- whether a run of text will be formatted as strikethrough text.
(删除 - 是否将一行文本格式化为删除线文本。)
public boolean isStrikethrough()
public boolean isSuperscript()
public void setBaselineOffset(double baselineOffset)
The size is specified using a percentage. Positive values indicate superscript, negative values indicate subscript.
(为上标和下标字体设置基线。使用百分比指定大小。正值表示上标,负值表示下标。)baselineOffset
-
(基线偏移 -)
public void setSuperscript(boolean flag)
setBaselineOffset(double)
public void setSubscript(boolean flag)
setBaselineOffset(double)
public boolean isSubscript()
public TextCap getTextCap()
public void setBold(boolean bold)
bold
- whether this run of text will be formatted as bold text
(粗体 - 此行文本是否将被格式化为粗体文本)
public boolean isBold()
public void setItalic(boolean italic)
italic
- whether this run of text is formatted as italic text
(italic - 这段文本是否被格式化为斜体文本)
public boolean isItalic()
public void setUnderline(boolean underline)
underline
- whether this run of text is formatted as underlined text
(underline - 这段文本是否被格式化为带下划线的文本)
public boolean isUnderline()
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties getRPr()
public java.lang.String toString()
toString
in class
java.lang.Object
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.