TextStyle class

文本样式属性

Annotations
  • @JsonSerializable.new(explicitToJson: true)

Constructors

TextStyle(TextFormat textFormat)
JsonSerializable不能使用私有构造TextStyle._(this.textFormat);
TextStyle.fromJson(Map<String, dynamic> json)
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textFormat → TextFormat
final

Methods

enableAntiColor(bool enable) → TextStyle
文本反显
enableBold(bool enable) → TextStyle
文本加粗
enableInvert(bool enable) → TextStyle
文本倒置
enableItalics(bool enable) → TextStyle
设置斜体
enableStrikethrough(bool enable) → TextStyle
设置删除线
enableUnderline(bool enable) → TextStyle
设置下划线开关
format() → TextFormat
获取当前文本格式
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAlign(Align align) → TextStyle
行打印仅针对表格时的相对位置
setFont(String customFont) → TextStyle
设置自定义字体
setHeight(int height) → TextStyle
行打印设置无效
setPosX(int offset) → TextStyle
行打印中设置文本内容相对位置
setPosY(int offset) → TextStyle
行打印设置无效
setRenderColor(RenderColor renderColor) → TextStyle
设置字体的颜色
setRotate(Rotate rotate) → TextStyle
行打印设置无效
setTextHeightRatio(int ratio) → TextStyle
设置打印文本的纵向放大倍数
setTextSize(int size) → TextStyle
设置文本字体大小(依赖打印机的渲染支持)
setTextSpace(int space) → TextStyle
设置文本两边的间距
setTextWidthRatio(int ratio) → TextStyle
设置打印文本的横向放大倍数
setWidth(int width) → TextStyle
行打印设置无效
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

getStyle() → TextStyle
返回当前设置的样式属性对象