> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/korean/development/api-reference/classes/textservice.md).

# TextService

TextService : `Instance`

## Overview

TextService는 텍스트가 화면에서 차지할 크기를 미리 계산할 수 있는 서비스입니다.

폰트와 크기가 달라지면 같은 문장이라도 차지하는 영역이 달라지므로, UI를 배치하기 전에 필요한 크기를 구할 때 사용합니다.

## Properties

## Methods

### GetTextBoundsAsync

지정한 조건으로 텍스트가 차지하는 영역의 크기를 계산하여 Pixel 단위로 반환하는 메서드입니다.

측정 조건은 GetTextBoundsParams 오브젝트로 전달합니다.

#### Parameters

| `Instance` Params | 측정 조건을 담은 GetTextBoundsParams 오브젝트입니다. |
| ----------------- | -------------------------------------- |

#### Return

| `Vector2` | 텍스트가 차지하는 영역의 너비와 높이입니다. |
| --------- | ------------------------ |

#### **Code Samples**

```lua
local TextService = game:GetService("TextService")

local Params = Instance.new("GetTextBoundsParams")
Params.Font = Font.fromName("NotoSans", Enum.FontWeight.Regular, Enum.FontStyle.Normal)
Params.Text = "Hello OVERDARE"
Params.Size = 20
Params.Width = 200

local function GetTextBounds()
    return TextService:GetTextBoundsAsync(Params)
end

local Success, Bounds = pcall(GetTextBounds)

if Success then
    print(Bounds)
end

```

## Events

## See also

{% content-ref url="/pages/arMwoKxsV8ANZ9KN4IKV" %}
[GetTextBoundsParams](/korean/development/api-reference/classes/gettextboundsparams.md)
{% endcontent-ref %}
