You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am proposing a feature that would give back to the user the correct dimensions of a surface with the supplied text of whatever format added. A cstring and UTF-8 implementation would be needed. It would roughly have this signature:
// SDL_Rect is placeholder for a tuple of width and heightSDL_RectTTF_SizeTextWrapped(TTF_Font*font, constchar*text, int*wrap_width);
SDL_RectTTF_SizeUTF8Wrapped(TTF_Font*font, constchar*text, int*wrap_width);
The idea behind this is that wrap_width would be the maximum width of the surface, if text does not reach the wrap_width then output width is shrunk to the width of the text supplied. After this point width will be the minimum of wrap_width and the longest line of text in the wrapped input.
This is in line with a feature I am adding to pygame-ce which adds the very same feature so I would be able to supply this feature also.
The text was updated successfully, but these errors were encountered:
I am proposing a feature that would give back to the user the correct dimensions of a surface with the supplied text of whatever format added. A cstring and UTF-8 implementation would be needed. It would roughly have this signature:
The idea behind this is that
wrap_width
would be the maximum width of the surface, iftext
does not reach thewrap_width
then output width is shrunk to the width of the text supplied. After this point width will be the minimum ofwrap_width
and the longest line of text in the wrapped input.This is in line with a feature I am adding to
pygame-ce
which adds the very same feature so I would be able to supply this feature also.The text was updated successfully, but these errors were encountered: