plotters-rs/plotters

[BUG] No such font error on almost all examples on macOS

shanecelis opened this issue · 1 comments

Describe the bug

When I try to run almost any example, I get the following error: Error: BackendError(FontError(NoSuchFont("sans-serif", "normal"))).

$ cargo run --example histogram
...
warning: use of deprecated method `chrono::NaiveDate::and_hms`: use `and_hms_opt()` instead
   --> plotters/src/coord/ranged1d/types/datetime.rs:192:14
    |
192 |         date.and_hms(0, 0, 0)
    |              ^^^^^^^

warning: `plotters` (lib) generated 26 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/examples/histogram`
Error: BackendError(FontError(NoSuchFont("sans-serif", "normal")))

To Reproduce

Running any example practically will do. I believe I did find one that didn't have text that ran fine, but I can't remember which one that is.

Version Information

I'm on macOS 14.0, x86; rustc 1.75.0.

I'm using the current origin/master which is 3a4c675, but this has been the case for months. I've just been too lazy to report the issue.

I filed an issue with font-kit as well, and that appears to be the primary problem. If anyone else is running into this issue it was due to an extra Arial font file in my ~/Library/Fonts directory that the font-kit parser did not like.

As the principal problem appears to be with font-kit, I'm closing this issue.