Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust rendered surface width, add an "SDL_PixelFormat *format" parameter. #7

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: unspecified
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2006-06-25 17:40:11 +0000, Samuel Mimram wrote:

Dear Developers!

Sometimes the "something" text is as wide as "somethingi". I wrote a line editor
for SDL, and it is a problem for me to determine the cursor position in pixels.
(I cannot say precisely the with of the text on the cursor's left side)
My wish is that the rendered surface be exactly as wide as the rendered text.

The second is that TTF_RenderText_Shaded() and TTF_RenderText_Solid() should have an "SDL_PixelFormat *format" parameter, so the newly generated surface would fit in the application instantly without any additional blitting.

I know it is not christmas so my third wish is very very optional. Make a
function with the name of TTF_RenderText_AlphaShaded(). It would be a mix of the
...Solid and the ...Shaded. The RGB channels would be filled with the ...Solid
algorythm and the Alpha channel would be filled with the ...Shaded algorythm. The result would be instant for blitting onto the screen. (The surface would be
always 32bit and the untouched areas of the surface would be transparent black)

Thanks for the TTF library! You saved my life ;-)
Thanks for reading my wishes!
I hope you will find useful the above.

More infos on the Debian bug report can be found at :
http://bugs.debian.org/206057

On 2006-06-30 04:33:35 +0000, Nicos wrote:

A workaround: scan the resulting surface from left and from the right and find the x for the first non non-transparent pixel for each side. Subtracting those values from the width will give you the "true" width.

@SDLBugzilla SDLBugzilla added enhancement New feature or request wontfix This will not be worked on labels Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant