fschutt / printpdf

A fully-featured PDF library for Rust, WASM-ready
https://fschutt.github.io/printpdf/
MIT License
829 stars 98 forks source link

Fix CurTransMat::combine_matrix for arm-unknown-linux-gnueabi #173

Closed vklachkov closed 8 months ago

vklachkov commented 8 months ago

Thanks for the library!

I tried to use it on a Raspberry Pi Zero and got incorrect PDF files. After some research, it turned out that CurTransMat::combine_matrix does not work on the target arm-unknown-linux-gnueabi due to a bug in Rust compiler.

This MR implements a workaround.

The only problem is that Rust currently doesn't support cfg(target) and therefore this workaround will also apply to all ARMs, regardless. But this shouldn't be a problem. If accuracy and performance are very important, I will make this fix an optional feature.

fschutt commented 8 months ago

Well that's a new one, lol. PDFs not working due to a compiler bug. Thanks for debugging!