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

TTF no longer works? #2

Closed
NHDaly opened this issue Mar 9, 2018 · 9 comments
Closed

TTF no longer works? #2

NHDaly opened this issue Mar 9, 2018 · 9 comments

Comments

@NHDaly
Copy link
Collaborator

NHDaly commented Mar 9, 2018

Hi! So it seems that for some reason SDL_ttf no longer works... It crashes for me when executing SDL2.CreateTextureFromSurface(renderer,text). I assume for you as well, since you commented out the ttf code from SDL2.jl in daaee6c.

But it's strange, I can't figure out why it's broken! I tried reverting the changes in 68b1767 that removed the SDL_ prefix (imagining that maybe there's a name collision going on somehow), but that didn't fix it.

The reason I'm so surprised, is that I've been happily working with this package for a few weeks, and TTF has worked just fine that whole time... But I can't for the life of me tell what's different between HEAD and what I'd been messing around with! I've pushed all of my changes here: NHDaly/SDL2.jl/tree/outdated--custom_mods. Unfortunately, like I said, I forked really early, so the last commit we have in common is 7e0d03e ("initial commit").

$ git log --all --graph --decorate --oneline
* daaee6c (HEAD -> master, origin/master, SDL_mixer) windows build
* 02da3a1 test
* 804804d REQUIRE
* 667d499 Linux build
* 345c2bc updated README
* 716b0d8 event handling
* 7bc5f4e things
* 88c360a fix example
* 68b1767 build and removed SDL_ prefix
| * 00ca98f (nhdaly/outdated--custom_mods, outdated--custom_mods) Parking this branch! Contains a bunch of my edits.
| * 8ae739c Manually defined some macros that were skipped.
| * 04936f8 Move all global initializations into Init function.
| * e3f13b2 Added SDL2_mixer!
| * f5d2dfe (release-libs) Added pacakged libs for SDL2_mixer
| * fcac892 Switched to packaged libs
| * 052b036 NATHAN: added build script
| * 53967f3 Nathans Changes: SDL->SDL2 + portability
|/
* 7e0d03e initial commit
* 25b9f4b SDL.jl generated files.
* fac72db initial empty commit

So i'm trying to compare the two to see what's different, but haven't had any luck so far. Do you have any ideas? :) Once we figure this out, i can also send a separate PR to add SDL_mixer.

@NHDaly
Copy link
Collaborator Author

NHDaly commented Mar 9, 2018

haha okay! So i found the problem. Sorry i pasted so much text up there. You can basically ignore all of that.

The issue was simply that we were using different versions of the SDL ttf library. :) Oops! Should be able to fix it with #4! :)
Thanks again for this cool package!

@jonathanBieler
Copy link
Collaborator

jonathanBieler commented Mar 10, 2018

The reason why I removed it is that I was trying the make the build work on windows, but the provided binaries don't work, I don't exactly remember why.

https://github.com/jonathanBieler/SDL2.jl/blob/master/deps/build.jl#L18

Does your PR works on windows and OS X?

Otherwise we could try to get a working dll somewhere and then distribute that with the package.

@NHDaly
Copy link
Collaborator Author

NHDaly commented Mar 13, 2018

The reason why I removed it is that I was trying the make the build work on windows, but the provided binaries don't work, I don't exactly remember why.

Oh i see. Interesting. Well, either way, I think the change in #3 is a necessary change for mac/linux. Homebrew has two different repos for the SDL1 and SDL2 versions of SDL_ttf, and before #3 this code is using the older, SDL1 version:

$ brew info sdl_ttf
sdl_ttf: stable 2.0.11 (bottled)
Library for using TrueType fonts in SDL applications
https://www.libsdl.org/projects/SDL_ttf/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/sdl_ttf.rb
==> Dependencies
Build: pkg-config ✔
Required: sdl ✘, freetype ✔
$ brew info sdl2_ttf
sdl2_ttf: stable 2.0.14 (bottled)
Library for using TrueType fonts in SDL applications
https://www.libsdl.org/projects/SDL_ttf/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/sdl2_ttf.rb
==> Dependencies
Build: pkg-config ✔
Required: sdl2 ✘, freetype ✔

We want the second one, which PR #3 should fix. :)

@NHDaly
Copy link
Collaborator Author

NHDaly commented Mar 13, 2018

As to the windows problem...

Does your PR works on windows and OS X?

Huh, i'm surprised it didn't work on windows, because the line you linked above is actually correct! It was only the mac/linux versions that have the wrong-version problem. I've set up an appveyor account so i can test on windows (since i don't have access to a windows machine.)

I'm playing with trying to fix the windows build in this PR:
NHDaly#1

(It looks like the appveyor config is out of date so i'm gonna try to fix that first and then try turning on SDL_ttf again)
If i can figure it out, i'll send a PR over here!! :)


Otherwise we could try to get a working dll somewhere and then distribute that with the package.

Yeah, if for some reason it's the binary that's the problem, I think that would work, yeah!

@jonathanBieler
Copy link
Collaborator

The issue I had is when BinDeps tests the library (it opens it and test that it works), but I'm not sure what the issue was exactly, maybe I messed something up.

@NHDaly
Copy link
Collaborator Author

NHDaly commented Mar 13, 2018

:/ yeah okay i see what you mean. It's the same for me.

But it's weird, because when I tried just manually creating the deps/deps.jl file myself, and listing the correct binary path for SDL2_ttf.dll, it seems like the actual example1_cairo.jl file works correctly! So idk why BinDeps complains about it...


I opened #5 so that we can have a successful windows build to compare with.

@NHDaly
Copy link
Collaborator Author

NHDaly commented Jan 27, 2020

Is TTF finally working correctly on windows, now, after #41? :)

@giordano
Copy link
Contributor

There are tests for ttf that are passing on Windows on AppVeyor, but maybe @aviks can tell more about actual use rather than a CI service.

@aviks
Copy link
Contributor

aviks commented Sep 24, 2022

This should be closed, TTF works, it's used in Gamezero now certainly.

@Gnimuc Gnimuc closed this as completed Sep 24, 2022
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

5 participants