# TextState Class

> The text state includes parameters that affect text.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2e
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/TextState
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/llms.txt

```java
class TextState
```

**Namespace:** `com::datalogics::PDFL`

## Description

The text state includes parameters that affect text. These parameters include character and word spacing, font, font size, and horizontal scale.

**Referenced by:** [`Text`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Text.md), [`TextRun`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/TextRun.md)

## Constructors

### TextState

```java
com.datalogics.PDFL.TextState.TextState()
```

*constructor*

Create a default text state

## Methods

### delete

```java
synchronized void com.datalogics.PDFL.TextState.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.TextState.delete()
```

**Returns:** `synchronized void`

### finalize

```java
void com.datalogics.PDFL.TextState.finalize()
```

*protected*

**Returns:** `void`

### getCharacterSpacing

```java
double com.datalogics.PDFL.TextState.getCharacterSpacing()
```

**Returns:** `double`

The current character spacing (corresponding to the Tc operator), in unscaled text space units.

### getFontSize

```java
double com.datalogics.PDFL.TextState.getFontSize()
```

**Returns:** `double`

The current font size (corresponding to the Tf operator).

### getHScale

```java
double com.datalogics.PDFL.TextState.getHScale()
```

**Returns:** `double`

The current horizontal scaling (corresponding to the Tz operator), as a percentage of the normal glyph width. Default is 100.

### getRenderMode

```java
TextRenderMode com.datalogics.PDFL.TextState.getRenderMode()
```

**Returns:** `TextRenderMode`

The current text rendering mode (corresponding to the Tr operator).

### getTextRise

```java
double com.datalogics.PDFL.TextState.getTextRise()
```

**Returns:** `double`

The current text rise (corresponding to the Ts operator), in unscaled text space units.

### getWordSpacing

```java
double com.datalogics.PDFL.TextState.getWordSpacing()
```

**Returns:** `double`

The current word spacing (corresponding to the Tw operator), in unscaled text space units.

### setCharacterSpacing

```java
void com.datalogics.PDFL.TextState.setCharacterSpacing(double Tc)
```

**Parameters**

- `Tc` (`double`): the new/updated character spacing

**Returns:** `void`

The current character spacing (corresponding to the Tc operator), in unscaled text space units.

### setFontSize

```java
void com.datalogics.PDFL.TextState.setFontSize(double Tf)
```

**Parameters**

- `Tf` (`double`): the new/updated font size

**Returns:** `void`

The current font size (corresponding to the Tf operator).

### setHScale

```java
void com.datalogics.PDFL.TextState.setHScale(double Tz)
```

**Parameters**

- `Tz` (`double`): the new/updated horizontal scaling

**Returns:** `void`

The current horizontal scaling (corresponding to the Tz operator), as a percentage of the normal glyph width. Default is 100.

### setRenderMode

```java
void com.datalogics.PDFL.TextState.setRenderMode(TextRenderMode Tr)
```

**Parameters**

- `Tr` (`TextRenderMode`): the new/updated text rendering mode

**Returns:** `void`

The current text rendering mode (corresponding to the Tr operator).

### setTextRise

```java
void com.datalogics.PDFL.TextState.setTextRise(double Ts)
```

**Parameters**

- `Ts` (`double`): the new/updated text rise

**Returns:** `void`

The current text rise (corresponding to the Ts operator), in unscaled text space units.

### setWordSpacing

```java
void com.datalogics.PDFL.TextState.setWordSpacing(double Tw)
```

**Parameters**

- `Tw` (`double`): the new/updated character spacing

**Returns:** `void`

The current word spacing (corresponding to the Tw operator), in unscaled text space units.
