# SimpleFontStringAPI (widget methods): World of Warcraft Forever API

Forever 1.60.1 (70959), Interface 16001, Lua 5.1, from Blizzard's own API documentation. Page: https://wowaddons.gg/forever-api/SimpleFontStringAPI

## Functions

### CalculateScreenAreaFromCharacterSpan

```lua
areas = self:CalculateScreenAreaFromCharacterSpan(leftIndex, rightIndex)
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments:
- `leftIndex`: luaIndex
- `rightIndex`: luaIndex

Returns:
- `areas`: uiBoundsRect[], may be nil

### CanNonSpaceWrap

```lua
wrap = self:CanNonSpaceWrap()
```

Returns:
- `wrap`: bool

### CanWordWrap

```lua
wrap = self:CanWordWrap()
```

Returns:
- `wrap`: bool

### ClearAlphaGradient

```lua
self:ClearAlphaGradient()
```

### ClearText

```lua
self:ClearText()
```

Sets text to an empty string and removes the Text secret aspect.

### FindCharacterIndexAtCoordinate

```lua
characterIndex, inside = self:FindCharacterIndexAtCoordinate(x, y)
```

May return nothing.

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments:
- `x`: uiUnit
- `y`: uiUnit

Returns:
- `characterIndex`: luaIndex
- `inside`: bool

### GetAlphaGradient

```lua
start, length = self:GetAlphaGradient()
```

Returns:
- `start`: number
- `length`: number

### GetFieldSize

```lua
fieldSize = self:GetFieldSize()
```

Returns:
- `fieldSize`: number

### GetFont

```lua
fontFile, fontHeight, flags = self:GetFont()
```

Returns:
- `fontFile`: FontAsset, may be nil
- `fontHeight`: uiUnit
- `flags`: TBFFlags

### GetFontHeight

```lua
height = self:GetFontHeight([calculated])
```

Arguments:
- `calculated`: bool, default true

Returns:
- `height`: uiUnit

### GetFontObject

```lua
font = self:GetFontObject()
```

Returns:
- `font`: SimpleFont

### GetIndentedWordWrap

```lua
wrap = self:GetIndentedWordWrap()
```

Returns:
- `wrap`: bool

### GetJustifyH

```lua
justifyH = self:GetJustifyH()
```

Returns:
- `justifyH`: JustifyHorizontal

### GetJustifyV

```lua
justifyV = self:GetJustifyV()
```

Returns:
- `justifyV`: JustifyVertical

### GetLineHeight

```lua
lineHeight = self:GetLineHeight()
```

Returns:
- `lineHeight`: uiUnit

### GetMaxLines

```lua
maxLines = self:GetMaxLines()
```

Returns:
- `maxLines`: number

### GetNumLines

```lua
numLines = self:GetNumLines()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `numLines`: number

### GetRotation

```lua
radians = self:GetRotation()
```

Returns:
- `radians`: number

### GetScaleAnimationMode

```lua
scaleAnimationMode = self:GetScaleAnimationMode()
```

Returns:
- `scaleAnimationMode`: FontStringScaleAnimationMode

### GetShadowColor

```lua
colorR, colorG, colorB, colorA = self:GetShadowColor()
```

Returns:
- `colorR`: number
- `colorG`: number
- `colorB`: number
- `colorA`: number

### GetShadowOffset

```lua
offsetX, offsetY = self:GetShadowOffset()
```

Returns:
- `offsetX`: number
- `offsetY`: number

### GetSmoothScaling

```lua
smoothScaling = self:GetSmoothScaling()
```

Returns:
- `smoothScaling`: bool

### GetSpacing

```lua
spacing = self:GetSpacing()
```

Returns:
- `spacing`: uiUnit

### GetStringHeight

```lua
height = self:GetStringHeight()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `height`: uiUnit

### GetStringWidth

```lua
width = self:GetStringWidth()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `width`: uiUnit

### GetText

```lua
text = self:GetText()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `text`: cstring

### GetTextColor

```lua
colorR, colorG, colorB, colorA = self:GetTextColor()
```

May return nothing.

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `colorR`: number
- `colorG`: number
- `colorB`: number
- `colorA`: number

### GetTextScale

```lua
textScale = self:GetTextScale()
```

Returns:
- `textScale`: number

### GetUnboundedStringWidth

```lua
width = self:GetUnboundedStringWidth()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `width`: uiUnit

