# Google Cloud Document Ai V1 Client - Class StyleInfo (2.7.0)

2.7.0 (latest) 2.6.1 2.5.1 2.4.1 2.3.0 2.2.2 2.1.3 2.0.0 1.14.0 1.13.1 1.12.2 1.9.0 1.8.2 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.2 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Document Ai V1 Client class StyleInfo.

Font and other text style attributes.

Generated from protobuf message `google.cloud.documentai.v1.Document.Page.Token.StyleInfo`

## Namespace

Google \\ Cloud \\ DocumentAI \\ V1 \\ Document \\ Page \\ Token

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ font_size` | `int` Font size in points (`1` point is `¹⁄₇₂` inches). |
| `↳ pixel_font_size` | `float` Font size in pixels, equal to *unrounded [font_size](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Page.Token.StyleInfo#_Google_Cloud_DocumentAI_V1_Document_Page_Token_StyleInfo__getFontSize__)* \* \* *resolution* ÷ `72.0`. |
| `↳ letter_spacing` | `float` Letter spacing in points. |
| `↳ font_type` | `string` Name or style of the font. |
| `↳ bold` | `bool` Whether the text is bold (equivalent to [font_weight](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Page.Token.StyleInfo#_Google_Cloud_DocumentAI_V1_Document_Page_Token_StyleInfo__getFontWeight__) is at least `700`). |
| `↳ italic` | `bool` Whether the text is italic. |
| `↳ underlined` | `bool` Whether the text is underlined. |
| `↳ strikeout` | `bool` Whether the text is strikethrough. This feature is not supported yet. |
| `↳ subscript` | `bool` Whether the text is a subscript. This feature is not supported yet. |
| `↳ superscript` | `bool` Whether the text is a superscript. This feature is not supported yet. |
| `↳ smallcaps` | `bool` Whether the text is in small caps. This feature is not supported yet. |
| `↳ font_weight` | `int` TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy). Normal is `400`, bold is `700`. |
| `↳ handwritten` | `bool` Whether the text is handwritten. |
| `↳ text_color` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Color.html` Color of the text. |
| `↳ background_color` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Color.html` Color of the background. |

### getFontSize

Font size in points (`1` point is `¹⁄₇₂` inches).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setFontSize

Font size in points (`1` point is `¹⁄₇₂` inches).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPixelFontSize

Font size in pixels, equal to *unrounded
[font_size](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Page.Token.StyleInfo#_Google_Cloud_DocumentAI_V1_Document_Page_Token_StyleInfo__getFontSize__)*

- *resolution* ÷ `72.0`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setPixelFontSize

Font size in pixels, equal to *unrounded
[font_size](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Page.Token.StyleInfo#_Google_Cloud_DocumentAI_V1_Document_Page_Token_StyleInfo__getFontSize__)*

- *resolution* ÷ `72.0`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLetterSpacing

Letter spacing in points.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setLetterSpacing

Letter spacing in points.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFontType

Name or style of the font.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setFontType

Name or style of the font.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBold

Whether the text is bold (equivalent to
[font_weight](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Page.Token.StyleInfo#_Google_Cloud_DocumentAI_V1_Document_Page_Token_StyleInfo__getFontWeight__)
is at least `700`).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setBold

Whether the text is bold (equivalent to
[font_weight](https://docs.cloud.google.com/php/docs/reference/cloud-document-ai/latest/V1.Document.Page.Token.StyleInfo#_Google_Cloud_DocumentAI_V1_Document_Page_Token_StyleInfo__getFontWeight__)
is at least `700`).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getItalic

Whether the text is italic.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setItalic

Whether the text is italic.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUnderlined

Whether the text is underlined.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setUnderlined

Whether the text is underlined.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStrikeout

Whether the text is strikethrough. This feature is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setStrikeout

Whether the text is strikethrough. This feature is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSubscript

Whether the text is a subscript. This feature is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setSubscript

Whether the text is a subscript. This feature is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSuperscript

Whether the text is a superscript. This feature is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setSuperscript

Whether the text is a superscript. This feature is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSmallcaps

Whether the text is in small caps. This feature is not supported yet.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setSmallcaps

Whether the text is in small caps. This feature is not supported yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFontWeight

TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy).

Normal is `400`, bold is `700`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setFontWeight

TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy).

Normal is `400`, bold is `700`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getHandwritten

Whether the text is handwritten.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setHandwritten

Whether the text is handwritten.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTextColor

Color of the text.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Color.html|null` |   |

### hasTextColor

### clearTextColor

### setTextColor

Color of the text.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Color.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBackgroundColor

Color of the background.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Color.html|null` |   |

### hasBackgroundColor

### clearBackgroundColor

### setBackgroundColor

Color of the background.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Color.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |