piston-examples icon indicating copy to clipboard operation
piston-examples copied to clipboard

Can build and run, however, cannot show font correctly

Open ScottHuangZL opened this issue 10 years ago • 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

ScottHuangZL avatar Sep 22 '15 15:09 ScottHuangZL

This is probably an issue with libfreetype on windows. See https://github.com/PistonDevelopers/freetype-sys/issues/37

bvssvni avatar Sep 23 '15 06:09 bvssvni

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.

ScottHuangZL avatar Sep 23 '15 12:09 ScottHuangZL

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

ghost avatar Dec 15 '15 01:12 ghost

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?

mitchmindtree avatar Dec 15 '15 02:12 mitchmindtree

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).

ghost avatar Dec 15 '15 02:12 ghost

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.

ghost avatar Dec 15 '15 02:12 ghost

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

bug

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

ghost avatar Dec 15 '15 02:12 ghost

One final note, I set up linkage to freetype as per these instructions:

https://github.com/PistonDevelopers/freetype-sys/blob/b7a07f53d1614a387fd7a6dc5cc9a2a33b8ac1f7/README.md

ghost avatar Dec 15 '15 02:12 ghost

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.)

ghost avatar Dec 15 '15 23:12 ghost