---
title: "TextStyle"
url: "https://reference.aspose.com/pdf/java/com.aspose.pdf/textstyle/"
product: "Aspose.PDF for Java API Reference"
description: "Class representing checkbox field"
---

**Inheritance:**
java.lang.Object, com.aspose.pdf.TextStyle

```
public class TextStyle extends Object
```

Class representing checkbox field

## Methods

| Method | Description |
| --- | --- |
| [getAlignment](#getAlignment--) | Gets horizontal alignment of the text. |
| [getColor](#getColor--) | Get the Color of the text. |
| [getFontName](#getFontName--) | Get the Name of the font. |
| [getFontSize](#getFontSize--) | Get the Fonts size. |
| [getHorizontalAlignment](#getHorizontalAlignment--) | Text alignment. Valid values are: Left, Center, Rigth. |
| [setAlignment](#setAlignment-com.aspose.pdf.TextAlignment-) | Sets horizontal alignment of the text. |
| [setColor](#setColor-java.awt.Color-) | Set the Color of the text. |
| [setFontName](#setFontName-java.lang.String-) | Set the Name of the font. |
| [setFontSize](#setFontSize-double-) | Set the Fonts size. |
| [setHorizontalAlignment](#setHorizontalAlignment-com.aspose.pdf.HorizontalAlignment-) | Text alignment. Valid values are: Left, Center, Rigth. |
| [toString](#toString--) | String representation of TextStyle. |

### getAlignment {#getAlignment--}
```
@Deprecated public TextAlignment getAlignment()
```

Gets horizontal alignment of the text.

**Returns:**
TextAlignment value @see TextAlignment

### getColor {#getColor--}
```
public Color getColor()
```

Get the Color of the text.

**Returns:**
Color object

### getFontName {#getFontName--}
```
public String getFontName()
```

Get the Name of the font.

**Returns:**
String value

### getFontSize {#getFontSize--}
```
public double getFontSize()
```

Get the Fonts size.

**Returns:**
double value

### getHorizontalAlignment {#getHorizontalAlignment--}
```
public HorizontalAlignment getHorizontalAlignment()
```

Text alignment. Valid values are: Left, Center, Rigth.

**Returns:**
HorizontalAlignment value @see HorizontalAlignment

### setAlignment {#setAlignment-com.aspose.pdf.TextAlignment-}
Sets horizontal alignment of the text.

### setColor {#setColor-java.awt.Color-}
Set the Color of the text.

### setFontName {#setFontName-java.lang.String-}
Set the Name of the font.

### setFontSize {#setFontSize-double-}
```
public void setFontSize(double value)
```

Set the Fonts size.

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value |  | double value |

### setHorizontalAlignment {#setHorizontalAlignment-com.aspose.pdf.HorizontalAlignment-}
Text alignment. Valid values are: Left, Center, Rigth.

### toString {#toString--}
```
public String toString()
```

String representation of TextStyle.

**Returns:**
String representation.