### GetUnboundedStringWidthForText

```lua
width = self:GetUnboundedStringWidthForText(text)
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Arguments:
- `text`: cstring

Returns:
- `width`: uiUnit

### GetWrappedWidth

```lua
width = self:GetWrappedWidth()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `width`: uiUnit

### IsTruncated

```lua
isTruncated = self:IsTruncated()
```

Its returns can be secret values (in some instances and fights): guard them before any arithmetic.

Returns:
- `isTruncated`: bool

### OnColorsUpdated

```lua
self:OnColorsUpdated()
```

### SetAlphaGradient

```lua
isWithinText = self:SetAlphaGradient(start, length)
```

Arguments:
- `start`: number
- `length`: number

Returns:
- `isWithinText`: bool

### SetDesaturateEmbeddedTextures

```lua
self:SetDesaturateEmbeddedTextures(desaturate)
```

Arguments:
- `desaturate`: bool

### SetFixedColor

```lua
self:SetFixedColor(fixedColor)
```

Arguments:
- `fixedColor`: bool

### SetFont

```lua
success = self:SetFont(fontFile, fontHeight, [flags])
```

Arguments:
- `fontFile`: FontAsset
- `fontHeight`: uiFontHeight
- `flags`: TBFFlags, may be nil

Returns:
- `success`: bool

### SetFontHeight

```lua
self:SetFontHeight(height)
```

Arguments:
- `height`: uiUnit

### SetFontObject

```lua
self:SetFontObject(font)
```

Arguments:
- `font`: SimpleFont

### SetFormattedText

```lua
self:SetFormattedText(text)
```

Arguments:
- `text`: cstring

### SetIndentedWordWrap

```lua
self:SetIndentedWordWrap(wrap)
```

Arguments:
- `wrap`: bool

### SetJustifyH

```lua
self:SetJustifyH(justifyH)
```

Arguments:
- `justifyH`: JustifyHorizontal

### SetJustifyV

```lua
self:SetJustifyV(justifyV)
```

Arguments:
- `justifyV`: JustifyVertical

### SetMaxLines

```lua
self:SetMaxLines(maxLines)
```

Arguments:
- `maxLines`: number

### SetNonSpaceWrap

```lua
self:SetNonSpaceWrap(wrap)
```

Arguments:
- `wrap`: bool

### SetRotation

```lua
self:SetRotation(radians)
```

Arguments:
- `radians`: number

### SetScaleAnimationMode

```lua
self:SetScaleAnimationMode(scaleAnimationMode)
```

Arguments:
- `scaleAnimationMode`: FontStringScaleAnimationMode

### SetShadowColor

```lua
self:SetShadowColor(colorR, colorG, colorB, [a])
```

Arguments:
- `colorR`: number
- `colorG`: number
- `colorB`: number
- `a`: SingleColorValue, may be nil

### SetShadowOffset

```lua
self:SetShadowOffset(offsetX, offsetY)
```

Arguments:
- `offsetX`: number
- `offsetY`: number

### SetSmoothScaling

```lua
self:SetSmoothScaling(smoothScaling)
```

Arguments:
- `smoothScaling`: bool. If true, text height will not snap to nearest whole numbers for scaled font strings.

### SetSpacing

```lua
self:SetSpacing(spacing)
```

Arguments:
- `spacing`: uiUnit

### SetText

```lua
self:SetText([text])
```

Arguments:
- `text`: cstring, default ""

### SetTextColor

```lua
self:SetTextColor(colorR, colorG, colorB, [a])
```

Arguments:
- `colorR`: number
- `colorG`: number
- `colorB`: number
- `a`: SingleColorValue, may be nil

### SetTextHeight

```lua
self:SetTextHeight(height)
```

Arguments:
- `height`: uiUnit

### SetTextScale

```lua
self:SetTextScale(textScale)
```

Arguments:
- `textScale`: number

### SetTextToFit

```lua
self:SetTextToFit([text])
```

Arguments:
- `text`: cstring, default ""

### SetWordWrap

```lua
self:SetWordWrap(wrap)
```

Arguments:
- `wrap`: bool

---
Make an addon with your AI: tell it "Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it."
