# IPCB\_PrimitiveString class

文本图元

## Signature

```typescript
declare class IPCB_PrimitiveString implements IPCB_Primitive 
```
**Implements:** [IPCB\_Primitive](../interfaces/IPCB_Primitive.md)

## Constructors

<table><thead><tr><th>

Constructor


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[(constructor)(layer, x, y, text, fontFamily, fontSize, lineWidth, alignMode, rotation, reverse, expansion, mirror, primitiveLock, primitiveId)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

Constructs a new instance of the `IPCB_PrimitiveString` class


</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[getState\_AlignMode()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：对齐模式


</td></tr>
<tr><td>

[getState\_Expansion()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：反相扩展


</td></tr>
<tr><td>

[getState\_FontFamily()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：字体


</td></tr>
<tr><td>

[getState\_FontSize()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：字号


</td></tr>
<tr><td>

[getState\_Layer()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：层


</td></tr>
<tr><td>

[getState\_LineWidth()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：线宽


</td></tr>
<tr><td>

[getState\_Mirror()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：是否镜像


</td></tr>
<tr><td>

[getState\_PrimitiveId()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：图元 ID


</td></tr>
<tr><td>

[getState\_PrimitiveLock()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：是否锁定


</td></tr>
<tr><td>

[getState\_PrimitiveType()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：图元类型


</td></tr>
<tr><td>

[getState\_Reverse()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：是否反相


</td></tr>
<tr><td>

[getState\_Rotation()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：旋转角度


</td></tr>
<tr><td>

[getState\_Text()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：文本内容


</td></tr>
<tr><td>

[getState\_X()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：坐标 X


</td></tr>
<tr><td>

[getState\_Y()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

获取属性状态：坐标 Y


</td></tr>
<tr><td>

[isAsync()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

查询图元是否为异步图元


</td></tr>
<tr><td>

[setState\_AlignMode(alignMode)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：对齐模式


</td></tr>
<tr><td>

[setState\_Expansion(expansion)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：反相扩展


</td></tr>
<tr><td>

[setState\_FontFamily(fontFamily)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：字体


</td></tr>
<tr><td>

[setState\_FontSize(fontSize)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：字号


</td></tr>
<tr><td>

[setState\_Layer(layer)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：层


</td></tr>
<tr><td>

[setState\_LineWidth(lineWidth)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：线宽


</td></tr>
<tr><td>

[setState\_Mirror(mirror)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：是否镜像


</td></tr>
<tr><td>

[setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：是否锁定


</td></tr>
<tr><td>

[setState\_Reverse(reverse)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：是否反相


</td></tr>
<tr><td>

[setState\_Rotation(rotation)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：旋转角度


</td></tr>
<tr><td>

[setState\_Text(text)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：文本内容


</td></tr>
<tr><td>

[setState\_X(x)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：坐标 X


</td></tr>
<tr><td>

[setState\_Y(y)](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

**_(BETA)_** 设置属性状态：坐标 Y


</td></tr>
<tr><td>

[toAsync()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

将图元转换为异步图元


</td></tr>
<tr><td>

[toSync()](./IPCB_PrimitiveString.md)


</td><td>


</td><td>

将图元转换为同步图元


</td></tr>
</tbody></table>

---

## 构造函数详情

### _constructor_

# IPCB\_PrimitiveString.(constructor)

Constructs a new instance of the `IPCB_PrimitiveString` class

## Signature

```typescript
constructor(layer: TPCB_LayersOfImage, x: number, y: number, text: string, fontFamily?: string, fontSize?: number, lineWidth?: number, alignMode?: EPCB_PrimitiveStringAlignMode, rotation?: number, reverse?: boolean, expansion?: number, mirror?: boolean, primitiveLock?: boolean, primitiveId?: string);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

layer


</td><td>

[TPCB\_LayersOfImage](../types/TPCB_LayersOfImage.md)


</td><td>


</td></tr>
<tr><td>

x


</td><td>

number


</td><td>


</td></tr>
<tr><td>

y


</td><td>

number


</td><td>


</td></tr>
<tr><td>

text


</td><td>

string


</td><td>


</td></tr>
<tr><td>

fontFamily


</td><td>

string


</td><td>

_(Optional)_


</td></tr>
<tr><td>

fontSize


</td><td>

number


</td><td>

_(Optional)_


</td></tr>
<tr><td>

lineWidth


</td><td>

number


</td><td>

_(Optional)_


</td></tr>
<tr><td>

alignMode


</td><td>

[EPCB\_PrimitiveStringAlignMode](../enums/EPCB_PrimitiveStringAlignMode.md)


</td><td>

_(Optional)_


</td></tr>
<tr><td>

rotation


</td><td>

number


</td><td>

_(Optional)_


</td></tr>
<tr><td>

reverse


</td><td>

boolean


</td><td>

_(Optional)_


</td></tr>
<tr><td>

expansion


</td><td>

number


</td><td>

_(Optional)_


</td></tr>
<tr><td>

mirror


</td><td>

boolean


</td><td>

_(Optional)_


</td></tr>
<tr><td>

primitiveLock


</td><td>

boolean


</td><td>

_(Optional)_


</td></tr>
<tr><td>

primitiveId


</td><td>

string


</td><td>

_(Optional)_


</td></tr>
</tbody></table>


---

## 方法详情

### getstate_alignmode

# IPCB\_PrimitiveString.getState\_AlignMode() method

获取属性状态：对齐模式

## Signature

```typescript
getState_AlignMode(): EPCB_PrimitiveStringAlignMode;
```


## Returns

[EPCB\_PrimitiveStringAlignMode](../enums/EPCB_PrimitiveStringAlignMode.md)

对齐模式

### getstate_expansion

# IPCB\_PrimitiveString.getState\_Expansion() method

获取属性状态：反相扩展

## Signature

```typescript
getState_Expansion(): number;
```


## Returns

number

反相扩展

### getstate_fontfamily

# IPCB\_PrimitiveString.getState\_FontFamily() method

获取属性状态：字体

## Signature

```typescript
getState_FontFamily(): string;
```


## Returns

string

字体

### getstate_fontsize

# IPCB\_PrimitiveString.getState\_FontSize() method

获取属性状态：字号

## Signature

```typescript
getState_FontSize(): number;
```


## Returns

number

字号

### getstate_layer

# IPCB\_PrimitiveString.getState\_Layer() method

获取属性状态：层

## Signature

```typescript
getState_Layer(): TPCB_LayersOfImage;
```


## Returns

[TPCB\_LayersOfImage](../types/TPCB_LayersOfImage.md)

层

### getstate_linewidth

# IPCB\_PrimitiveString.getState\_LineWidth() method

获取属性状态：线宽

## Signature

```typescript
getState_LineWidth(): number;
```


## Returns

number

线宽

### getstate_mirror

# IPCB\_PrimitiveString.getState\_Mirror() method

获取属性状态：是否镜像

## Signature

```typescript
getState_Mirror(): boolean;
```


## Returns

boolean

是否镜像

### getstate_primitiveid

# IPCB\_PrimitiveString.getState\_PrimitiveId() method

获取属性状态：图元 ID

## Signature

```typescript
getState_PrimitiveId(): string;
```


## Returns

string

图元 ID

### getstate_primitivelock

# IPCB\_PrimitiveString.getState\_PrimitiveLock() method

获取属性状态：是否锁定

## Signature

```typescript
getState_PrimitiveLock(): boolean;
```


## Returns

boolean

是否锁定

### getstate_primitivetype

# IPCB\_PrimitiveString.getState\_PrimitiveType() method

获取属性状态：图元类型

## Signature

```typescript
getState_PrimitiveType(): EPCB_PrimitiveType;
```


## Returns

[EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)

图元类型

### getstate_reverse

# IPCB\_PrimitiveString.getState\_Reverse() method

获取属性状态：是否反相

## Signature

```typescript
getState_Reverse(): boolean;
```


## Returns

boolean

是否反相

### getstate_rotation

# IPCB\_PrimitiveString.getState\_Rotation() method

获取属性状态：旋转角度

## Signature

```typescript
getState_Rotation(): number;
```


## Returns

number

旋转角度

### getstate_text

# IPCB\_PrimitiveString.getState\_Text() method

获取属性状态：文本内容

## Signature

```typescript
getState_Text(): string;
```


## Returns

string

文本内容

### getstate_x

# IPCB\_PrimitiveString.getState\_X() method

获取属性状态：坐标 X

## Signature

```typescript
getState_X(): number;
```


## Returns

number

坐标 X

### getstate_y

# IPCB\_PrimitiveString.getState\_Y() method

获取属性状态：坐标 Y

## Signature

```typescript
getState_Y(): number;
```


## Returns

number

坐标 Y

### isasync

# IPCB\_PrimitiveString.isAsync() method

查询图元是否为异步图元

## Signature

```typescript
isAsync(): boolean;
```


## Returns

boolean

是否为异步图元

### setstate_alignmode

# IPCB\_PrimitiveString.setState\_AlignMode() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：对齐模式

## Signature

```typescript
setState_AlignMode(alignMode: EPCB_PrimitiveStringAlignMode): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

alignMode


</td><td>

[EPCB\_PrimitiveStringAlignMode](../enums/EPCB_PrimitiveStringAlignMode.md)


</td><td>

对齐模式


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_expansion

# IPCB\_PrimitiveString.setState\_Expansion() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：反相扩展

## Signature

```typescript
setState_Expansion(expansion: number): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

expansion


</td><td>

number


</td><td>

反相扩展


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_fontfamily

# IPCB\_PrimitiveString.setState\_FontFamily() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：字体

## Signature

```typescript
setState_FontFamily(fontFamily: string): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

fontFamily


</td><td>

string


</td><td>

字体


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_fontsize

# IPCB\_PrimitiveString.setState\_FontSize() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：字号

## Signature

```typescript
setState_FontSize(fontSize: number): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

fontSize


</td><td>

number


</td><td>

字号


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_layer

# IPCB\_PrimitiveString.setState\_Layer() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：层

## Signature

```typescript
setState_Layer(layer: TPCB_LayersOfImage): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

layer


</td><td>

[TPCB\_LayersOfImage](../types/TPCB_LayersOfImage.md)


</td><td>

层


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_linewidth

# IPCB\_PrimitiveString.setState\_LineWidth() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：线宽

## Signature

```typescript
setState_LineWidth(lineWidth: number): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

lineWidth


</td><td>

number


</td><td>

线宽


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_mirror

# IPCB\_PrimitiveString.setState\_Mirror() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：是否镜像

## Signature

```typescript
setState_Mirror(mirror: boolean): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

mirror


</td><td>

boolean


</td><td>

是否镜像


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_primitivelock

# IPCB\_PrimitiveString.setState\_PrimitiveLock() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：是否锁定

## Signature

```typescript
setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

primitiveLock


</td><td>

boolean


</td><td>

是否锁定


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_reverse

# IPCB\_PrimitiveString.setState\_Reverse() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：是否反相

## Signature

```typescript
setState_Reverse(reverse: boolean): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

reverse


</td><td>

boolean


</td><td>

是否反相


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_rotation

# IPCB\_PrimitiveString.setState\_Rotation() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：旋转角度

## Signature

```typescript
setState_Rotation(rotation: number): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

rotation


</td><td>

number


</td><td>

旋转角度


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_text

# IPCB\_PrimitiveString.setState\_Text() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：文本内容

## Signature

```typescript
setState_Text(text: string): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

text


</td><td>

string


</td><td>

文本内容


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_x

# IPCB\_PrimitiveString.setState\_X() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：坐标 X

## Signature

```typescript
setState_X(x: number): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

x


</td><td>

number


</td><td>

坐标 X


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### setstate_y

# IPCB\_PrimitiveString.setState\_Y() method

> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

设置属性状态：坐标 Y

## Signature

```typescript
setState_Y(y: number): IPCB_PrimitiveString;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

y


</td><td>

number


</td><td>

坐标 Y


</td></tr>
</tbody></table>



## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### toasync

# IPCB\_PrimitiveString.toAsync() method

将图元转换为异步图元

## Signature

```typescript
toAsync(): IPCB_PrimitiveString;
```


## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象

### tosync

# IPCB\_PrimitiveString.toSync() method

将图元转换为同步图元

## Signature

```typescript
toSync(): IPCB_PrimitiveString;
```


## Returns

[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)

文本图元对象
