TextRun.FieldType, TextRun.TextCap
Modifier | Constructor and Description |
---|---|
protected |
XSLFTextRun(org.apache.xmlbeans.XmlObject r,
XSLFTextParagraph p) |
Modifier and Type | Method and Description |
---|---|
XSLFHyperlink |
createHyperlink()
Creates a new hyperlink and assigns it to this text run.
|
double |
getCharacterSpacing() |
TextRun.FieldType |
getFieldType()
Experimental method to determine the field type, e.g.
|
PaintStyle |
getFontColor()
Returns the font color.
|
java.lang.String |
getFontFamily()
Get the font family - convenience method for
TextRun.getFontInfo(FontGroup) |
java.lang.String |
getFontFamily(FontGroup fontGroup)
Get the font family - convenience method for
TextRun.getFontInfo(FontGroup) |
FontInfo |
getFontInfo(FontGroup fontGroup)
Get the font info for the given font group
|
java.lang.Double |
getFontSize()
Returns the font size which is either set directly on this text run or
given from the slide layout
|
XSLFHyperlink |
getHyperlink()
Return the associated hyperlink
|
XSLFTextParagraph |
getParagraph() |
byte |
getPitchAndFamily() |
java.lang.String |
getRawText() |
org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties |
getRPr(boolean create)
Return the character properties
|
TextRun.TextCap |
getTextCap() |
org.apache.xmlbeans.XmlObject |
getXmlObject()
Return the text run xmlbeans object.
|
boolean |
isBold() |
boolean |
isItalic() |
boolean |
isStrikethrough() |
boolean |
isSubscript() |
boolean |
isSuperscript() |
boolean |
isUnderlined() |
void |
setBaselineOffset(double baselineOffset)
Set the baseline for both the superscript and subscript fonts.
|
void |
setBold(boolean bold)
Sets the bold state
|
void |
setCharacterSpacing(double spc)
Set the spacing between characters within a text run.
|
void |
setFontColor(java.awt.Color color)
Sets the (solid) font color - convenience function
|
void |
setFontColor(PaintStyle color)
Sets the font color
|
void |
setFontFamily(java.lang.String typeface)
Specifies the typeface, or name of the font that is to be used for this text run -
convenience method for calling
TextRun.setFontInfo(FontInfo, FontGroup) with just a font name |
void |
setFontFamily(java.lang.String typeface,
FontGroup fontGroup)
Specifies the typeface, or name of the font that is to be used for this text run -
convenience method for calling
TextRun.setFontInfo(FontInfo, FontGroup) with just a font name |
void |
setFontInfo(FontInfo fontInfo,
FontGroup fontGroup)
Specifies the font to be used for this text run.
|
void |
setFontSize(java.lang.Double fontSize)
Sets the font size directly on this text run, if null is given, the
font size defaults to the values given from the slide layout
|
void |
setItalic(boolean italic)
Sets the italic state
|
void |
setStrikethrough(boolean strike)
Sets the strikethrough state
|
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 |
setUnderlined(boolean underline)
Sets the underlined state
|
java.lang.String |
toString() |
protected XSLFTextRun(org.apache.xmlbeans.XmlObject r, XSLFTextParagraph p)
public java.lang.String getRawText()
getRawText
in interface TextRun
@Internal public org.apache.xmlbeans.XmlObject getXmlObject()
CTTextField
,
CTTextLineBreak
or usually a CTRegularTextRun
public void setFontColor(java.awt.Color color)
TextRun
setFontColor
in interface TextRun
color
- the colorpublic void setFontColor(PaintStyle color)
TextRun
setFontColor
in interface TextRun
color
- the colorDrawPaint.createSolidPaint(Color)
public PaintStyle getFontColor()
TextRun
PaintStyle.SolidPaint
, but but also other classes are possiblegetFontColor
in interface TextRun
DrawPaint.getPaint(java.awt.Graphics2D, PaintStyle)
,
PaintStyle.SolidPaint.getSolidColor()
,
DrawPaint.applyColorTransform(ColorStyle)
public void setFontSize(java.lang.Double fontSize)
TextRun
setFontSize
in interface TextRun
fontSize
- font size in points, if null the underlying fontsize will be unsetpublic java.lang.Double getFontSize()
TextRun
getFontSize
in interface TextRun
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.public void setFontFamily(java.lang.String typeface)
TextRun
TextRun.setFontInfo(FontInfo, FontGroup)
with just a font namesetFontFamily
in interface TextRun
typeface
- the font to apply to this text run.
The value of null
removes the run specific font setting, so the default setting is activated again.public void setFontFamily(java.lang.String typeface, FontGroup fontGroup)
TextRun
TextRun.setFontInfo(FontInfo, FontGroup)
with just a font namesetFontFamily
in interface TextRun
typeface
- the font to apply to this text run.
The value of null
removes the run specific font setting, so the default setting is activated again.fontGroup
- the font group, i.e. the range of glpyhs to be covered.
if null
, the font group matching the first character will be returnedpublic void setFontInfo(FontInfo fontInfo, FontGroup fontGroup)
TextRun
setFontInfo
in interface TextRun
fontInfo
- the font to apply to this text run.
The value of null
removes the run specific font setting, so the default setting is activated again.fontGroup
- the font group, i.e. the range of glpyhs to be covered. defaults to latin, if null
.public java.lang.String getFontFamily()
TextRun
TextRun.getFontInfo(FontGroup)
getFontFamily
in interface TextRun
public java.lang.String getFontFamily(FontGroup fontGroup)
TextRun
TextRun.getFontInfo(FontGroup)
getFontFamily
in interface TextRun
fontGroup
- the font group, i.e. the range of glpyhs to be covered.
if null
, the font group matching the first character will be returnedpublic FontInfo getFontInfo(FontGroup fontGroup)
TextRun
getFontInfo
in interface TextRun
fontGroup
- the font group, i.e. the range of glpyhs to be covered.
if null
, the font group matching the first character will be returnednull
if not setpublic byte getPitchAndFamily()
getPitchAndFamily
in interface TextRun
public void setStrikethrough(boolean strike)
TextRun
setStrikethrough
in interface TextRun
strike
- set to true for stroked text, false for no strokingpublic boolean isStrikethrough()
isStrikethrough
in interface TextRun
public boolean isSuperscript()
isSuperscript
in interface TextRun
public void setBaselineOffset(double baselineOffset)
The size is specified using a percentage. Positive values indicate superscript, negative values indicate subscript.
public void setSuperscript(boolean flag)
setBaselineOffset(double)
public void setSubscript(boolean flag)
setBaselineOffset(double)
public boolean isSubscript()
isSubscript
in interface TextRun
public TextRun.TextCap getTextCap()
getTextCap
in interface TextRun
public void setBold(boolean bold)
TextRun
public boolean isBold()
public void setItalic(boolean italic)
TextRun
public boolean isItalic()
public void setUnderlined(boolean underline)
TextRun
setUnderlined
in interface TextRun
underline
- set to true for underlined text, false for no underliningpublic boolean isUnderlined()
isUnderlined
in interface TextRun
@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties getRPr(boolean create)
create
- if true, create an empty character properties object if it doesn't existpublic java.lang.String toString()
toString
in class java.lang.Object
public XSLFHyperlink createHyperlink()
TextRun
createHyperlink
in interface TextRun
public XSLFHyperlink getHyperlink()
TextRun
getHyperlink
in interface TextRun
public TextRun.FieldType getFieldType()
TextRun
getFieldType
in interface TextRun
null
if text run is not a fieldpublic XSLFTextParagraph getParagraph()
getParagraph
in interface TextRun
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.