public class FontSizeRichStyle extends RichStyle
RichText instance.
This class supports both relative size and absolute size. It also supports different units for the absolute size.
RichText.setRichStyle(RichStyle, int, int, RangedRichStyle.Flag)RichStyle.Capability, RichStyle.TypeId| 构造器 | 说明 |
|---|---|
FontSizeRichStyle(float ratio) |
A constructor used to create a
FontSizeRichStyle instance with the specified ratio. |
FontSizeRichStyle(int size,
Text.TextSizeType textSizeType) |
A constructor used to create a
FontSizeRichStyle instance with the specified size. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
float |
getRatio() |
Obtains the ratio in this
FontSizeRichStyle instance. |
int |
getSize() |
Obtains the font size in this
FontSizeRichStyle instance. |
Text.TextSizeType |
getTextSizeType() |
Obtains the unit of the font size in this
FontSizeRichStyle instance. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCapability, getRichStyleTypeIdpublic FontSizeRichStyle(float ratio)
FontSizeRichStyle instance with the specified ratio.ratio - Indicates the relative ratio of the font size.IllegalArgumentException - Throws this exception if the specified ratio is less than 0.public FontSizeRichStyle(int size,
Text.TextSizeType textSizeType)
FontSizeRichStyle instance with the specified size.size - Indicates the absolute font size.textSizeType - Indicates the unit of the font size. If this parameter is left empty, VP is used.IllegalArgumentException - Throws this exception if the specified size is less than 0.Text.TextSizeTypepublic float getRatio()
FontSizeRichStyle instance.0.0f if the absolute size is used.public int getSize()
FontSizeRichStyle instance.0 if the relative size is used.public Text.TextSizeType getTextSizeType()
FontSizeRichStyle instance.TextSizeType#VP
if the relative size is used.