grimfang4 / SDL_FontCache

A generic font caching C library with loading and rendering support for SDL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Size of Wrapped Text

SimonDoesGit opened this issue · comments

How can I get the size of wrapped text without rendering via FC_DrawColumn?

FC_DrawColumn() assumes you know what the width of the column is. You can use that width in FC_GetColumnHeight() to get the other dimension.

Just because it's a related use-case, I should also mention that FC_GetCharacterOffset() can be used to tell where to draw a text editing cursor and FC_GetPositionFromOffset() can be used to convert mouse click coordinates into a character index.

Thank you