TextElement

TextElement

new TextElement(data)

Source:
Parameters:
Name Type Description
data Object

文本元素数据

Members

blend :string

混合模式

Source:
Type:
  • string

color :string

文字颜色

Source:
Type:
  • string

content :string

文本内容

Source:
Type:
  • string

direction :string

文本方向

Source:
Type:
  • string

effect :Object

文字效果

Source:
Type:

font :string

字体家族

Source:
Type:
  • string

horizontalAlign :string

水平对齐

Source:
Type:
  • string

letterSpacing :number

字间距

Source:
Type:
  • number

lineSpacing :number

行间距

Source:
Type:
  • number

overflow :string

文字溢出模式

Source:
Type:
  • string

printer :Printer|null

文字打印机

Source:
Type:

size :number

字体大小

Source:
Type:
  • number

textHeight :number

文本高度

Source:
Type:
  • number

textWidth :number

文本宽度

Source:
Type:
  • number

texture :Texture|null

文字打印机纹理

Source:
Type:

truncate :boolean

文字溢出时是否截断

Source:
Type:
  • boolean

typeface :string

字型

Source:
Type:
  • string

verticalAlign :string

垂直对齐

Source:
Type:
  • string

wordWrap :boolean

是否自动换行

Source:
Type:
  • boolean

Methods

calculateTextPosition()

计算文本位置

Source:

destroy()

销毁文本元素

Source:

draw()

绘制文本元素

Source:

resize()

重新调整文本元素

Source:

resizeEmbeddedImages()

调整内嵌图像元素

Source:

update()

更新文本到打印机中

Source: