linebender / piet

An abstraction for 2D graphics.
Apache License 2.0
1.24k stars 93 forks source link

Mention submodules in readme & at likely error site #492

Closed cmyr closed 2 years ago

cmyr commented 2 years ago

The problem here is that include_bytes runs at compile time, and it doesn't seem to matter what features are enabled? So I suspect this problem will pop up fairly often.

I don't want to spend the time to try and figure out a real solution right now (although someone else is welcome to!) but this at least mentions the problem in the README, and adds a comment inline that will be printed whenever this problem is encountered. Maybe someone will even see it?

error: couldn't read piet/src/samples/../../snapshots/resources/Anaheim-Regular.ttf: No such file or directory (os error 2)
  --> piet/src/samples/picture_13.rs:16:28
   |
16 |       let _ = text.load_font(include_bytes!(
   |  ____________________________^
17 | |         "../../snapshots/resources/Anaheim-Regular.ttf"
18 | |     )); // SEEING AN ERROR? run `git submodule update --init`
   | |_____^
   |
   = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

closes #491