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

terminal.png not provided #93

Open
jiri opened this issue Jan 31, 2015 · 6 comments
Open

terminal.png not provided #93

jiri opened this issue Jan 31, 2015 · 6 comments

Comments

@jiri
Copy link

jiri commented Jan 31, 2015

The tcod-rs build script could copy it to the root of the project?

@tomassedovic
Copy link
Owner

I'm not sure what you mean. terminal.png is checked into the tcod-rs repo:

https://github.com/tomassedovic/tcod-rs/blob/master/terminal.png

But if you mean your own projects that use the tcod crate, you should copy it yourself (either from tcod-rs or libtcod) or choose another font using tcod::Console::set_custom_font. terminal.png kind of sucks and it's there just to be able to run tests and examples easily. But in general, you should pick a font from libtcod/data/fonts/ or download a font in the same format from the internet.

@jiri
Copy link
Author

jiri commented Jan 31, 2015

What I meant that the version checked out with the repo should be findable by the library by default.

So a solution that would use the one included when another isn't available would make most sense, perhaps? I just feel that for a total newbie, the absence of terminal.png could be confusing, especially when one is included with TCOD itself.

I propose adding a check that if the terminal.png isn't available, the provided one is used and a warning is generated in place of the "SDL : cannot load terminal.png" warning :)

@tomassedovic
Copy link
Owner

Sorry, I'm still not sure what your exact problem is.

Do you mean having a project that depends on the tcod crate? And when you try to run in, you get the cannot load terminal.png message? Or do you mean something else?

If that is the case, then the tcod crate and/or its build script can't really produce or load its own terminal.png. See here:

http://doc.crates.io/build-script.html

the build script has no way of knowing where the project that uses it is and it shouldn't interfere with it at all. The error message itself comes from libtcod -- the C version that tcod-rs provides Rust bindings for.

And you have the same problem with your C, C++ or Python libtcod code:

http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod,_part_1

I understand this can be frustrating for a Rust / libtcod newbie, but the best think we can do I think is just document this. Or maybe provide an engine-like function that looks for the font and if it isn't there and there isn't an alternative set, we could bail out.

But strictly speaking, with this library you're supposed to provide the fonts (just like any other assets) and the right calls yourself. Libtcod isn't as much an engine as it is a library that you write your roguelike engine on top of.

@jiri
Copy link
Author

jiri commented Feb 9, 2015

Sorry for the latency.

Yeah, you raise some valid points there. Providing a default font with the library is probably not desirable.

Feel free to mark this as resolved ^^

@tomassedovic
Copy link
Owner

Cool :-). I'll keep this open because we should mention this in the docs and/or the examples.

I'd like people who aren't familiar with libtcod to use this with as few issues as possible.

@fedgrant
Copy link

Hey, I started working on https://tomassedovic.github.io/roguelike-tutorial/part-1-graphics.html and I got stuck with the same issue as above. Not knowing enough Rust, it took me a while to find this issue which helped me solve the problem. Can the tutorial be updated to point to this issue?

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

3 participants