Top Description Inners Methods
org.apache.poi.sl.usermodel

public Interface TextRun

Annotations
@SuppressWarnings:unused, java:S1452
Imports
java.awt.Color, org.apache.poi.common.usermodel.fonts.FontGroup, .FontInfo, org.apache.poi.sl.usermodel.PaintStyle.SolidPaint, org.apache.poi.util.Internal

Some text.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
TextRun.FieldType

Type of placeholder fields

public static enum
TextRun.TextCap

Type of text capitals

Method Summary

Modifier and TypeMethod and Description
public TextRun.FieldType

Returns:

the field type or null if text run is not a field
getFieldType
()

Experimental method to determine the field type, e.g. slide number

public PaintStyle

Returns:

the font color/paint
getFontColor
()

Returns the font color.

public String

Returns:

font family or null if not set
getFontFamily
()

Get the font family - convenience method for getFontInfo(FontGroup)

public String

Returns:

font family or null if not set
getFontFamily
(FontGroup
the font group, i.e. the range of glyphs to be covered. if null, the font group matching the first character will be returned
fontGroup
)

Get the font family - convenience method for getFontInfo(FontGroup)

public FontInfo

Returns:

font info or null if not set
getFontInfo
(FontGroup
the font group, i.e. the range of glyphs to be covered. if null, the font group matching the first character will be returned
fontGroup
)

Get the font info for the given font group

public Double

Returns:

font size in points or null if font size is not set.
getFontSize
()

Returns the font size which is either set directly on this text run or given from the slide layout

public TextParagraph<?, ?, ?>

Returns:

the paragraph which contains this TextRun
getParagraph
()

public byte

Returns:

the pitch and family id or -1 if not applicable
getPitchAndFamily
()

public String
public TextRun.TextCap
public boolean

Returns:

true, if text is bold
isBold
()

public boolean

Returns:

true, if text is italic
isItalic
()

public boolean

Returns:

true, if text is stroked
isStrikethrough
()

public boolean

Returns:

true, if text is sub scripted
isSubscript
()

public boolean

Returns:

true, if text is super scripted
isSuperscript
()

public boolean

Returns:

true, if text is underlined
isUnderlined
()

public void
setBold(boolean
set to true for bold text, false for normal weight
bold
)

Sets the bold state

public void
setFontColor(Color
the color
color
)

Sets the (solid) font color - convenience function

public void
setFontColor(PaintStyle
the color
color
)

Sets the font color

public void
setFontFamily(String
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.
typeface
)

Specifies the typeface, or name of the font that is to be used for this text run - convenience method for calling setFontInfo(FontInfo, FontGroup) with just a font name

public void
setFontFamily(String
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.
typeface
,
FontGroup
the font group, i.e. the range of glyphs to be covered. if null, the font group matching the first character will be returned
fontGroup
)

Specifies the typeface, or name of the font that is to be used for this text run - convenience method for calling setFontInfo(FontInfo, FontGroup) with just a font name

public void
setFontInfo(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.
fontInfo
,
FontGroup
the font group, i.e. the range of glyphs to be covered. defaults to latin, if null.
fontGroup
)

Specifies the font to be used for this text run.

