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

Text Rendering Bug #11

Open
OneMeanDragon opened this issue Oct 15, 2021 · 3 comments
Open

Text Rendering Bug #11

OneMeanDragon opened this issue Oct 15, 2021 · 3 comments

Comments

@OneMeanDragon
Copy link

OneMeanDragon commented Oct 15, 2021



Left is what it should look like: C++ using the sdl libs directly, right is what it looks like under SharpDL.
Both font sizes are set to 20 and here is the font used z3.ttf.
Dunno whats up with it to me looks like the .net library added some sort of shadowing to it which shouldent be the case.

@OneMeanDragon
Copy link
Author

OneMeanDragon commented Oct 15, 2021

C++
SDL_Surface* textSurface = TTF_RenderText_Solid(gFont, textureText.c_str(), textColor);

I guess may be the issue, havent looked that deep into the library itself lol
edit: atleast I havent found any ref to that api call.

@OneMeanDragon
Copy link
Author

OneMeanDragon commented Oct 15, 2021

and found that.
TrueTypeTextFactory.CreateTrueTypeText -> internal Surface(IFont font, string text, Color color, int wrapLength)
needs an optional enum defaulting to blended.
options being Solid, Shaded, Blended, (and all the rest if you realy wanted but pretty sure those are the main 3 everyone uses) all of which have the wrapper option so a simple switch statement, which may get rid of that text behavior I got going on.

@OneMeanDragon
Copy link
Author

OneMeanDragon commented Oct 16, 2021

I unhooked my branch of the code, since i think I'm into your experimental branch, anyways if you follow around what I did there that corrected the Text drawing to match my C++ app.

I'll leave it here for whenever you get around to farting with this library again due to I cant make C# not look sloppy lol, not to mention it looked like my commit overwrote a lot of what shouldn't have been in the process, so i broke the branch.

I have VisualBasic .Net examples in the example folder as well which should be working with the actual Current NuGet package you have up there.

EDIT: Fixed links to my fork since I don't want it being sent in the push req's, and i broke my original fork lol anyhow...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant