public interface TextRun
Modifier and Type | Interface and Description |
---|---|
static class |
TextRun.FieldType
Type of placeholder fields
(占位符字段的类型)
|
static class |
TextRun.TextCap
Type of text capitals
(文本大写的类型)
|
Modifier and Type | Method and Description |
---|---|
Hyperlink<?,?> |
createHyperlink()
Creates a new hyperlink and assigns it to this text run.
(创建一个新的超链接并将其分配给此文本运行。)
|
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
getFontInfo(FontGroup)
(获取字体系列 - getFontInfo(FontGroup) 的便捷方法)
|
java.lang.String |
getFontFamily(FontGroup fontGroup)
Get the font family - convenience method for
getFontInfo(FontGroup)
(获取字体系列 - 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
(返回直接在此文本运行中设置或从幻灯片布局中给出的字体大小)
|
Hyperlink<?,?> |
getHyperlink()
Return the associated hyperlink
(返回关联的超链接)
|
TextParagraph<?,?,?> |
getParagraph() |
byte |
getPitchAndFamily() |
java.lang.String |
getRawText() |
TextRun.TextCap |
getTextCap() |
boolean |
isBold() |
boolean |
isItalic() |
boolean |
isStrikethrough() |
boolean |
isSubscript() |
boolean |
isSuperscript() |
boolean |
isUnderlined() |
void |
setBold(boolean bold)
Sets the bold state
(设置粗体状态)
|
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
setFontInfo(FontInfo, FontGroup) with just a font name
(指定要用于此文本运行的字体或字体名称 - 仅使用字体名称调用 setFontInfo(FontInfo, FontGroup) 的便捷方法)
|
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
setFontInfo(FontInfo, FontGroup) with just a font name
(指定要用于此文本运行的字体或字体名称 - 仅使用字体名称调用 setFontInfo(FontInfo, FontGroup) 的便捷方法)
|
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
(直接在此文本运行上设置字体大小,如果给出 null,则字体大小默认为幻灯片布局中给出的值)
|
void |
setItalic(boolean italic)
Sets the italic state
(设置斜体状态)
|
void |
setStrikethrough(boolean stroked)
Sets the strikethrough state
(设置删除线状态)
|
void |
setText(java.lang.String text) |
void |
setUnderlined(boolean underlined)
Sets the underlined state
(设置下划线状态)
|
java.lang.String getRawText()
void setText(java.lang.String text)
TextRun.TextCap getTextCap()
PaintStyle getFontColor()
PaintStyle.SolidPaint
, but but also other classes are possible
(返回字体颜色。这通常返回 PaintStyle.SolidPaint,但其他类也是可能的)
DrawPaint.getPaint(java.awt.Graphics2D, PaintStyle)
,
PaintStyle.SolidPaint.getSolidColor()
,
DrawPaint.applyColorTransform(ColorStyle)
void setFontColor(java.awt.Color color)
color
- the color
(颜色 - 颜色)
void setFontColor(PaintStyle color)
color
- the color
(颜色 - 颜色)
DrawPaint.createSolidPaint(Color)
java.lang.Double getFontSize()
void setFontSize(java.lang.Double fontSize)
fontSize
- font size in points, if null the underlying fontsize will be unset
(fontSize - 以磅为单位的字体大小,如果为 null,则底层字体大小将被取消设置)
java.lang.String getFontFamily()
getFontInfo(FontGroup)
(获取字体系列 - getFontInfo(FontGroup) 的便捷方法)
java.lang.String getFontFamily(FontGroup fontGroup)
getFontInfo(FontGroup)
(获取字体系列 - getFontInfo(FontGroup) 的便捷方法)
fontGroup
- the font group, i.e. the range of glpyhs to be covered. if
null
, the font group matching the first character will be returned
(fontGroup - 字体组,即要覆盖的 glpyhs 的范围。如果为null,则返回匹配第一个字符的字体组)
void setFontFamily(java.lang.String typeface)
setFontInfo(FontInfo, FontGroup)
with just a font name
(指定要用于此文本运行的字体或字体名称 - 仅使用字体名称调用 setFontInfo(FontInfo, FontGroup) 的便捷方法)
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.
(typeface - 应用于此文本运行的字体。 null 的值会删除运行特定的字体设置,因此会再次激活默认设置。)
void setFontFamily(java.lang.String typeface, FontGroup fontGroup)
setFontInfo(FontInfo, FontGroup)
with just a font name
(指定要用于此文本运行的字体或字体名称 - 仅使用字体名称调用 setFontInfo(FontInfo, FontGroup) 的便捷方法)
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.
(typeface - 应用于此文本运行的字体。 null 的值会删除运行特定的字体设置,因此会再次激活默认设置。)
fontGroup
- the font group, i.e. the range of glpyhs to be covered. if
null
, the font group matching the first character will be returned
(fontGroup - 字体组,即要覆盖的 glpyhs 的范围。如果为null,则返回匹配第一个字符的字体组)
FontInfo getFontInfo(FontGroup fontGroup)
fontGroup
- the font group, i.e. the range of glpyhs to be covered. if
null
, the font group matching the first character will be returned
(fontGroup - 字体组,即要覆盖的 glpyhs 的范围。如果为null,则返回匹配第一个字符的字体组)
null
if not set
(字体信息或 null 如果未设置)
void setFontInfo(FontInfo fontInfo, FontGroup fontGroup)
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 - 应用于此文本运行的字体。 null 的值会删除运行特定的字体设置,因此会再次激活默认设置。)
fontGroup
- the font group, i.e. the range of glpyhs to be covered. defaults to latin, if
null
.
(fontGroup - 字体组,即要覆盖的 glpyhs 的范围。如果为 null,则默认为拉丁语。)
boolean isBold()
void setBold(boolean bold)
bold
- set to true for bold text, false for normal weight
(粗体 - 对于粗体文本设置为 true,对于正常重量设置为 false)
boolean isItalic()
void setItalic(boolean italic)
italic
- set to true for italic text, false for non-italics
(斜体 - 设置为真斜体文本,假非斜体)
boolean isUnderlined()
void setUnderlined(boolean underlined)
underlined
- set to true for underlined text, false for no underlining
(underlined - 为带下划线的文本设置为 true,为无下划线设置为 false)
boolean isStrikethrough()
void setStrikethrough(boolean stroked)
stroked
- set to true for stroked text, false for no stroking
(stroked - 设置为 true 表示有描边的文本,设置为 false 表示没有描边)
boolean isSubscript()
boolean isSuperscript()
byte getPitchAndFamily()
Hyperlink<?,?> getHyperlink()
Hyperlink<?,?> createHyperlink()
@Internal TextRun.FieldType getFieldType()
null
if text run is not a field
(如果 text run 不是字段,则字段类型或 null)
TextParagraph<?,?,?> getParagraph()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.