I'm using the Pathfinder C-binding to render text in my application, and I noticed that the program crashed irrecoverably when the selected font wasn't found or couldn't be loaded. I initially thought this was just a minor problem in the C-binding code, but when I investigated it further, it seems to be a deeper design issue.
I'm not a Rust expert so I don't know the reason for these panics, but I think Pathfinder should propagate these error conditions so that they can be handled further up by the caller, including from C.
I'm using the Pathfinder C-binding to render text in my application, and I noticed that the program crashed irrecoverably when the selected font wasn't found or couldn't be loaded. I initially thought this was just a minor problem in the C-binding code, but when I investigated it further, it seems to be a deeper design issue.
https://github.com/servo/pathfinder/blob/e4fcda0d5259d0acf902aee6de7d2501f2bd6629/canvas/src/text.rs#L232-L236
I'm not a Rust expert so I don't know the reason for these panics, but I think Pathfinder should propagate these error conditions so that they can be handled further up by the caller, including from C.