# surface.GetTextSize

- **Ortam:** İstemci, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/surface.GetTextSize
- **Çeviri tarihi:** 2026-03-26

```lua
number, number surface.GetTextSize( string text )
```

## Açıklama

[surface.SetFont](https://gmod.tr/wiki/surface.SetFont) ile ayarlanan yazı tipini kullanarak verilen metnin genişliğini ve yüksekliğini (piksel cinsinden) döndürür.

## Argümanlar

1. [string](https://gmod.tr/wiki/string) **text**: Boyutunun kontrol edileceği dize.

## Dönüşler

1. [number](https://gmod.tr/wiki/number): Sağlanan metnin genişliği.
2. [number](https://gmod.tr/wiki/number): Sağlanan metnin yüksekliği.

### Örnek

`Hello World` metninin Trebuchet24 yazı tipindeki boyutunu yazdırır.

```lua
surface.SetFont( "Trebuchet24" )

local text = "Hello World"
local width, height = surface.GetTextSize( text )

print("Text width: " .. width .. ", text height: " .. height)
```

**Çıktı:**

```lua
Text width: 100, text height: 24
```

### Örnek

Metin yüksekliğini çok hızlı bir şekilde alın. Tablo veya yedek değişken kullanılmaz.

```lua
surface.SetFont( "Trebuchet24" )

local text = "Hello World"
local height = select( 2, surface.GetTextSize( text ) )

print( height )
```

**Çıktı:**

```lua
24
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/surface.GetTextSize
