PistonDevelopers/piston-examples

Can build and run, however, cannot show font correctly

ScottHuangZL opened this issue · 9 comments

Dear Piston,

I am try to run the hello_world program, it can compile and run, however, the word did not show correct since the font not show correctly. It just use a filled rectangle to stands for each character.

Could you help to look into it? And give a hand to me? thanks.
I am use Win 7 64bit, Rust 1.5 nightly.

Btw, I also download other games to test, such as rocket and pong-rs, they can run well with same OS and Rust. Thanks.

Regards,
Scott Huang

This is probably an issue with libfreetype on windows. See PistonDevelopers/freetype-sys#37

The game "pong-rs" or "rocket" can build and run smoothly in my computer.
So, there should be some bug/issue in hello_world sample.
Please help to compare and find out root cause. Is it caused by they use glutin_window instead of piston_window?? How to resolve it? Thanks.

This is also happening to me on Windows 7, 64-bit. I'm using Rust 1.5 stable.

Hmm this does seem strange, I can't see anything wrong with the example after a quick look - are you able to test it with a different font perhaps?

I will try and report back.

FWIW I'm investigating right now, and freetype-rs's single_glyph example seems to be working correctly. The only crate that depends on freetype-rs directly is piston2d-gfx_graphics, and the only crate that depends on that is piston_window itself (which is the crate I was using when I found this problem).

I tried with a different font. Same (incorrect) result. Additionally, I have reason to believe the example is not wrong, as it works for me on Linux Mint, and a friend reported that it works for them on Windows 10.

For reference, here's what the issue looks like:

bug

Note that this is a screenshot from a program slightly different from the example.

Update: I cannot render an image at all on my system. I presume text rendering does not work because it creates an Image and renders with that. (Attempting to render an image results in the same black box of the same dimensions as the image.)