public void
setFontSize(Double
font size in points, if null the underlying fontsize will be unset
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

public void
setItalic(boolean
set to true for italic text, false for non-italics
italic
)

Sets the italic state

public void
setStrikethrough(boolean
set to true for stroked text, false for no stroking
stroked
)

Sets the strikethrough state

public void
public void
setUnderlined(boolean
set to true for underlined text, false for no underlining
underlined
)

Sets the underlined state

Method Detail

getFieldTypeback to summary
public TextRun.FieldType getFieldType()

Experimental method to determine the field type, e.g. slide number

Returns:TextRun.FieldType

the field type or null if text run is not a field

Annotations
@Internal
getFontColorback to summary
public PaintStyle getFontColor()

Returns the font color. This usually returns a SolidPaint, but but also other classes are possible

Returns:PaintStyle

the font color/paint

See Also
org.apache.poi.sl.draw.DrawPaint#getPaint(java.awt.Graphics2D, PaintStyle), SolidPaint#getSolidColor(), org.apache.poi.sl.draw.DrawPaint#applyColorTransform(ColorStyle)
getFontFamilyback to summary
public String getFontFamily()

Get the font family - convenience method for getFontInfo(FontGroup)

Returns:String

font family or null if not set

getFontFamilyback to summary
public String getFontFamily(FontGroup fontGroup)

Get the font family - convenience method for getFontInfo(FontGroup)

Parameters
fontGroup:FontGroup

the font group, i.e. the range of glyphs to be covered. if null, the font group matching the first character will be returned

Returns:String

font family or null if not set

getFontInfoback to summary
public FontInfo getFontInfo(FontGroup fontGroup)

Get the font info for the given font group

Parameters
fontGroup:FontGroup

the font group, i.e. the range of glyphs to be covered. if null, the font group matching the first character will be returned

Returns:FontInfo

font info or null if not set

Since
POI 3.17-beta2
getFontSizeback to summary
public Double getFontSize()

Returns the font size which is either set directly on this text run or given from the slide layout

Returns:Double

font size in points or null if font size is not set.

getParagraphback to summary
public TextParagraph<?, ?, ?> getParagraph()
Returns:TextParagraph<?, ?, ?>

the paragraph which contains this TextRun

Since
POI 4.1.0
getPitchAndFamilyback to summary
public byte getPitchAndFamily()
Returns:byte

the pitch and family id or -1 if not applicable

getRawTextback to summary
public String getRawText()
getTextCapback to summary
public TextRun.TextCap getTextCap()
isBoldback to summary
public boolean isBold()
Returns:boolean

true, if text is bold

isItalicback to summary
public boolean isItalic()
Returns:boolean

true, if text is italic

isStrikethroughback to summary
public boolean isStrikethrough()
Returns:boolean

true, if text is stroked

isSubscriptback to summary
public boolean isSubscript()
Returns:boolean

true, if text is sub scripted

isSuperscriptback to summary
public boolean isSuperscript()
Returns:boolean

true, if text is super scripted

isUnderlinedback to summary
public boolean isUnderlined()
Returns:boolean

true, if text is underlined

setBoldback to summary
public void setBold(boolean bold)

Sets the bold state

Parameters
bold:boolean

set to true for bold text, false for normal weight

setFontColorback to summary
public void setFontColor(Color color)

Sets the (solid) font color - convenience function

Parameters
color:Color

the color

setFontColorback to summary
public void setFontColor(PaintStyle color)

Sets the font color

Parameters
color:PaintStyle

the color

See Also
org.apache.poi.sl.draw.DrawPaint#createSolidPaint(Color)
setFontFamilyback to summary
public void setFontFamily(String typeface)

Specifies the typeface, or name of the font that is to be used for this text run - convenience method for calling setFontInfo(FontInfo, FontGroup) with just a font name

Parameters
typeface:String

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.

setFontFamilyback to summary
public void setFontFamily(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 setFontInfo(FontInfo, FontGroup) with just a font name

Parameters
typeface:String

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:FontGroup

the font group, i.e. the range of glyphs to be covered. if null, the font group matching the first character will be returned

setFontInfoback to summary
public void setFontInfo(FontInfo fontInfo, FontGroup fontGroup)

Specifies the font to be used for this text run.

Parameters
fontInfo: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:FontGroup

the font group, i.e. the range of glyphs to be covered. defaults to latin, if null.

Since
POI 3.17-beta2
setFontSizeback to summary
public void setFontSize(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

Parameters
fontSize:Double

font size in points, if null the underlying fontsize will be unset

setItalicback to summary
public void setItalic(boolean italic)

Sets the italic state

Parameters
italic:boolean

set to true for italic text, false for non-italics

setStrikethroughback to summary
public void setStrikethrough(boolean stroked)

Sets the strikethrough state

Parameters
stroked:boolean

set to true for stroked text, false for no stroking

setTextback to summary
public void setText(String text)
setUnderlinedback to summary
public void setUnderlined(boolean underlined)

Sets the underlined state

Parameters
underlined:boolean

set to true for underlined text, false for no underlining

org.apache.poi.sl.usermodel back to summary

public final Enum TextRun.FieldType

extends Enum<TextRun.FieldType>
Class Inheritance

Type of placeholder fields

Field Summary

Modifier and TypeField and Description
public static final TextRun.FieldType
public static final TextRun.FieldType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static TextRun.FieldType
public static TextRun.FieldType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DATE_TIMEback to summary
public static final TextRun.FieldType DATE_TIME
SLIDE_NUMBERback to summary
public static final TextRun.FieldType SLIDE_NUMBER

Constructor Detail

FieldTypeback to summary
private FieldType()

Method Detail

valueOfback to summary
public static TextRun.FieldType valueOf(String name)
valuesback to summary
public static TextRun.FieldType[] values()
org.apache.poi.sl.usermodel back to summary

public final Enum TextRun.TextCap

extends Enum<TextRun.TextCap>
Class Inheritance

Type of text capitals

Field Summary

Modifier and TypeField and Description
public static final TextRun.TextCap
public static final TextRun.TextCap
public static final TextRun.TextCap

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static TextRun.TextCap
public static TextRun.TextCap[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALLback to summary
public static final TextRun.TextCap ALL
NONEback to summary
public static final TextRun.TextCap NONE
SMALLback to summary
public static final TextRun.TextCap SMALL

Constructor Detail

TextCapback to summary
private TextCap()

Method Detail

valueOfback to summary
public static TextRun.TextCap valueOf(String name)
valuesback to summary
public static TextRun.TextCap[] values()